/[snow]/trunk/build.xml
ViewVC logotype

Contents of /trunk/build.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5 - (show annotations)
Sun Oct 18 22:14:01 2009 UTC (4 years, 6 months ago) by astalla
File MIME type: text/xml
File size: 7937 byte(s)
Added property change listener supporting nested properties (dot notation)
and relative tests. Modified build.xml to launch JUnit tests.
Added Java-friendly callback class.
Small refactorings.
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project xmlns="antlib:org.apache.tools.ant"
3 name="snow-master" default="help" basedir=".">
4 <description>Compiling and packaging Snow</description>
5
6 <property file="build.properties"/>
7
8 <property name="build.dir"
9 value="${basedir}/build"/>
10 <property name="build.classes.dir"
11 value="${build.dir}/bin"/>
12 <property name="src.dir"
13 value="${basedir}/src"/>
14 <property name="lib.dir"
15 value="${basedir}/lib"/>
16 <property name="dist.dir"
17 value="${basedir}/dist"/>
18 <property name="snow.jar.path"
19 value="${dist.dir}/snow.jar"/>
20 <property name="snow.ext.dir"
21 value="${basedir}/ext"/>
22
23 <target name="help">
24 <echo>Main Ant targets:
25 snow.compile
26 -- compile SNOW to ${build.classes.dir}.
27 snow.jar
28 -- create packaged ${snow.jar.path}.
29 snow.source.zip snow.source.tar
30 -- create source distributions in ${dist.dir}.
31 snow.clean
32 -- remove SNOW intermediate files
33 snow.test
34 -- run SNOW's JUnit tests</echo>
35 </target>
36
37 <patternset id="snow.source.java">
38 <include name="**/*.java"/>
39 </patternset>
40
41 <patternset id="snow.source.lisp">
42 <include name="snow/**/*.lisp"/>
43 <include name="snow/**/*.asd"/>
44 </patternset>
45
46 <patternset id="snow.objects">
47 <include name="snow/**/*.class"/>
48 <include name="snow/**/*.cls"/>
49 <include name="snow/**/*.abcl"/>
50 <patternset refid="snow.source.lisp"/>
51 </patternset>
52
53 <path id="snow.classpath.dist">
54 <pathelement location="${snow.jar.path}"/>
55 </path>
56
57 <path id="snow.classpath.build">
58 <pathelement location="${build.classes.dir}"/>
59 <fileset dir="${lib.dir}">
60 <include name="**/*.jar"/>
61 </fileset>
62 </path>
63
64 <target name="snow.compile" depends="snow.compile.lisp">
65 <echo>Compiled SNOW with Java version: ${java.version}</echo>
66 </target>
67
68 <target name="snow.init">
69 <tstamp>
70 <format property="build" pattern="EEE MMM dd yyyy HH:mm:ss zzz"/>
71 </tstamp>
72
73 <tstamp>
74 <format property="build.stamp" pattern="yyyymmdd-HHmm"/>
75 </tstamp>
76
77 <!--- antversion fails in ant 1.7.1 <antversion property="ant.version"
78 atleast="1.7"/> -->
79 <property name="java.path"
80 value="${java.home}/bin/java"/>
81 </target>
82
83 <target name="snow.compile.java"
84 depends="snow.init">
85 <mkdir dir="${build.dir}"/>
86 <mkdir dir="${build.classes.dir}"/>
87 <javac destdir="${build.classes.dir}"
88 classpathref="snow.classpath.build"
89 debug="true"
90 target="1.6"
91 failonerror="true">
92 <src path="${src.dir}/java"/>
93 <patternset refid="snow.source.java"/>
94 </javac>
95 <echo message="${build}"
96 file="${build.classes.dir}/snow/build"/>
97 </target>
98
99 <target name="snow.copy.lisp">
100 <copy todir="${build.classes.dir}" preservelastmodified="yes">
101 <fileset dir="${src.dir}/lisp">
102 <patternset refid="snow.source.lisp"/>
103 </fileset>
104 <fileset dir="${lib.dir}">
105 <patternset>
106 <include name="**/*" />
107 <exclude name="**/*.jar"/>
108 </patternset>
109 </fileset>
110 </copy>
111 </target>
112
113 <target name="snow.compile.lisp"
114 depends="snow.copy.lisp,snow.compile.java">
115 <java classpathref="snow.classpath.build"
116 fork="true"
117 failonerror="true"
118 classname="org.armedbear.lisp.Main"
119 dir="${build.classes.dir}">
120 <arg value="--noinit"/>
121 <arg value="--load"/>
122 <arg value="snow/compile-system.lisp"/>
123 </java>
124 </target>
125
126 <target name="snow.jar.uptodate" depends="snow.compile">
127 <uptodate property="snow.jar.uptodate.p" targetfile="${snow.jar.path}">
128 <srcfiles dir="${build.classes.dir}">
129 <patternset refid="snow.objects"/>
130 </srcfiles>
131 </uptodate>
132 </target>
133
134 <target name="snow.jar" depends="snow.jar.uptodate"
135 unless="snow.jar.uptodate.p">
136 <mkdir dir="${dist.dir}"/>
137 <jar destfile="${snow.jar.path}"
138 compress="true"
139 basedir="${build.classes.dir}">
140 <manifest>
141 <attribute name="Main-Class" value="snow.Snow"/>
142 </manifest>
143 </jar>
144 </target>
145
146 <target name="snow.run" depends="snow.jar">
147 <java fork="true"
148 classpathref="snow.classpath.dist"
149 classname="snow.Snow">
150 </java>
151 </target>
152
153 <target name="snow.clean">
154 <delete dir="${build.dir}"/>
155 <delete file="${snow.jar.path}"/>
156 </target>
157
158 <target name="snow.dist" depends="snow.jar">
159 <copy file="${snow.jar.path}"
160 toFile="${dist.dir}/snow.jar"/>
161 </target>
162
163 <target name="snow.distclean" depends="snow.clean">
164 <delete dir="${dist.dir}"/>
165 </target>
166
167 <patternset id="snow.dist.misc"
168 description="Additional includes in the source distributions relative to basedir">
169 <include name="build.xml"/>
170 <include name="COPYING"/>
171 </patternset>
172
173 <patternset id="snow.source.misc"
174 description="Additional includes in the source distribution relative to source root">
175 </patternset>
176
177 <target name="snow.source.prepare">
178 <property name="snow.source.eol" value="asis"/>
179 <echo>Using snow.source.eol='${snow.source.eol}' to drive
180 source code line-ending transformations.</echo>
181 <property name="snow.build.src.dir"
182 value="${build.dir}/snow-src"/>
183 <mkdir dir="${snow.build.src.dir}/src"/>
184 <fixcrlf srcdir="${src.dir}"
185 eol="${snow.source.eol}"
186 destdir="${snow.build.src.dir}/src"
187 preservelastmodified="true">
188 <patternset refid="snow.source.java"/>
189 <patternset refid="snow.source.lisp"/>
190 <patternset refid="snow.source.misc"/>
191 </fixcrlf>
192 <fixcrlf srcdir="${basedir}"
193 eol="${snow.source.eol}"
194 destdir="${snow.build.src.dir}"
195 preservelastmodified="true">
196 <patternset refid="snow.dist.misc"/>
197 </fixcrlf>
198 </target>
199
200 <target name="snow.source.tar" depends="snow.source.prepare">
201 <mkdir dir="${dist.dir}"/>
202 <tar destfile="${dist.dir}/snow-src.tar.gz"
203 compression="gzip">
204 <tarfileset dir="${build.dir}">
205 <include name="snow-src/**"/>
206 </tarfileset>
207 </tar>
208 </target>
209
210 <target name="snow.source.zip" depends="snow.source.prepare">
211 <mkdir dir="${dist.dir}"/>
212 <zip destfile="${dist.dir}/snow-src.zip"
213 compress="true">
214 <zipfileset dir="${snow.build.src.dir}" prefix="snow-src"/>
215 </zip>
216 </target>
217
218 <!-- Testing -->
219
220 <property name="snow.test.dir" value="${basedir}/test"/>
221
222 <property name="snow.test.src.dir" value="${snow.test.dir}/src"/>
223 <property name="snow.test.classes.dir" value="${snow.test.dir}/bin"/>
224
225 <patternset id="snow.test.source.java">
226 <!-- For now, we list tests explicitly, because we have to
227 enumerate them later to the JUnit test runner. -->
228 <include name="snow/BindingTest.java"/>
229 </patternset>
230
231 <path id="snow.test.compile.classpath">
232 <pathelement location="${snow.test.dir}/lib/junit.jar"/>
233 <path refid="snow.classpath.build" />
234 </path>
235
236 <target name="snow.test.compile" depends="snow.compile">
237 <mkdir dir="${snow.test.classes.dir}"/>
238 <javac destdir="${snow.test.classes.dir}"
239 classpathref="snow.test.compile.classpath"
240 debug="true"
241 target="1.6">
242 <src path="${snow.test.src.dir}"/>
243 <patternset refid="snow.test.source.java"/>
244 </javac>
245 </target>
246
247 <path id="snow.test.run.classpath">
248 <path refid="snow.test.compile.classpath"/>
249 <pathelement location="${snow.test.classes.dir}"/>
250 <path refid="snow.classpath.build" />
251 </path>
252
253 <target name="snow.test" depends="snow.test.java"/>
254
255 <target name="snow.test.java" depends="snow.test.compile">
256 <java fork="true"
257 classpathref="snow.test.run.classpath"
258 classname="org.junit.runner.JUnitCore">
259 <arg value="snow.BindingTest"/>
260 </java>
261 </target>
262
263 </project>
264

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5