Skip to content

Commit 2527835

Browse files
author
marcpalmer
committed
Added version output to build GRAILS-408 and fixed keyword expansion in artefacts (not previously loading build.properties)
git-svn-id: https://svn.codehaus.org/grails/trunk@1706 1cfb16fd-6d17-0410-8ff1-b7e8e1e2867d
1 parent dec472b commit 2527835

File tree

1 file changed

+38
-29
lines changed

1 file changed

+38
-29
lines changed

src/grails/build.xml

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" />
99
<taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" />
1010

11-
<target name="help">
11+
<target name="help" depends="init-props">
1212
<echo>Usage: grails [target]
1313

1414
Targets:
@@ -66,9 +66,18 @@ Targets:
6666
result
6767
}
6868
</groovy>
69+
70+
<property file="${grails.home}/build.properties"/>
71+
72+
<echo>
73+
Welcome to Grails ${grails.version} - http://grails.org/
74+
Licensed under Apache Standard License 2.0
75+
76+
Grails home is set to: ${grails.home}
77+
</echo>
6978
</target>
70-
71-
<target name="init-structure" depends="init-props">
79+
80+
<target name="init-structure" depends="init-props">
7281
<mkdir dir="${path}src"/>
7382
<mkdir dir="${path}src/java"/>
7483
<mkdir dir="${path}src/groovy"/>
@@ -89,32 +98,32 @@ Targets:
8998
<mkdir dir="${path}web-app/css"/>
9099
<mkdir dir="${path}web-app/images"/>
91100
<mkdir dir="${path}web-app/WEB-INF/classes"/>
92-
<mkdir dir="${path}web-app/META-INF"/>
101+
<mkdir dir="${path}web-app/META-INF"/>
93102
<!--<mkdir dir="${path}
94103
"/>-->
95104
<!--<mkdir dir="${path}html"/>-->
96105
<mkdir dir="${path}lib"/>
97106
<mkdir dir="${path}spring"/>
98107
<mkdir dir="${path}hibernate"/>
99-
<mkdir dir="${grails.home}/dist"/>
100-
</target>
101-
108+
<mkdir dir="${grails.home}/dist"/>
109+
</target>
110+
102111
<target name="upgrade" depends="init-structure,clean" description="Upgrades a Grails project from the information in GRAILS_HOME">
103112
<copy todir="${path}web-app/WEB-INF">
104113
<fileset dir="${grails.home}/src/war/WEB-INF">
105114
<include name="applicationContext.xml"/>
106115
</fileset>
107-
</copy>
116+
</copy>
108117
<copy todir="${path}grails-app/taglib">
109118
<fileset dir="${grails.home}/src/grails/grails-app/taglib" />
110-
</copy>
119+
</copy>
111120
<copy todir="${path}grails-app" overwrite="false">
112121
<fileset dir="${grails.home}/src/grails/grails-app" />
113-
</copy>
122+
</copy>
114123
<copy file="${grails.home}/src/war/WEB-INF/web${servlet.version}.template.xml" tofile="${path}web-app/WEB-INF/web.template.xml"/>
115-
<copy file="${grails.home}/src/war/WEB-INF/sitemesh.xml" tofile="${path}web-app/WEB-INF/sitemesh.xml"/>
124+
<copy file="${grails.home}/src/war/WEB-INF/sitemesh.xml" tofile="${path}web-app/WEB-INF/sitemesh.xml"/>
116125
<copy file="${grails.home}/src/war/WEB-INF/web${servlet.version}.template.xml" tofile="${path}web-app/WEB-INF/web.template.xml"/>
117-
126+
118127
<!-- correct the .classpath -->
119128
<groovy><![CDATA[
120129
// copy .classpath first
@@ -123,50 +132,50 @@ Targets:
123132
new File (path, ".classpath.bak").withWriter () { w ->
124133
new File(path, ".classpath").eachLine { w.writeLine(it) }
125134
}
126-
135+
127136
new File (path, ".classpath").delete()
128-
137+
129138
new File (path, ".classpath").withWriter () { w ->
130139
new File (path, ".classpath.bak").eachLine {
131140
if (!((it =~ /.*path=\"GRAILS_HOME\/lib\/.*\.jar\"/) ||
132141
(it =~ /.*path=\"GRAILS_HOME\/dist\/grails-.*\.jar\"/) ||
133142
(it =~ /<\/classpath>/))) { w.writeLine(it) }
134143
}
135-
136-
project.references['grailsLibs']().tokenize("\n").each { lib ->
144+
145+
project.references['grailsLibs']().tokenize("\n").each { lib ->
137146
w.writeLine(" <classpathentry kind=\"var\" path=\"GRAILS_HOME/lib/${lib}\" />")
138147
}
139148
w.writeLine (" <classpathentry kind=\"var\" path=\"GRAILS_HOME/dist/${project.references['grailsJar']()}\" />")
140149
w.writeLine ("</classpath>")
141150
}
142-
}
151+
}
143152
]]></groovy>
144-
153+
145154
</target>
146-
155+
147156
<target name="init" depends="init-structure" description="Initialise the current app">
148157
<copy todir="${path}web-app">
149158
<fileset dir="${grails.home}/src/war">
150159
<include name="**/**"/>
151160
<exclude name="WEB-INF/**"/>
152161
</fileset>
153162
</copy>
154-
163+
155164
<copy todir="${path}web-app/WEB-INF">
156165
<fileset dir="${grails.home}/src/war/WEB-INF">
157166
<include name="applicationContext.xml"/>
158167
<include name="log4j.properties"/>
159168
<include name="sitemesh.xml"/>
160169
</fileset>
161-
</copy>
170+
</copy>
162171

163-
<copy file="${grails.home}/src/war/WEB-INF/log4j.properties"
172+
<copy file="${grails.home}/src/war/WEB-INF/log4j.properties"
164173
tofile="${path}web-app/WEB-INF/log4j.development.properties" />
165-
<copy file="${grails.home}/src/war/WEB-INF/log4j.properties"
174+
<copy file="${grails.home}/src/war/WEB-INF/log4j.properties"
166175
tofile="${path}web-app/WEB-INF/log4j.test.properties" />
167-
<copy file="${grails.home}/src/war/WEB-INF/log4j.properties"
176+
<copy file="${grails.home}/src/war/WEB-INF/log4j.properties"
168177
tofile="${path}web-app/WEB-INF/log4j.production.properties" />
169-
178+
170179
<copy todir="${path}grails-app">
171180
<fileset dir="${grails.home}/src/grails/grails-app" />
172181
</copy>
@@ -191,7 +200,7 @@ Targets:
191200
<equals arg1="${servlet.version}" arg2="2.3"/>
192201
</condition>
193202
</target>
194-
203+
195204
<target name="init:copyjstl" depends="init:checkjstl" unless="is.servlet.2.5">
196205
</target>
197206

@@ -277,9 +286,9 @@ Targets:
277286
<groovy><![CDATA[
278287
def projName = properties."project.name"
279288
properties."project.class.name" = project.references['lower'](projName)
280-
289+
281290
def grailsLibsToken = ""
282-
project.references['grailsLibs']().tokenize("\n").each { lib ->
291+
project.references['grailsLibs']().tokenize("\n").each { lib ->
283292
grailsLibsToken += " <classpathentry kind=\"var\" path=\"GRAILS_HOME/lib/${lib}\" />\n"
284293
}
285294
@@ -291,7 +300,7 @@ Targets:
291300
<fileset dir="${grails.home}/src/grails/templates/ide-support/eclipse" includes="*.*" excludes=".launch" />
292301
</copy>
293302
<copy file="${grails.home}/src/grails/templates/ide-support/eclipse/.launch" tofile="${project.name}/${project.name}.launch" />
294-
303+
295304
<replace dir="${project.name}" includes="*.*" token="@grails.libs@" value="${grails.libs}"/>
296305
<replace dir="${project.name}" includes="*.*" token="@grails.jar@" value="${grails.jar}"/>
297306
<replace dir="${project.name}" includes="*.*" token="@grails.version@" value="${grails.version}"/>

0 commit comments

Comments
 (0)