source: trunk/abcl/build.xml @ 11515

Last change on this file since 11515 was 11515, checked in by Mark Evenson, 13 years ago

Remove references to building 'j' in the 'abcl' build.xml.

To build 'j', one needs additional sources and resources that [are
best found in the 'j' branch][j].

The best way to build 'j', is via using the [version of build.xml
before the great-ant-refactoring][j-build.xml]. An older version of
this file can be obtained via the proper digging through the
svn:common-lisp.net repository.

[j]: svn://common-lisp.net/project/armedbear/svn/trunk/j

[j-build.xml]: http://abcl-dynamic-install.googlecode.com/svn/trunk/abcl/j-build.xml

  • Property svn:eol-style set to LF
File size: 13.1 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<project xmlns="antlib:org.apache.tools.ant"
3   name="abcl-master" default="help" basedir=".">
4    <description>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
21    <target name="help">
22      <echo>Main Ant targets:
23 abcl.compile 
24   -- compile ABCL to ${build.classes.dir}
25 abcl.jar     
26   -- create packaged ${abcl.jar.path}
27 abcl.wrapper 
28   -- create executable wrapper for ABCL
29 abcl.source.zip abcl.source.tar
30    -- create source distributions in ${dist.dir}
31 abcl.clean
32    -- remove ABCL intermediate files</echo>
33      <echo>Corresponding targets for J have been removed.</echo>
34    </target>
35
36    <property name="abcl.version.path"
37        value="${build.classes.dir}/org/armedbear/lisp/version"/>
38    <property name="abcl.build.path"
39        value="${build.classes.dir}/org/armedbear/lisp/build"/>
40
41    <target name="abcl.stamp" depends="abcl.compile">
42      <tstamp>
43         <format property="build" pattern="EEE MMM dd yyyy HH:mm:ss zzz"/>
44      </tstamp>
45      <mkdir dir="${abcl.build.path}/.."/>
46      <echo message="${build}" file="${abcl.build.path}"/>   
47      <condition property="unix"> 
48  <or>
49    <os family="unix"/>
50    <os family="mac"/>
51  </or>
52      </condition>
53
54      <condition property="windows"> <os family="windows"/></condition>
55
56      <available file="${src.dir}org/armedbear/lisp/Interpreter.java" 
57     property="abcl.lisp.p"/>
58
59      <antcall target="abcl.stamp.version"/>
60      <antcall target="abcl.stamp.hostname"/>
61    </target>
62
63    <target name="abcl.stamp.version" depends="abcl.compile">
64      <java fork="true"
65      classpath="${build.classes.dir}"
66      outputproperty="abcl.version"
67      classname="org.armedbear.lisp.Main">
68  <arg value="--noinit"/>
69  <arg value="--noinform"/>
70  <arg value="--eval"/>
71  <arg value="(progn (format t (lisp-implementation-version)) (finish-output) (quit))"/>
72      </java>
73
74      <echo>Building ABCL version: ${abcl.version}</echo>
75      <mkdir dir="${abcl.version.path}/.."/>
76      <echo message="${abcl.version}" file="${abcl.version.path}"/> 
77
78      <!-- Set from commandline via -D or in 'build.properties' -->
79      <property name="build.version" value="abcl.svn"/>
80      <echo>Build-Version: ${build.version}</echo>
81    </target>
82
83    <target name="abcl.stamp.hostname">
84      <exec executable="hostname" outputproperty="abcl.hostname"/>
85      <echo>abcl.hostname: ${abcl.hostname}</echo>
86    </target>
87
88    <patternset id="abcl.source.java">
89      <include name="org/armedbear/lisp/*.java"/>
90      <include name="org/armedbear/lisp/util/*.java"/>
91    </patternset>
92
93    <patternset id="abcl.source.lisp">
94      <include name="org/armedbear/lisp/*.lisp"/>
95      <include name="org/armedbear/lisp/tests/*.lisp"/>
96    </patternset>
97
98    <patternset id="abcl.scripting.source.java">
99      <include name="org/armedbear/lisp/scripting/*.java"/>
100      <include name="org/armedbear/lisp/scripting/util/*.java"/>
101    </patternset>
102
103    <patternset id="abcl.scripting.source.lisp">
104      <include name="org/armedbear/lisp/scripting/lisp/*.lisp"/>
105    </patternset>
106
107    <!-- Lisp files required at runtime -->
108    <patternset id="abcl.source.lisp.dist">
109      <include name="org/armedbear/lisp/boot.lisp"/>
110    </patternset>
111
112    <patternset id="abcl.objects">
113      <include name="org/armedbear/lisp/*.class"/>
114      <include name="org/armedbear/lisp/util/*.class"/>
115      <include name="org/armedbear/lisp/*.cls"/> 
116      <include name="org/armedbear/lisp/*.abcl"/>
117      <patternset refid="abcl.source.lisp.dist"/>
118    </patternset>
119   
120    <path id="abcl.classpath.dist">
121      <pathelement location="${abcl.jar.path}"/>
122    </path>
123   
124    <path id="abcl.classpath.build">
125      <pathelement location="${build.classes.dir}"/>
126    </path>
127
128    <target name="abcl.compile" depends="abcl.pre-compile,abcl.compile.lisp">
129      <echo>Compiled ABCL with java version: ${java.version}</echo>
130    </target>
131
132    <target name="abcl.pre-compile">
133      <!--- antversion fails in ant 1.7.1 <antversion property="ant.version"
134                                                atleast="1.7"/> -->
135      <mkdir dir="${build.dir}"/>
136      <mkdir dir="${build.classes.dir}"/>
137
138      <property name="java.path"
139    value="${java.home}/bin/java"/>
140
141      <exec executable="hostname" os="unix" 
142      outputproperty="abcl.compile.hostname"/>
143      <exec executable="uname" os="unix" 
144      outputproperty="abcl.compile.uname">
145  <arg value="-a"/>
146      </exec>
147
148      <exec executable="hostname" os="Linux" outputproperty="hostname"/>
149
150      <condition property="abcl.java.version">
151  <or>
152    <matches string="${java.version}" pattern="1\.5"/>
153    <matches string="${java.version}" pattern="1\.6\.0_1[0-9]"/>
154  </or> 
155      </condition>
156      <echo>java.version: ${java.version}</echo>
157    </target>
158   
159    <target name="abcl.java.warning" 
160      depends="abcl.pre-compile"
161      unless="abcl.java.version">
162      <echo>WARNING: Java version ${java.version} not recommended.</echo>
163    </target>
164 
165    <target name="abcl.compile.java" 
166      depends="abcl.pre-compile,abcl.java.warning">
167      <tstamp>
168  <format property="build" pattern="EEE MMM dd yyyy HH:mm:ss zzz"/>
169      </tstamp>
170
171      <javac destdir="${build.classes.dir}"
172       debug="true"
173       target="1.5">
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. -->
192    <patternset id="abcl.source.lisp.fasls">
193      <patternset refid="abcl.source.lisp"/>
194      <exclude name="org/armedbear/lisp/tests/*.lisp"/>
195      <exclude name="org/armedbear/lisp/boot.lisp"/>
196      <exclude name="org/armedbear/lisp/emacs.lisp"/>
197      <exclude name="org/armedbear/lisp/runtime-class.lisp"/>
198      <exclude name="org/armedbear/lisp/run-benchmarks.lisp"/>
199    </patternset>
200
201    <target name="abcl.fasls.uptodate">
202      <uptodate property="abcl.fasls.uptodate.p" value="true">
203  <srcfiles dir="${build.classes.dir}">
204    <patternset refid="abcl.source.lisp.fasls"/>
205  </srcfiles>
206  <mapper type="glob" from="*.lisp" to="*.abcl"/>
207      </uptodate>
208    </target>
209   
210    <target name="abcl.compile.lisp" 
211      depends="abcl.copy.lisp,abcl.compile.java,abcl.fasls.uptodate"
212      unless="abcl.fasls.uptodate.p">
213      <java classpath="${build.classes.dir}"
214      fork="true"
215      classname="org.armedbear.lisp.Main">
216  <arg value="--noinit"/>
217  <arg value="--eval"/>
218  <arg value="(compile-system :zip nil :quit t)"/>
219      </java>
220    </target>
221
222    <target name="abcl.jar" depends="abcl.compile,abcl.stamp">
223      <mkdir dir="${dist.dir}"/>
224      <loadfile property="abcl.version"
225      srcFile="${abcl.version.path}"/>
226      <jar destfile="${abcl.jar.path}"
227     compress="true"
228     basedir="${build.classes.dir}">
229  <patternset refid="abcl.objects"/>
230  <manifest>
231    <attribute name="Main-Class" value="org.armedbear.lisp.Main"/>
232    <section name="org/armedbear/lisp">
233      <attribute name="Implementation-Title" 
234           value="ABCL"/>
235      <attribute name="Implementation-Version" 
236           value="${abcl.version}"/>
237      <attribute name="Implementation-Build" 
238           value="${build}"/>
239      <attribute name="Build-Version" 
240           value="${version}"/>
241    </section>
242  </manifest>
243      </jar>
244    </target>
245   
246    <target name="abcl.debug.jpda" depends="abcl.jar">
247      <description>Invoke ABCL with JPDA listener on port 6789</description>
248      <java fork="true"
249      classpathref="abcl.classpath.dist"
250      classname="org.armedbear.lisp.Main">
251  <jvmarg 
252      value="-agentlib:jdwp=transport=dt_socket,address=6789,server=y"/>
253      </java>
254    </target>
255
256    <target name="abcl.run" depends="abcl.jar">
257      <java fork="true"
258      classpathref="abcl.classpath.dist"
259      classname="org.armedbear.lisp.Main">
260      </java>
261    </target>
262
263    <target name="abcl.wrapper" 
264      depends="abcl.jar,abcl.wrapper.unix,abcl.wrapper.windows">
265      <description>
266  Creates in-place exectuable shell wrapper in '${abcl.wrapper.file}'
267      </description>
268      <!-- Set from commandline or in 'build.properties' -->
269      <property name="additional.jars" value=""/>
270      <path id="abcl.runtime.classpath">
271  <pathelement location="${abcl.jar.path}"/>
272  <pathelement path="${additional.jars}"/>
273      </path>
274      <!-- set via '-Djava.options=JAVA_OPTIONS' or in 'build.properties -->
275      <property name="java.options" value=""/>
276
277      <copy file="${abcl.wrapper.in.file}" toFile="${abcl.wrapper.file}" overwrite="yes">
278  <filterset>
279    <filter token="JAVA" 
280      value="${java.path}"/>
281    <filter token="ABCL_JAVA_OPTIONS" 
282      value= "${java.options}"/>
283    <filter token="ABCL_LIBPATH" 
284      value="${basedir}/src/org/armedbear/lisp/libabcl.so"/>
285    <filter token="ABCL_CLASSPATH" 
286      value="${toString:abcl.runtime.classpath}"/>
287  </filterset>
288      </copy>
289      <chmod file="${abcl.wrapper.file}" perm="a+x"/>
290      <echo>N.B. This wrapper requires '${abcl.jar.path}' not be moved.</echo>
291    </target>
292
293    <target name="abcl.wrapper.unix" if="unix">
294      <property name="abcl.wrapper.file" value="abcl"/>
295      <property name="abcl.wrapper.in.file" value="abcl.in"/>
296    </target>
297
298    <target name="abcl.wrapper.windows" if="windows">
299      <property name="abcl.wrapper.file" value="abcl.bat"/>
300      <property name="abcl.wrapper.in.file" value="abcl.bat.in"/>
301    </target>
302
303    <target name="abcl.clean">
304      <delete dir="${build.dir}"/>
305      <delete file="abcl"/>
306    </target>
307
308    <target name="abcl.dist" depends="abcl.jar">
309      <copy file="${abcl.jar.path}"
310      toFile="${dist.dir}/abcl-${abcl.version}.jar"/>
311    </target>
312
313    <target name="abcl.distclean" depends="abcl.clean">
314      <delete dir="${dist.dir}"/>
315      <delete file="abcl"/>
316      <delete file="j"/>
317    </target>
318
319    <target name="TAGS">
320      <apply executable="etags" parallel="true" verbose="true">
321  <fileset dir="${src.dir}">
322    <patternset refid="abcl.source.java"/>
323    <patternset refid="abcl.source.lisp"/>
324  </fileset>
325      </apply>
326    </target>
327
328    <patternset id="abcl.dist.misc"
329    description="Additional includes in the source distributions relative to basedir">
330      <include name="build.xml"/>
331      <include name="build.properties.in"/>
332      <include name="COPYING"/>
333      <include name="README"/>
334      <include name="abcl.in"/>
335      <include name="abcl.bat.in"/>
336     
337      <!-- The remainder of these files are used by BUILD-ABCL to
338           build ABCL from Lisp but not used by Ant, include them in
339           the source distribution. -->
340      <include name="make-jar.in"/>
341      <include name="make-jar.bat.in"/>
342
343      <include name="build-abcl.lisp"/>
344      <include name="customizations.lisp.in"/>
345
346      <include name="test-abcl.asd"/>
347      <include name="build-abcl.asd"/>
348    </patternset>
349
350    <patternset id="abcl.source.misc"
351    description="Additional includes in the source distribution relative to source root">
352      <include name="org/armedbear/lisp/LICENSE"/>
353      <include name="manifest-abcl"/>
354    </patternset>
355   
356    <target name="abcl.source.prepare" depends="abcl.stamp.version">
357      <property name="abcl.source.eol" value="asis"/>
358      <echo>Using '${abcl.source.eol}' to drive line-ending transformations.</echo>
359      <property name="abcl.build.src.dir"
360    value="${build.dir}/abcl-src-${abcl.version}"/>
361      <mkdir dir="${abcl.build.src.dir}/src"/>
362      <fixcrlf srcdir="${src.dir}" 
363         eol="${abcl.source.eol}"
364         destdir="${abcl.build.src.dir}/src"
365         preservelastmodified="true">
366  <patternset refid="abcl.source.java"/>
367  <patternset refid="abcl.source.lisp"/>
368  <patternset refid="abcl.source.misc"/>
369      </fixcrlf>
370      <fixcrlf srcdir="${basedir}" 
371         eol="${abcl.source.eol}"
372         destdir="${abcl.build.src.dir}"
373         preservelastmodified="true">
374  <patternset refid="abcl.dist.misc"/>
375      </fixcrlf>
376    </target>
377
378    <target name="abcl.source.tar" depends="abcl.source.prepare">
379      <mkdir dir="${dist.dir}"/>
380      <tar destfile="${dist.dir}/abcl-src-${abcl.version}.tar.gz"
381     compression="gzip">
382  <tarfileset dir="${build.dir}">
383    <include name="abcl-src-${abcl.version}/**"/>
384  </tarfileset>
385      </tar>
386    </target>
387
388    <target name="abcl.source.zip" depends="abcl.source.prepare">
389      <mkdir dir="${dist.dir}"/>
390      <zip destfile="${dist.dir}/abcl-src-${abcl.version}.zip"
391     compress="true">
392  <zipfileset dir="${abcl.build.src.dir}" prefix="abcl-src-${abcl.version}"/>
393      </zip>
394    </target>
395
396    <import file="netbeans-build.xml" optional="true"/> 
397<!--    <import file="j-build.xml" optional="true"/>  -->
398    <import file="not.org-build.xml" optional="true"/> 
399</project>
400
Note: See TracBrowser for help on using the repository browser.