| 1 | <?xml version="1.0" encoding="UTF-8"?> |
|---|
| 2 | <project xmlns="antlib:org.apache.tools.ant" |
|---|
| 3 | name="abcl-master" default="abcl.wrapper" basedir="."> |
|---|
| 4 | <description>Compiling, testing, and packaging Armed Bear Common Lisp</description> |
|---|
| 5 | |
|---|
| 6 | <target name="abcl" depends="abcl.wrapper"/> |
|---|
| 7 | |
|---|
| 8 | <property file="build.properties"/> |
|---|
| 9 | |
|---|
| 10 | <property name="build.dir" |
|---|
| 11 | value="${basedir}/build"/> |
|---|
| 12 | <property name="build.classes.dir" |
|---|
| 13 | value="${build.dir}/classes"/> |
|---|
| 14 | <property name="src.dir" |
|---|
| 15 | value="${basedir}/src"/> |
|---|
| 16 | <property name="dist.dir" |
|---|
| 17 | value="${basedir}/dist"/> |
|---|
| 18 | <property name="abcl.jar.path" |
|---|
| 19 | value="${dist.dir}/abcl.jar"/> |
|---|
| 20 | <property name="abcl.ext.dir" |
|---|
| 21 | value="${basedir}/ext"/> |
|---|
| 22 | |
|---|
| 23 | <target name="help"> |
|---|
| 24 | <echo>Main Ant targets: |
|---|
| 25 | abcl.compile |
|---|
| 26 | -- compile ABCL to ${build.classes.dir}. |
|---|
| 27 | abcl.jar |
|---|
| 28 | -- create packaged ${abcl.jar.path}. |
|---|
| 29 | abcl.wrapper |
|---|
| 30 | -- create executable wrapper for ABCL. |
|---|
| 31 | abcl.source.zip abcl.source.tar |
|---|
| 32 | -- create source distributions in ${dist.dir}. |
|---|
| 33 | abcl.test.java |
|---|
| 34 | -- Run junit tests under ${abcl.test.src.dir}. |
|---|
| 35 | abcl.clean |
|---|
| 36 | -- remove ABCL intermediate files</echo> |
|---|
| 37 | <echo>Corresponding targets for J have been removed.</echo> |
|---|
| 38 | </target> |
|---|
| 39 | |
|---|
| 40 | <!-- Checks if JSR-223 support is available - thanks to Mark Evenson --> |
|---|
| 41 | <available property="abcl.jsr-223.p" |
|---|
| 42 | classname="javax.script.ScriptEngine"/> |
|---|
| 43 | |
|---|
| 44 | <patternset id="abcl.source.java"> |
|---|
| 45 | <include name="org/armedbear/lisp/*.java"/> |
|---|
| 46 | <include name="org/armedbear/lisp/util/*.java"/> |
|---|
| 47 | <include name="org/armedbear/lisp/java/**/*.java"/> |
|---|
| 48 | <include name="org/armedbear/lisp/scripting/*.java" if="abcl.jsr-223.p"/> |
|---|
| 49 | <include name="org/armedbear/lisp/scripting/util/*.java" if="abcl.jsr-223.p"/> |
|---|
| 50 | <include name="org/armedbear/Main.java"/> |
|---|
| 51 | </patternset> |
|---|
| 52 | |
|---|
| 53 | <patternset id="abcl.source.lisp"> |
|---|
| 54 | <include name="org/armedbear/lisp/*.lisp"/> |
|---|
| 55 | <include name="org/armedbear/lisp/java/**/*.lisp"/> |
|---|
| 56 | <include name="org/armedbear/lisp/tests/*.lisp"/> |
|---|
| 57 | <exclude name="org/armedbear/lisp/j.lisp"/> |
|---|
| 58 | <include name="org/armedbear/lisp/scripting/lisp/*.lisp" if="abcl.jsr-223.p"/> |
|---|
| 59 | </patternset> |
|---|
| 60 | |
|---|
| 61 | <patternset id="abcl.scripting.source.java"> |
|---|
| 62 | <include name="org/armedbear/lisp/scripting/*.java"/> |
|---|
| 63 | <include name="org/armedbear/lisp/scripting/util/*.java"/> |
|---|
| 64 | </patternset> |
|---|
| 65 | |
|---|
| 66 | <patternset id="abcl.scripting.source.lisp"> |
|---|
| 67 | <include name="org/armedbear/lisp/scripting/lisp/*.lisp"/> |
|---|
| 68 | </patternset> |
|---|
| 69 | |
|---|
| 70 | <!-- Lisp files required at runtime --> |
|---|
| 71 | <patternset id="abcl.source.lisp.dist"> |
|---|
| 72 | <include name="org/armedbear/lisp/boot.lisp"/> |
|---|
| 73 | <include name="org/armedbear/lisp/scripting/lisp/*.lisp" if="abcl.jsr-223.p"/> |
|---|
| 74 | </patternset> |
|---|
| 75 | |
|---|
| 76 | <patternset id="abcl.objects"> |
|---|
| 77 | <include name="org/armedbear/lisp/**/*.class"/> |
|---|
| 78 | <include name="org/armedbear/lisp/**/*.cls"/> |
|---|
| 79 | <include name="org/armedbear/lisp/**/*.abcl"/> |
|---|
| 80 | <include name="org/armedbear/lisp/scripting/*.class" if="abcl.jsr-223.p"/> |
|---|
| 81 | <include name="org/armedbear/lisp/scripting/util/*.class" if="abcl.jsr-223.p"/> |
|---|
| 82 | <patternset refid="abcl.source.lisp.dist"/> |
|---|
| 83 | </patternset> |
|---|
| 84 | |
|---|
| 85 | <path id="abcl.classpath.dist"> |
|---|
| 86 | <pathelement location="${abcl.jar.path}"/> |
|---|
| 87 | </path> |
|---|
| 88 | |
|---|
| 89 | <path id="abcl.classpath.build"> |
|---|
| 90 | <pathelement location="${build.classes.dir}"/> |
|---|
| 91 | </path> |
|---|
| 92 | |
|---|
| 93 | <target name="abcl.compile" depends="abcl.clean.maybe,abcl.compile.lisp"> |
|---|
| 94 | <echo>Compiled ABCL with Java version: ${java.version}</echo> |
|---|
| 95 | </target> |
|---|
| 96 | |
|---|
| 97 | <target name="abcl.clean.maybe" unless="abcl.build.incremental"> |
|---|
| 98 | <echo>Cleaning all intermediate compilation artifacts.</echo> |
|---|
| 99 | <echo>Setting 'abcl.build.incremental' enables incremental compilation.</echo> |
|---|
| 100 | <antcall target="abcl.clean"/> |
|---|
| 101 | </target> |
|---|
| 102 | |
|---|
| 103 | |
|---|
| 104 | <target name="abcl.init"> |
|---|
| 105 | <tstamp> |
|---|
| 106 | <format property="build" pattern="EEE MMM dd yyyy HH:mm:ss zzz"/> |
|---|
| 107 | </tstamp> |
|---|
| 108 | |
|---|
| 109 | <tstamp> |
|---|
| 110 | <format property="build.stamp" pattern="yyyymmdd-HHmm"/> |
|---|
| 111 | </tstamp> |
|---|
| 112 | |
|---|
| 113 | <property name="abcl.test.log.file" |
|---|
| 114 | value="abcl-test-${build.stamp}.log"/> |
|---|
| 115 | |
|---|
| 116 | <!--- antversion fails in ant 1.7.1 <antversion property="ant.version" |
|---|
| 117 | atleast="1.7"/> --> |
|---|
| 118 | <property name="java.path" |
|---|
| 119 | value="${java.home}/bin/java"/> |
|---|
| 120 | |
|---|
| 121 | <!-- Deprecated. Two main types of build environents: 'unix' or 'windows'. --> |
|---|
| 122 | <condition property="unix"> |
|---|
| 123 | <or> |
|---|
| 124 | <os family="unix"/> |
|---|
| 125 | <os family="mac"/> |
|---|
| 126 | </or> |
|---|
| 127 | </condition> |
|---|
| 128 | <condition property="windows"> |
|---|
| 129 | <os family="windows"/> |
|---|
| 130 | </condition> |
|---|
| 131 | |
|---|
| 132 | <!-- Deprecated. --> |
|---|
| 133 | <available file="${src.dir}org/armedbear/lisp/Interpreter.java" |
|---|
| 134 | property="abcl.lisp.p"/> |
|---|
| 135 | |
|---|
| 136 | <echo>java.version: ${java.version}</echo> |
|---|
| 137 | <condition property="abcl.java.version.p"> |
|---|
| 138 | <or> |
|---|
| 139 | <matches string="${java.version}" pattern="1\.5"/> |
|---|
| 140 | <matches string="${java.version}" pattern="1\.6\.0_1[0-9]"/> |
|---|
| 141 | </or> |
|---|
| 142 | </condition> |
|---|
| 143 | |
|---|
| 144 | <!-- Set from commandline via -D or in 'build.properties' --> |
|---|
| 145 | <property name="build.version" value="abcl.svn"/> |
|---|
| 146 | <echo>Implementation-Source: ${version.src}</echo> |
|---|
| 147 | |
|---|
| 148 | </target> |
|---|
| 149 | |
|---|
| 150 | <target name="abcl.java.warning" |
|---|
| 151 | depends="abcl.init" |
|---|
| 152 | unless="abcl.java.version.p"> |
|---|
| 153 | <echo>WARNING: Use of Java version ${java.version} not recommended.</echo> |
|---|
| 154 | </target> |
|---|
| 155 | |
|---|
| 156 | <target name="abcl.jsr-223.notice" |
|---|
| 157 | depends="abcl.init" |
|---|
| 158 | unless="abcl.jsr-223.p"> |
|---|
| 159 | <echo> |
|---|
| 160 | Notice: JSR-223 support won't be built since it is not |
|---|
| 161 | supported, neither natively by your JVM nor by |
|---|
| 162 | libraries in the CLASSPATH. |
|---|
| 163 | </echo> |
|---|
| 164 | </target> |
|---|
| 165 | |
|---|
| 166 | <target name="abcl.compile.java" |
|---|
| 167 | depends="abcl.init,abcl.java.warning,abcl.jsr-223.notice"> |
|---|
| 168 | <mkdir dir="${build.dir}"/> |
|---|
| 169 | <mkdir dir="${build.classes.dir}"/> |
|---|
| 170 | <javac destdir="${build.classes.dir}" |
|---|
| 171 | debug="true" |
|---|
| 172 | target="1.5" |
|---|
| 173 | failonerror="true"> |
|---|
| 174 | <src path="${src.dir}"/> |
|---|
| 175 | <patternset refid="abcl.source.java"/> |
|---|
| 176 | </javac> |
|---|
| 177 | <echo message="${build}" |
|---|
| 178 | file="${build.classes.dir}/org/armedbear/lisp/build"/> |
|---|
| 179 | </target> |
|---|
| 180 | |
|---|
| 181 | <target name="abcl.copy.lisp"> |
|---|
| 182 | <copy todir="${build.classes.dir}" preservelastmodified="yes"> |
|---|
| 183 | <fileset dir="${src.dir}"> |
|---|
| 184 | <patternset refid="abcl.source.lisp"/> |
|---|
| 185 | </fileset> |
|---|
| 186 | </copy> |
|---|
| 187 | </target> |
|---|
| 188 | |
|---|
| 189 | <!-- Adjust the patternset for ABCL source to use the much faster |
|---|
| 190 | Ant 'uptodate' task to check if we need to compile the system |
|---|
| 191 | fasls. Highly inter-dependent with the behavior specified in |
|---|
| 192 | 'compile-system.lisp', i.e. files not listed in |
|---|
| 193 | there should NOT occur here. --> |
|---|
| 194 | <patternset id="abcl.source.lisp.fasls"> |
|---|
| 195 | <patternset refid="abcl.source.lisp"/> |
|---|
| 196 | <exclude name="org/armedbear/lisp/scripting/**/*.lisp"/> |
|---|
| 197 | <exclude name="org/armedbear/lisp/boot.lisp"/> |
|---|
| 198 | <exclude name="org/armedbear/lisp/emacs.lisp"/> |
|---|
| 199 | <exclude name="org/armedbear/lisp/runtime-class.lisp"/> |
|---|
| 200 | <exclude name="org/armedbear/lisp/run-benchmarks.lisp"/> |
|---|
| 201 | </patternset> |
|---|
| 202 | |
|---|
| 203 | <target name="abcl.fasls.uptodate"> |
|---|
| 204 | <uptodate property="abcl.fasls.uptodate.p" value="true"> |
|---|
| 205 | <srcfiles dir="${build.classes.dir}"> |
|---|
| 206 | <patternset refid="abcl.source.lisp.fasls"/> |
|---|
| 207 | </srcfiles> |
|---|
| 208 | <mapper type="glob" from="*.lisp" to="*.abcl"/> |
|---|
| 209 | </uptodate> |
|---|
| 210 | </target> |
|---|
| 211 | |
|---|
| 212 | <target name="abcl.compile.lisp" |
|---|
| 213 | depends="abcl.copy.lisp,abcl.compile.java,abcl.fasls.uptodate" |
|---|
| 214 | unless="abcl.fasls.uptodate.p"> |
|---|
| 215 | <java classpath="${build.classes.dir}" |
|---|
| 216 | fork="true" |
|---|
| 217 | failonerror="true" |
|---|
| 218 | classname="org.armedbear.lisp.Main"> |
|---|
| 219 | <arg value="--noinit"/> |
|---|
| 220 | <arg value="--eval"/> |
|---|
| 221 | <arg value="(compile-system :zip nil :quit t)"/> |
|---|
| 222 | </java> |
|---|
| 223 | </target> |
|---|
| 224 | |
|---|
| 225 | <property name="abcl.build.path" |
|---|
| 226 | value="${build.classes.dir}/org/armedbear/lisp/build"/> |
|---|
| 227 | <target name="abcl.stamp" depends="abcl.compile,abcl.stamp.version,abcl.stamp.hostname"> |
|---|
| 228 | <mkdir dir="${abcl.build.path}/.."/> |
|---|
| 229 | <echo message="${build}" file="${abcl.build.path}"/> |
|---|
| 230 | </target> |
|---|
| 231 | |
|---|
| 232 | <property name="abcl.version.path" |
|---|
| 233 | value="${build.classes.dir}/org/armedbear/lisp/version"/> |
|---|
| 234 | <target name="abcl.stamp.version" depends="abcl.compile"> |
|---|
| 235 | <!-- Determine which ABCL version we have just built by parsing |
|---|
| 236 | the output of LISP-IMPLEMENTATION-VERSION. --> |
|---|
| 237 | <!-- TODO As an optimization, we could possibly compare the timestamp |
|---|
| 238 | of 'abcl.version.path' vs. org.armedbear.lisp.Version --> |
|---|
| 239 | <java fork="true" |
|---|
| 240 | classpath="${build.classes.dir}" |
|---|
| 241 | outputproperty="abcl.version" |
|---|
| 242 | classname="org.armedbear.lisp.Main" |
|---|
| 243 | logerror="yes"> <!-- Don't catch stderr output --> |
|---|
| 244 | <arg value="--noinit"/> |
|---|
| 245 | <arg value="--noinform"/> |
|---|
| 246 | <arg value="--eval"/> |
|---|
| 247 | <arg value="(progn (format t (lisp-implementation-version)) (finish-output) (quit))"/> |
|---|
| 248 | </java> |
|---|
| 249 | |
|---|
| 250 | <echo>Built ABCL version: ${abcl.version}</echo> |
|---|
| 251 | <mkdir dir="${abcl.version.path}/.."/> |
|---|
| 252 | <echo message="${abcl.version}" file="${abcl.version.path}"/> |
|---|
| 253 | </target> |
|---|
| 254 | |
|---|
| 255 | <target name="abcl.stamp.hostname" if="unix"> |
|---|
| 256 | <exec executable="hostname" outputproperty="abcl.hostname"/> |
|---|
| 257 | <echo>abcl.hostname: ${abcl.hostname}</echo> |
|---|
| 258 | </target> |
|---|
| 259 | |
|---|
| 260 | <target name="abcl.jar.uptodate" depends="abcl.compile"> |
|---|
| 261 | <uptodate property="abcl.jar.uptodate.p" targetfile="${abcl.jar.path}"> |
|---|
| 262 | <srcfiles dir="${build.classes.dir}"> |
|---|
| 263 | <patternset refid="abcl.objects"/> |
|---|
| 264 | </srcfiles> |
|---|
| 265 | </uptodate> |
|---|
| 266 | </target> |
|---|
| 267 | |
|---|
| 268 | <target name="abcl.jar" depends="abcl.stamp,abcl.jar.uptodate" |
|---|
| 269 | unless="abcl.jar.uptodate.p"> |
|---|
| 270 | <mkdir dir="${dist.dir}"/> |
|---|
| 271 | <loadfile property="abcl.version" |
|---|
| 272 | srcFile="${abcl.version.path}"/> |
|---|
| 273 | <jar destfile="${abcl.jar.path}" |
|---|
| 274 | compress="true" |
|---|
| 275 | basedir="${build.classes.dir}"> |
|---|
| 276 | <patternset refid="abcl.objects"/> |
|---|
| 277 | <manifest> |
|---|
| 278 | <attribute name="Main-Class" value="org.armedbear.lisp.Main"/> |
|---|
| 279 | <section name="org/armedbear/lisp"> |
|---|
| 280 | <attribute name="Implementation-Title" |
|---|
| 281 | value="ABCL"/> |
|---|
| 282 | <attribute name="Implementation-Version" |
|---|
| 283 | value="${abcl.version}"/> |
|---|
| 284 | <attribute name="Implementation-Build" |
|---|
| 285 | value="${build}"/> |
|---|
| 286 | <attribute name="Implementation-Source" |
|---|
| 287 | value="${version.src}"/> |
|---|
| 288 | </section> |
|---|
| 289 | </manifest> |
|---|
| 290 | <metainf dir="${src.dir}/META-INF"> |
|---|
| 291 | <exclude name="services/javax.script.ScriptEngineFactory" |
|---|
| 292 | unless="abcl.jsr-223.p"/> |
|---|
| 293 | </metainf> |
|---|
| 294 | </jar> |
|---|
| 295 | </target> |
|---|
| 296 | |
|---|
| 297 | <target name="abcl.wrapper" |
|---|
| 298 | depends="abcl.jar,abcl.wrapper.unix,abcl.wrapper.windows"> |
|---|
| 299 | <description> |
|---|
| 300 | Creates in-place exectuable shell wrapper in '${abcl.wrapper.file}' |
|---|
| 301 | </description> |
|---|
| 302 | <!-- Set from commandline or in 'build.properties' --> |
|---|
| 303 | <property name="additional.jars" value=""/> |
|---|
| 304 | <path id="abcl.runtime.classpath"> |
|---|
| 305 | <pathelement location="${abcl.jar.path}"/> |
|---|
| 306 | <pathelement path="${additional.jars}"/> |
|---|
| 307 | </path> |
|---|
| 308 | <!-- set via '-Djava.options=JAVA_OPTIONS' or in 'build.properties --> |
|---|
| 309 | <property name="java.options" value=""/> |
|---|
| 310 | |
|---|
| 311 | <copy file="${abcl.wrapper.in.file}" toFile="${abcl.wrapper.file}" overwrite="yes"> |
|---|
| 312 | <filterset> |
|---|
| 313 | <filter token="JAVA" |
|---|
| 314 | value="${java.path}"/> |
|---|
| 315 | <filter token="ABCL_JAVA_OPTIONS" |
|---|
| 316 | value="${java.options}"/> |
|---|
| 317 | <filter token="ABCL_CLASSPATH" |
|---|
| 318 | value="${toString:abcl.runtime.classpath}"/> |
|---|
| 319 | </filterset> |
|---|
| 320 | </copy> |
|---|
| 321 | <chmod file="${abcl.wrapper.file}" perm="a+x"/> |
|---|
| 322 | |
|---|
| 323 | <echo>Created executable ABCL wrapper in '${abcl.wrapper.file}'</echo> |
|---|
| 324 | <echo>N.B. This wrapper requires '${abcl.jar.path}' not be moved.</echo> |
|---|
| 325 | </target> |
|---|
| 326 | |
|---|
| 327 | <target name="abcl.wrapper.unix" if="unix"> |
|---|
| 328 | <property name="abcl.wrapper.file" value="abcl"/> |
|---|
| 329 | <property name="abcl.wrapper.in.file" value="abcl.in"/> |
|---|
| 330 | </target> |
|---|
| 331 | |
|---|
| 332 | <target name="abcl.wrapper.windows" if="windows"> |
|---|
| 333 | <property name="abcl.wrapper.file" value="abcl.bat"/> |
|---|
| 334 | <property name="abcl.wrapper.in.file" value="abcl.bat.in"/> |
|---|
| 335 | </target> |
|---|
| 336 | |
|---|
| 337 | <target name="abcl.debug.jpda" depends="abcl.jar"> |
|---|
| 338 | <description>Invoke ABCL with JPDA listener on port 6789</description> |
|---|
| 339 | <java fork="true" |
|---|
| 340 | classpathref="abcl.classpath.dist" |
|---|
| 341 | classname="org.armedbear.lisp.Main"> |
|---|
| 342 | <jvmarg |
|---|
| 343 | value="-agentlib:jdwp=transport=dt_socket,address=6789,server=y"/> |
|---|
| 344 | </java> |
|---|
| 345 | <echo>JPDA listening on localhost:6789</echo> |
|---|
| 346 | </target> |
|---|
| 347 | |
|---|
| 348 | <target name="abcl.run" depends="abcl.jar"> |
|---|
| 349 | <java fork="true" |
|---|
| 350 | classpathref="abcl.classpath.dist" |
|---|
| 351 | classname="org.armedbear.lisp.Main"> |
|---|
| 352 | </java> |
|---|
| 353 | </target> |
|---|
| 354 | |
|---|
| 355 | <target name="abcl.clean"> |
|---|
| 356 | <delete dir="${build.dir}"/> |
|---|
| 357 | <delete file="${abcl.jar.path}"/> |
|---|
| 358 | <delete file="abcl"/> |
|---|
| 359 | <delete file="abcl.bat"/> |
|---|
| 360 | </target> |
|---|
| 361 | |
|---|
| 362 | <target name="abcl.dist" depends="abcl.jar"> |
|---|
| 363 | <copy file="${abcl.jar.path}" |
|---|
| 364 | toFile="${dist.dir}/abcl-${abcl.version}.jar"/> |
|---|
| 365 | </target> |
|---|
| 366 | |
|---|
| 367 | <target name="abcl.distclean" depends="abcl.clean"> |
|---|
| 368 | <delete dir="${dist.dir}"/> |
|---|
| 369 | <delete file="abcl"/> |
|---|
| 370 | <delete file="abcl.bat"/> |
|---|
| 371 | </target> |
|---|
| 372 | |
|---|
| 373 | <target name="TAGS"> |
|---|
| 374 | <apply executable="etags" parallel="true" verbose="true"> |
|---|
| 375 | <arg value="--regex=|[ \t]+//[ \t]+###[ \t]+\([^ \t]+\)|\1|"/> |
|---|
| 376 | <fileset dir="${src.dir}"> |
|---|
| 377 | <patternset refid="abcl.source.java"/> |
|---|
| 378 | <patternset refid="abcl.source.lisp"/> |
|---|
| 379 | </fileset> |
|---|
| 380 | </apply> |
|---|
| 381 | </target> |
|---|
| 382 | |
|---|
| 383 | <patternset id="abcl.dist.misc" |
|---|
| 384 | description="Additional includes in the source distributions relative to basedir"> |
|---|
| 385 | <include name="build.xml"/> |
|---|
| 386 | <include name="build.properties.in"/> |
|---|
| 387 | <include name="COPYING"/> |
|---|
| 388 | <include name="README"/> |
|---|
| 389 | <include name="CHANGES"/> |
|---|
| 390 | <include name="abcl.in"/> |
|---|
| 391 | <include name="abcl.bat.in"/> |
|---|
| 392 | |
|---|
| 393 | <!-- The remainder of these files are used by the Lisp hosted |
|---|
| 394 | build in 'build-abcl.lisp' but not used by Ant, so include |
|---|
| 395 | them in the source distribution. --> |
|---|
| 396 | <include name="make-jar.in"/> |
|---|
| 397 | <include name="make-jar.bat.in"/> |
|---|
| 398 | |
|---|
| 399 | <include name="build-abcl.lisp"/> |
|---|
| 400 | <include name="customizations.lisp.in"/> |
|---|
| 401 | |
|---|
| 402 | <include name="test-abcl.asd"/> |
|---|
| 403 | <include name="build-abcl.asd"/> |
|---|
| 404 | </patternset> |
|---|
| 405 | |
|---|
| 406 | <patternset id="abcl.source.misc" |
|---|
| 407 | description="Additional includes in the source distribution relative to source root"> |
|---|
| 408 | <include name="org/armedbear/lisp/LICENSE"/> |
|---|
| 409 | <include name="manifest-abcl"/> |
|---|
| 410 | <include name="META-INF/services/javax.script.ScriptEngineFactory"/> |
|---|
| 411 | </patternset> |
|---|
| 412 | |
|---|
| 413 | <target name="abcl.source.prepare" depends="abcl.stamp.version"> |
|---|
| 414 | <property name="abcl.build.src.dir" |
|---|
| 415 | value="${build.dir}/abcl-src-${abcl.version}"/> |
|---|
| 416 | <mkdir dir="${abcl.build.src.dir}/src"/> |
|---|
| 417 | <copy todir="${abcl.build.src.dir}/src" |
|---|
| 418 | preservelastmodified="true"> |
|---|
| 419 | <fileset dir="${src.dir}" |
|---|
| 420 | id="abcl.source.src"> |
|---|
| 421 | <patternset refid="abcl.source.java"/> |
|---|
| 422 | <patternset refid="abcl.source.lisp"/> |
|---|
| 423 | <patternset refid="abcl.source.misc"/> |
|---|
| 424 | </fileset> |
|---|
| 425 | </copy> |
|---|
| 426 | <copy todir="${abcl.build.src.dir}" |
|---|
| 427 | preservelastmodified="true"> |
|---|
| 428 | <fileset dir="${basedir}"> |
|---|
| 429 | <patternset refid="abcl.dist.misc"/> |
|---|
| 430 | </fileset> |
|---|
| 431 | </copy> |
|---|
| 432 | </target> |
|---|
| 433 | |
|---|
| 434 | <!-- Files in source distribution that always get LF EOL (aka |
|---|
| 435 | 'unix') --> |
|---|
| 436 | <patternset id="abcl.dist.lf"> |
|---|
| 437 | <include name="abcl.in"/> |
|---|
| 438 | </patternset> |
|---|
| 439 | |
|---|
| 440 | <!-- Files in source distribution that always get CRLF EOL (aka |
|---|
| 441 | 'dos') --> |
|---|
| 442 | <patternset id="abcl.dist.crlf"> |
|---|
| 443 | <include name="abcl.bat.in"/> |
|---|
| 444 | </patternset> |
|---|
| 445 | |
|---|
| 446 | <target name="abcl.source.tar" depends="abcl.source.prepare"> |
|---|
| 447 | <fixcrlf srcdir="${abcl.build.src.dir}" |
|---|
| 448 | preservelastmodified="true" |
|---|
| 449 | eol="lf"> |
|---|
| 450 | </fixcrlf> |
|---|
| 451 | |
|---|
| 452 | <fixcrlf srcdir="${abcl.build.src.dir}" |
|---|
| 453 | preservelastmodified="true" |
|---|
| 454 | eol="crlf"> |
|---|
| 455 | <patternset refid="abcl.dist.crlf"/> |
|---|
| 456 | </fixcrlf> |
|---|
| 457 | |
|---|
| 458 | <fixcrlf srcdir="${abcl.build.src.dir}" |
|---|
| 459 | preservelastmodified="true" |
|---|
| 460 | eol="lf"> |
|---|
| 461 | <patternset refid="abcl.dist.lf"/> |
|---|
| 462 | </fixcrlf> |
|---|
| 463 | |
|---|
| 464 | <mkdir dir="${dist.dir}"/> |
|---|
| 465 | <tar destfile="${dist.dir}/abcl-src-${abcl.version}.tar.gz" |
|---|
| 466 | compression="gzip"> |
|---|
| 467 | <tarfileset dir="${build.dir}"> |
|---|
| 468 | <include name="abcl-src-${abcl.version}/**"/> |
|---|
| 469 | </tarfileset> |
|---|
| 470 | </tar> |
|---|
| 471 | </target> |
|---|
| 472 | |
|---|
| 473 | <target name="abcl.source.zip" depends="abcl.source.prepare"> |
|---|
| 474 | <fixcrlf srcdir="${abcl.build.src.dir}" |
|---|
| 475 | preservelastmodified="true" |
|---|
| 476 | eol="crlf"> |
|---|
| 477 | </fixcrlf> |
|---|
| 478 | |
|---|
| 479 | <fixcrlf srcdir="${abcl.build.src.dir}" |
|---|
| 480 | preservelastmodified="true" |
|---|
| 481 | eol="crlf"> |
|---|
| 482 | <patternset refid="abcl.dist.crlf"/> |
|---|
| 483 | </fixcrlf> |
|---|
| 484 | |
|---|
| 485 | <fixcrlf srcdir="${abcl.build.src.dir}" |
|---|
| 486 | preservelastmodified="true" |
|---|
| 487 | eol="lf"> |
|---|
| 488 | <patternset refid="abcl.dist.lf"/> |
|---|
| 489 | </fixcrlf> |
|---|
| 490 | |
|---|
| 491 | <mkdir dir="${dist.dir}"/> |
|---|
| 492 | <zip destfile="${dist.dir}/abcl-src-${abcl.version}.zip" |
|---|
| 493 | compress="true"> |
|---|
| 494 | <zipfileset dir="${abcl.build.src.dir}" prefix="abcl-src-${abcl.version}"/> |
|---|
| 495 | </zip> |
|---|
| 496 | </target> |
|---|
| 497 | |
|---|
| 498 | <target name="abcl.binary.prepare" depends="abcl.stamp.version,abcl.jar"> |
|---|
| 499 | <property name="abcl.build.binary.dir" |
|---|
| 500 | value="${build.dir}/abcl-bin-${abcl.version}"/> |
|---|
| 501 | <mkdir dir="${abcl.build.binary.dir}"/> |
|---|
| 502 | <copy todir="${abcl.build.binary.dir}" |
|---|
| 503 | preservelastmodified="true"> |
|---|
| 504 | <fileset dir="${basedir}/dist"> |
|---|
| 505 | <patternset> |
|---|
| 506 | <include name="abcl.jar"/> |
|---|
| 507 | </patternset> |
|---|
| 508 | </fileset> |
|---|
| 509 | <fileset dir="${basedir}"> |
|---|
| 510 | <patternset> |
|---|
| 511 | <include name="README"/> |
|---|
| 512 | <include name="CHANGES"/> |
|---|
| 513 | </patternset> |
|---|
| 514 | </fileset> |
|---|
| 515 | </copy> |
|---|
| 516 | </target> |
|---|
| 517 | |
|---|
| 518 | <target name="abcl.binary.tar" depends="abcl.binary.prepare"> |
|---|
| 519 | <tar destfile="${dist.dir}/abcl-bin-${abcl.version}.tar.gz" |
|---|
| 520 | compression="gzip"> |
|---|
| 521 | <tarfileset dir="${build.dir}"> |
|---|
| 522 | <include name="abcl-bin-${abcl.version}/**"/> |
|---|
| 523 | </tarfileset> |
|---|
| 524 | </tar> |
|---|
| 525 | </target> |
|---|
| 526 | |
|---|
| 527 | <target name="abcl.binary.zip" depends="abcl.binary.prepare"> |
|---|
| 528 | <zip destfile="${dist.dir}/abcl-bin-${abcl.version}.zip" |
|---|
| 529 | compress="true"> |
|---|
| 530 | <zipfileset dir="${abcl.build.binary.dir}" prefix="abcl-bin-${abcl.version}"/> |
|---|
| 531 | </zip> |
|---|
| 532 | </target> |
|---|
| 533 | |
|---|
| 534 | <property name="abcl.test.classes.dir" |
|---|
| 535 | value="${build.dir}/classes-test"/> |
|---|
| 536 | |
|---|
| 537 | <property name="abcl.test.src.dir" |
|---|
| 538 | value="${basedir}/test/src"/> |
|---|
| 539 | |
|---|
| 540 | <patternset id="abcl.test.source.java"> |
|---|
| 541 | <!-- For now, we list tests explicitly, because we have to |
|---|
| 542 | enumerate them later to the JUnit test runner. --> |
|---|
| 543 | <include name="org/armedbear/lisp/FastStringBufferTest.java"/> |
|---|
| 544 | </patternset> |
|---|
| 545 | |
|---|
| 546 | <property name="junit-4.5.path" |
|---|
| 547 | value="${abcl.ext.dir}/junit-4.5.jar"/> |
|---|
| 548 | |
|---|
| 549 | <path id="abcl.test.compile.classpath"> |
|---|
| 550 | <pathelement location="${junit-4.5.path}"/> |
|---|
| 551 | <pathelement location="${build.classes.dir}"/> |
|---|
| 552 | </path> |
|---|
| 553 | |
|---|
| 554 | <target name="abcl.test.pre-compile" depends="abcl.ext"/> |
|---|
| 555 | |
|---|
| 556 | <target name="abcl.ext.p"> |
|---|
| 557 | <!--XXX generalize over enumeration of all contributions to abcl.ext --> |
|---|
| 558 | <available file="${junit-4.5.path}" property="abcl.ext.p"/> |
|---|
| 559 | </target> |
|---|
| 560 | <target name="abcl.ext" depends="abcl.ext.p" unless="abcl.ext.p"> |
|---|
| 561 | |
|---|
| 562 | <mkdir dir="${abcl.ext.dir}"/> |
|---|
| 563 | <get src="http://downloads.sourceforge.net/junit/junit-4.5.jar?modtime=1218209625" |
|---|
| 564 | usetimestamp="true" |
|---|
| 565 | dest="${junit-4.5.path}"/> |
|---|
| 566 | </target> |
|---|
| 567 | |
|---|
| 568 | <target name="abcl.test.compile" |
|---|
| 569 | depends="abcl.test.pre-compile,abcl.compile"> |
|---|
| 570 | <mkdir dir="${abcl.test.classes.dir}"/> |
|---|
| 571 | <javac destdir="${abcl.test.classes.dir}" |
|---|
| 572 | classpathref="abcl.test.compile.classpath" |
|---|
| 573 | debug="true" |
|---|
| 574 | target="1.5"> |
|---|
| 575 | <src path="${abcl.test.src.dir}"/> |
|---|
| 576 | <patternset refid="abcl.test.source.java"/> |
|---|
| 577 | </javac> |
|---|
| 578 | </target> |
|---|
| 579 | |
|---|
| 580 | <path id="abcl.test.run.classpath"> |
|---|
| 581 | <path refid="abcl.test.compile.classpath"/> |
|---|
| 582 | <pathelement location="${abcl.test.classes.dir}"/> |
|---|
| 583 | </path> |
|---|
| 584 | |
|---|
| 585 | <target name="abcl.test" |
|---|
| 586 | depends="abcl.test.java,abcl.test.lisp"/> |
|---|
| 587 | |
|---|
| 588 | <target name="abcl.test.java" depends="abcl.test.compile"> |
|---|
| 589 | <java fork="true" |
|---|
| 590 | classpathref="abcl.test.run.classpath" |
|---|
| 591 | classname="org.junit.runner.JUnitCore"> |
|---|
| 592 | <arg value="org.armedbear.lisp.FastStringBufferTest"/> |
|---|
| 593 | </java> |
|---|
| 594 | </target> |
|---|
| 595 | |
|---|
| 596 | <target name="abcl.test.lisp" |
|---|
| 597 | depends="test.ansi.compiled,test.abcl"/> |
|---|
| 598 | |
|---|
| 599 | <target name="test.ansi.interpreted" depends="abcl.jar"> |
|---|
| 600 | <echo>Recording test output in ${abcl.test.log.file}.</echo> |
|---|
| 601 | <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/> |
|---|
| 602 | <java fork="true" dir="${basedir}" |
|---|
| 603 | classpathref="abcl.classpath.dist" |
|---|
| 604 | classname="org.armedbear.lisp.Main"> |
|---|
| 605 | <arg value="--noinit"/> |
|---|
| 606 | <arg value="--load"/> |
|---|
| 607 | <arg line="${basedir}/test/lisp/ansi/ansi-tests-interpreted.lisp"/> |
|---|
| 608 | </java> |
|---|
| 609 | <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/> |
|---|
| 610 | <echo>Finished recording test output in ${abcl.test.log.file}.</echo> |
|---|
| 611 | </target> |
|---|
| 612 | |
|---|
| 613 | <target name="test.ansi.compiled" depends="abcl.jar"> |
|---|
| 614 | <echo>Recording test output in ${abcl.test.log.file}.</echo> |
|---|
| 615 | <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/> |
|---|
| 616 | <java fork="true" dir="${basedir}" |
|---|
| 617 | classpathref="abcl.classpath.dist" |
|---|
| 618 | classname="org.armedbear.lisp.Main"> |
|---|
| 619 | <arg value="--noinit"/> |
|---|
| 620 | <arg value="--load"/> |
|---|
| 621 | <arg line="${basedir}/test/lisp/ansi/ansi-tests-compiled.lisp "/> |
|---|
| 622 | </java> |
|---|
| 623 | <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/> |
|---|
| 624 | <echo>Finished recording test output in ${abcl.test.log.file}.</echo> |
|---|
| 625 | </target> |
|---|
| 626 | |
|---|
| 627 | <target name="test.abcl" depends="abcl.jar"> |
|---|
| 628 | <echo>Recording test output in ${abcl.test.log.file}.</echo> |
|---|
| 629 | <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/> |
|---|
| 630 | <java fork="true" dir="${basedir}" |
|---|
| 631 | classpathref="abcl.classpath.dist" |
|---|
| 632 | classname="org.armedbear.lisp.Main"> |
|---|
| 633 | <arg value="--noinit"/> |
|---|
| 634 | <arg value="--load"/> |
|---|
| 635 | <arg line="${basedir}/test/lisp/abcl/abcl-test.lisp"/> |
|---|
| 636 | </java> |
|---|
| 637 | <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/> |
|---|
| 638 | <echo>Finished recording test output in ${abcl.test.log.file}.</echo> |
|---|
| 639 | </target> |
|---|
| 640 | |
|---|
| 641 | <import file="netbeans-build.xml" optional="true"/> |
|---|
| 642 | <!-- <import file="j-build.xml" optional="true"/> --> |
|---|
| 643 | <import file="not.org-build.xml" optional="true"/> |
|---|
| 644 | </project> |
|---|
| 645 | |
|---|