GRAILS-1019: Allowing expressions to be used with the 'disabled' attribute for g...
[grails.git] / scripts / SetVersion.groovy
blobab4f355c023ef5ce62bfc15a74084bd46dd92a51
1 /*
2 * Copyright 2004-2005 the original author or authors.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 /**
18 * Gant script that manages the application version
20 * @author Marc Palmer
21 * @author Sergey Nebolsin (nebolsin@gmail.com)
23 * @since 0.5
26 import org.codehaus.groovy.grails.commons.GrailsClassUtils as GCU
27 import groovy.text.SimpleTemplateEngine
29 Ant.property(environment:"env")
30 grailsHome = Ant.antProject.properties."env.GRAILS_HOME"
32 includeTargets << new File ( "${grailsHome}/scripts/Init.groovy" )
34 target ('default': "Sets the current application version") {
35 if(args != null) {
36 Ant.property(name:"app.version.new", value: args)
37 } else {
38 Ant.property(file:"${basedir}/application.properties")
39 def oldVersion = Ant.antProject.properties.'app.version'
40 Ant.input(addProperty:"app.version.new", message:"Enter the new version",defaultvalue:oldVersion)
43 def newVersion = Ant.antProject.properties.'app.version.new'
44 Ant.propertyfile(file:"${basedir}/application.properties") {
45 entry(key:"app.version", value: newVersion)
48 event("StatusFinal", [ "Application version updated to $newVersion"])