root/trunk/ProjectFortress/build.xml @ 3586

Revision 3586, 47.6 KB (checked in by sukyoungryu, 8 months ago)

[preparser] Reorganized the parser family.

Line 
1<?xml version="1.0" ?>
2
3<!--
4Copyright 2009 Sun Microsystems, Inc.,
54150 Network Circle, Santa Clara, California 95054, U.S.A.
6All rights reserved.
7
8U.S. Government Rights - Commercial software.
9Government users are subject to the Sun Microsystems, Inc. standard
10license agreement and applicable provisions of the FAR and its supplements.
11
12Use is subject to license terms.
13
14This distribution may include materials developed by third parties.
15
16Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered
17trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
18-->
19
20<!--
21This is the main Ant build file for the Fortress reference
22implementation. Declarations are separated by type (e.g., taskdefs,
23properties, targets, etc.). To add a new declaration, please find the
24appropriate place in the file. For the sake of readability, please
25maintain proper indentation.
26-->
27
28<project name="Fortress" default="help">
29  <description>
30    A reference implementation of the Fortress programming language.
31  </description>
32
33
34  <!--
35       Properties
36  -->
37
38  <!-- Global properties for this build. -->
39  <property name="packagePrefix" value="com/sun/fortress"/>
40  <property name="package.prefix" value="com.sun.fortress"/>
41  <property name="interpreterPrefix" value="com/sun/fortress/interpreter"/>
42  <property name="interpreter.prefix" value="com.sun.fortress.interpreter"/>
43  <property name="blahblahblah" value="com/sun/fortress"/>
44
45  <!-- Directories in the ${basedir} directory -->
46  <property name="cache0" location="${basedir}/../default_repository/caches"/>
47  <property name="cache1" location="${basedir}/../.fortress_cache"/>
48  <property name="cache2" location="${basedir}/../.interpreter_cache"/>
49  <property name="cache3" location="${basedir}/.interpreter_cache"/>
50  <property name="cache4" location="${basedir}/../.syntax_cache"/>
51  <property name="cache5" location="${basedir}/.syntax_cache"/>
52  <property name="cache6" location="${basedir}/../.analyzed_cache"/>
53  <property name="cache7" location="${basedir}/.analyzed_cache"/>
54  <property name="cache8" location="${basedir}/../.presyntax_cache"/>
55  <property name="cache9" location="${basedir}/.presyntax_cache"/>
56  <property name="cache10" location="${basedir}/../.bytecode_cache"/>
57  <property name="cache11" location="${basedir}/.bytecode_cache"/>
58  <property name="cache12" location="${basedir}/../local_repository/caches"/>
59  <property name="astgen.src" location="${basedir}/astgen"/>
60  <property name="build" location="${basedir}/build"/>
61  <property name="docs" location="${basedir}/docs"/>
62  <property name="src" location="${basedir}/src"/>
63  <property name="library" location="${basedir}/../Library"/>
64  <property name="astgen.generators.src"
65            location="${src}/${packagePrefix}/astgen"/>
66
67  <!-- Third party jar files -->
68  <property name="asm" location="${basedir}/third_party/asm"/>
69  <property name="astgen.third" location="${basedir}/third_party/astgen"/>
70  <property name="jsr166y" location="${basedir}/third_party/jsr166y"/>
71  <property name="junit" location="${basedir}/third_party/junit"/>
72  <property name="plt" location="${basedir}/third_party/plt"/>
73  <property name="unicode.third" location="${basedir}/third_party/unicode"/>
74  <property name="xtc" location="${basedir}/third_party/xtc"/>
75  <property name="unsigned" location="${basedir}/third_party/unsigned"/>
76
77  <!-- Scala jar files -->
78  <property name="scala-compiler.jar"
79            value="${basedir}/third_party/scala/scala-compiler-2.7.2.jar"/>
80  <property name="scala-library.jar"
81            value="${basedir}/third_party/scala/scala-library-2.7.2.jar"/>
82
83  <!-- ASTGen -->
84  <property name="generate-sourcefile" value="${astgen.src}/Fortress.ast" />
85
86  <!-- Package nodes -->
87  <property name="nodesPackage" value="${packagePrefix}/nodes"/>
88  <property name="scala.nodes.package" value="${packagePrefix}/scala_src/nodes"/>
89  <property name="nodes"  location="${src}/${nodesPackage}"/>
90  <property name="scala.nodes"  location="${src}/${scala.nodes.package}"/>
91  <property name="nodesBuild" location="${build}/${nodesPackage}"/>
92
93  <!-- Package nodes_util -->
94  <property name="nodesUtil"  location="${src}/${packagePrefix}/nodes_util"/>
95
96  <!-- Parser packages -->
97  <property name="parser"  location="${src}/${packagePrefix}/parser"/>
98  <property name="preparser" location="${src}/${packagePrefix}/parser/preparser"/>
99  <property name="importcollector" location="${src}/${packagePrefix}/parser/import_collector"/>
100  <property name="templateparser"
101            location="${src}/${packagePrefix}/parser/templateparser"/>
102  <property name="parserUtil"  location="${src}/${packagePrefix}/parser_util"/>
103  <property name="precedence" location="${parserUtil}/precedence"/>
104  <property name="precedenceResolver"
105            location="${parserUtil}/precedence_resolver"/>
106
107  <!-- Unicode packages -->
108  <property name="unicodePackage" value="${packagePrefix}/unicode"/>
109  <property name="unicode" location="${src}/${packagePrefix}/unicode"/>
110  <property name="unicodeBuild" location="${build}/${unicodePackage}"/>
111
112  <!-- Package useful -->
113  <property name="usefulPackage" value="${packagePrefix}/useful"/>
114
115  <!-- For fortress installation -->
116  <property name="testFortress" location=".TEST_FORTRESS"/>
117  <property name="installerDir" location=".installer"/>
118  <property name="protofortress" location="${basedir}/fortress/FORTRESS"/>
119  <property name="protofortress.lib" location="${protofortress}/lib"/>
120
121  <!-- Instrumentation -->
122  <property name="instrumentation.package"
123            value="${package.prefix}.parser_util.instrumentation"/>
124  <property name="instrumentationPackage"
125            value="${packagePrefix}/parser_util/instrumentation"/>
126  <property name="instrumentation.outfile"
127            location="${parserUtil}/instrumentation/coverage-report.txt"/>
128  <property name="instrumentation.transient"
129            location="${parserUtil}/instrumentation/transient.txt"/>
130
131  <!-- For tests -->
132  <property name="test.results" location="${basedir}/TEST-RESULTS"/>
133
134  <!-- Other settings -->
135  <property name="junitMem" value="768m"/>
136  <property name="junit.dir" value="junit-results"/>
137  <property name="javaSourceVersion" value="1.5"/>
138  <property environment="env"/>
139  <condition property="correct.environment">
140    <and>
141      <equals arg1="${ant.java.version}" arg2="1.6"/>
142      <equals arg1="${env.ANT_CALLED_FROM_SCRIPT}" arg2='yes'/>
143    </and>
144  </condition>
145
146
147  <!--
148       Paths
149  -->
150  <path id="scala.classpath">
151    <pathelement location="${scala-compiler.jar}"/>
152    <pathelement location="${scala-library.jar}"/>
153  </path>
154
155  <path id="astgen.path">
156    <path refid="scala.classpath"/>
157    <pathelement location="${astgen.third}/astgen.jar" />
158    <pathelement location="${build}" />
159  </path>
160
161  <path id="astgen.classpath">
162    <path refid="scala.classpath"/>
163    <pathelement location="${build}"/>
164    <pathelement location="${astgen.third}/astgen.jar"/>
165  </path>
166
167  <path id="instrumentedparser.classpath">
168    <path refid="scala.classpath"/>
169    <pathelement location="${build}"/>
170    <pathelement location="${xtc}/xtc.jar"/>
171    <pathelement location="${plt}/plt.jar"/>
172  </path>
173
174  <path id="compile.classpath">
175    <path refid="scala.classpath"/>
176    <pathelement location="${build}"/>
177    <pathelement location="${asm}/asm-3.1.jar"/>
178    <pathelement location="${asm}/asm-tree-3.1.jar"/>
179    <pathelement location="${xtc}/xtc.jar"/>
180    <pathelement location ="${unsigned}/unsigned.jar"/>
181    <pathelement location="${jsr166y}/jsr166y.jar"/>
182    <pathelement location="${plt}/plt.jar"/>
183    <pathelement location="${astgen.third}/astgen.jar" />
184    <pathelement location="${junit}/junit.jar"/>
185    <pathelement location="${ant.home}/lib/ant.jar"/>
186    <pathelement location="${java.home}/../lib/tools.jar"/>
187  </path>
188
189  <!--
190       Taskdefs
191  -->
192  <taskdef resource="scala/tools/ant/antlib.xml">
193    <classpath refid="scala.classpath"/>
194  </taskdef>
195
196
197  <!--
198       Targets
199  -->
200  <target name="help">
201    <echo message="ant checkEnv, checkNodesUptodate, checkOperatorsUptodate,
202                   checkParserUptodate, clean, cleanCache, compileJava, compileAll,
203                   compileCommon, compileCommonLint, compileLint, doc,
204                   grammarCoverage, help, init, interpreter-jar,
205                   makeAST, operatorsGen, fortressparser, preparser,
206                   parser, reportNotPassing, systemProperties, test,
207                   testAll, testDemos, testSystem, testOnly
208                   -DtestPattern='some pattern', testCruiseControl"/>
209    <echo message="If you are building Fortress, you want ant compile or ant test."/>
210  </target>
211
212  <target name="systemProperties">
213    <echo message="Environment variables set correctly? ${correct.environment}"/>
214    <echo message="basedir: ${basedir}"/>
215    <echo message="Ant Java version: ${ant.java.version}"/>
216    <echo message="Ant called from script? ${env.ANT_CALLED_FROM_SCRIPT}"/>
217    <echo message="ANT_ARGS: ${env.ANT_ARGS}"/>
218    <echo message="ANT_OPTS: ${env.ANT_OPTS}"/>
219    <echo message="Scala version: ${scalac.version}" />
220    <echo message="Java Runtime Environment
221                   version: ${java.version}"/>
222    <echo message="Java Runtime Environment
223                   vendor: ${java.vendor}"/>
224    <echo message="Java Runtime Environment
225                   vendor URL: ${java.vendor.url}"/>
226    <echo message="Java installation
227                   directory: ${java.home}"/>
228    <echo message="Java Virtual Machine
229                   specification version:
230                   ${java.vm.specification.version}"/>
231    <echo message="Java Virtual Machine
232                   specification vendor:
233                   ${java.vm.specification.vendor}"/>
234    <echo message="Java Virtual Machine
235                   specification name:
236                   ${java.vm.specification.name}"/>
237    <echo message="Java Virtual Machine
238                   implementation version:
239                   ${java.vm.version}"/>
240    <echo message="Java Virtual Machine
241                   implementation vendor:
242                   ${java.vm.vendor}"/>
243    <echo message="Java Virtual Machine
244                   implementation name: ${java.vm.name}"/>
245    <echo message="Java Runtime Environment
246                   specification version:
247                   ${java.specification.version}"/>
248    <echo message="Java Runtime Environment
249                   specification vendor:
250                   ${java.specification.vendor}"/>
251    <echo message="Java Runtime Environment
252                   specification name:
253                   ${java.specification.name}"/>
254    <echo message="Java class format version
255                   number: ${java.class.version}"/>
256    <echo message="Java class path:
257                   ${java.class.path}"/>
258    <echo message="List of paths to search when
259                   loading libraries: ${java.library.path}"/>
260    <echo message="Path of extension directory
261                   or directories: ${java.ext.dirs}"/>
262    <echo message="Default temp file path:
263                   ${java.io.tmpdir}"/>
264    <echo message="Operating system name:
265                   ${os.name}"/>
266    <echo message="Operating system
267                   architecture: ${os.arch}"/>
268    <echo message="Operating system version:
269                   ${os.version}"/>
270  </target>
271
272  <target name="checkEnv">
273    <echo message="Environment variables set correctly? ${correct.environment}"/>
274    <fail unless="correct.environment"
275          message="ERROR: This build script requires specific command-line arguments to Ant. Please call it using the script provided at ${basedir}/ant."/>
276  </target>
277
278  <target name="init">
279    <echo message="basedir: ${basedir}"/>
280    <!-- Create the time stamp. -->
281    <tstamp/>
282    <!-- Create the build directory structure used by compile. -->
283    <mkdir dir="${build}"/>
284    <mkdir dir="${junit.dir}"/>
285  </target>
286
287  <target name="cleanAst" depends="cleanCache"
288          description="Delete the ${nodes} directory tree and cached asts.">
289    <delete dir="${nodes}"/>
290  </target>
291
292  <target name="clean" depends="cleanAst"
293          description="Delete the ${build} directory tree and generated files.">
294    <delete dir="${build}"/>
295    <delete dir="${nodes}"/>
296    <delete dir="${junit.dir}"/>
297
298    <!-- No longer needed, but eases the upgrade-->
299    <delete file="${nodesUtil}/BaseNodeMaker.java"/>
300    <!-- No longer needed, but eases the upgrade-->
301    <delete file="${nodesUtil}/InterfaceMaker.java"/>
302    <delete file="${parser}/Fortress.java"/>
303    <delete file="${parser}/FortressInstrumented.java"/>
304    <delete file="${preparser}/PreFortress.java"/>
305    <delete file="${importcollector}/ImportCollector.java"/>
306    <delete file="${templateparser}/TemplateParser.java"/>
307    <delete file="${precedenceResolver}/Operators.java"/>
308    <!-- No longer needed, but eases the upgrade-->
309    <delete file="${src}/com/sun/fortress/parser/precedence/resolver/Operators.java"/>
310    <delete file="${instrumentation.outfile}"/>
311    <delete file="${library}/FortressAst.fsi" />
312    <delete file="${library}/FortressAst.fss" />
313    <delete file="${astgen.src}/FortressAst.scala" />
314    <delete file="FortressLibrary.ast"/>
315    <delete file="FortressLibrary.tfs"/>
316    <delete file="${basedir}/tests/printing/test_output.txt" />
317    <delete file="testFile.txt"/>
318    <delete file="${src}/com/sun/fortress/scala_src/nodes/FortressAst.scala" />
319    <delete dir="${src}/com/sun/fortress/scalasrc" />
320    <delete dir="${basedir}/test-tmp" />
321    <delete>
322      <fileset dir="src" includes="**/*.class" />
323    </delete>
324  </target>
325
326  <target name="cleanCache"
327          description="Delete any cached Fortress ASTs in the development tree">
328    <delete dir="${cache0}"/>
329    <delete dir="${cache1}"/>
330    <delete dir="${cache2}"/>
331    <delete dir="${cache3}"/>
332    <delete dir="${cache4}"/>
333    <delete dir="${cache5}"/>
334    <delete dir="${cache6}"/>
335    <delete dir="${cache7}"/>
336    <delete dir="${cache8}"/>
337    <delete dir="${cache9}"/>
338    <delete dir="${cache10}"/>
339    <delete dir="${cache11}"/>
340    <delete dir="${cache12}"/>
341  </target>
342
343  <!-- Generation of Operators.java depends only on the files listed below.
344       Note that there are class files it depends on; if these class files are
345       not up to date with respect to their sources, they are themselves
346       recompiled by the compileCommon target.-->
347  <target name="checkOperatorsUptodate" depends="init, compileCommon">
348    <condition property="operators.uptodate">
349      <and>
350        <uptodate srcfile="${unicode.third}/UnicodeData.500.txt"
351                  targetfile="${precedenceResolver}/Operators.java"/>
352        <uptodate srcfile="${precedenceResolver}/operators.txt"
353                  targetfile="${precedenceResolver}/Operators.java"/>
354        <uptodate srcfile="${unicodeBuild}/OperatorStuffGenerator.class"
355                  targetfile="${precedenceResolver}/Operators.java"/>
356        <uptodate srcfile="${unicodeBuild}/Element.class"
357                  targetfile="${precedenceResolver}/Operators.java"/>
358      </and>
359    </condition>
360    <echo message="Operators up to date? ${operators.uptodate}"/>
361  </target>
362
363  <target name="operatorsGen"  unless="operators.uptodate"
364          depends="init, compileCommon, checkOperatorsUptodate"
365          description="Automatically generate visitors for AST nodes.">
366    <echo message="Regenerating operators"/>
367    <java classname="${package.prefix}.unicode.OperatorStuffGenerator"
368          fork="true">
369      <classpath>
370        <pathelement location="${build}"/>
371        <pathelement location="${basedir}/third_party/plt/plt.jar"/>
372      </classpath>
373    </java>
374  </target>
375
376  <target name="DumpProperties"
377          description="Dump properties as seen by a Java program.">
378    <java classname="${package.prefix}.repository.DumpProperties"
379          fork="true">
380      <sysproperty key="DEBUG" value="true"/>
381      <classpath>
382        <pathelement location="${build}"/>
383      </classpath>
384    </java>
385  </target>
386
387  <target name="checkAstgen">
388    <condition property="astgenerators.uptodate">
389      <uptodate targetfile="${basedir}/build/com/sun/fortress/astgen/FortressAstGenerator.class">
390        <srcfiles dir="${basedir}/src/com/sun/fortress/astgen/" includes="*.java"/>
391      </uptodate>
392    </condition>
393  </target>
394
395  <target name="astGenerators"
396          unless="astgenerators.uptodate"
397          depends="init,checkAstgen"
398          description="Compile all ASTGen custom generators.">
399    <depend srcdir="${astgen.generators.src}"
400            destdir="${build}"
401            closure="yes"
402            cache="${basedir}/.dependencies"/>
403    <javac
404        srcdir="${astgen.generators.src}"
405        destdir="${build}"
406        source="${javaSourceVersion}"
407        debug="true"
408        includeantruntime="false"
409        fork="true"
410        memorymaximumsize="${junitMem}">
411      <!-- Uncomment the following line to print unchecked warnings
412           (here and in the 'compileCommon' target. -->
413      <!-- <compilerarg value="-Xlint:unchecked"/> -->
414      <classpath refid="astgen.classpath"/>
415      <include name="**/*.java"/>
416      <exclude name="${usefulPackage}/*.java"/>
417      <exclude name="${unicodePackage}/*.java"/>
418    </javac>
419    <scalac
420        srcdir="${astgen.generators.src}"
421        destdir="${build}"
422        classpathref="astgen.classpath"
423        addparams=""
424        deprecation="yes">
425      <include name="**/*.scala"/>
426      <exclude name="${usefulPackage}/*.scala"/>
427      <exclude name="${unicodePackage}/*.scala"/>
428    </scalac>
429  </target>
430
431  <target name="checkNodesUptodate" depends="astGenerators">
432    <condition property="nodes.uptodate">
433      <and>
434        <available file="${nodes}/AbstractNode.java"/>
435        <uptodate srcfile="${astgen.src}/Fortress.ast"
436                  targetfile="${nodes}/AbstractNode.java"/>
437        <available file="${library}/FortressAst.fsi" />
438        <uptodate srcfile="${astgen.src}/Fortress.ast"
439                  targetfile="${library}/FortressAst.fsi" />
440        <available file="${library}/FortressAst.fss" />
441        <uptodate srcfile="${astgen.src}/Fortress.ast"
442                  targetfile="${library}/FortressAst.fss" />
443        <uptodate targetfile="${library}/FortressAst.fsi">
444          <srcfiles dir="${basedir}/src/com/sun/fortress/astgen/" includes="**/*.java"/>
445        </uptodate>
446      </and>
447    </condition>
448    <echo message="Nodes up to date? ${nodes.uptodate}"/>
449  </target>
450
451  <taskdef name="astgen" classpath="${astgen.third}/astgen.jar;${build}"
452           classname="edu.rice.cs.astgen.AntTask"/>
453
454  <target name="makeAST" unless="nodes.uptodate" depends="checkNodesUptodate"
455          description="Automatically generate AST nodes.">
456    <echo message="Processing ${generate-sourcefile}" />
457    <astgen file="${generate-sourcefile}" />
458    <move todir="${nodes}">
459      <fileset dir="${astgen.src}">
460        <include name="**/*.java"/>
461        <exclude name="**/Fortress.ast"/>
462      </fileset>
463    </move>
464    <move todir="${library}">
465      <fileset dir="${astgen.src}">
466        <include name="FortressAst.fss" />
467        <include name="FortressAst.fsi" />
468      </fileset>
469    </move>
470    <move todir="${scala.nodes}">
471      <fileset dir="${astgen.src}">
472        <include name="FortressAst.scala" />
473      </fileset>
474    </move>
475  </target>
476
477  <target name="compileJava" depends="compileCommon, makeAST, parser, operatorsGen"
478          description="Compile all Fortress code written in Java (Scala code is ignored).">
479    <depend srcdir="${src}"
480            destdir="${build}"
481            closure="yes"
482            cache="${basedir}/.dependencies"/>
483    <javac
484        srcdir="${src}"
485        destdir="${build}"
486        debug="true"
487        includeantruntime="false"
488        fork="true"
489        memorymaximumsize="${junitMem}">
490      <!-- Uncomment the following line to print unchecked warnings
491           (here and in the 'compileCommon' target. -->
492      <!-- <compilerarg value="-Xlint:unchecked"/> -->
493      <classpath refid="compile.classpath"/>
494      <include name="**/*.java"/>
495      <exclude name="${usefulPackage}/*.java"/>
496      <exclude name="${unicodePackage}/*.java"/>
497    </javac>
498  </target>
499
500  <target name="compileAll" depends="compileCommon, makeAST, parser, operatorsGen"
501          description="Compile all Fortress code.">
502    <scalac
503        srcdir="${src}"
504        destdir="${build}"
505        classpathref="compile.classpath"
506        deprecation="yes">
507      <include name="**/*.java"/>
508      <include name="**/*.scala"/>
509      <exclude name="${usefulPackage}/*.java"/>
510      <exclude name="${unicodePackage}/*.java"/>
511    </scalac>
512    <javac
513        srcdir="${src}"
514        destdir="${build}"
515        debug="true"
516        includeantruntime="false"
517        fork="true"
518        memorymaximumsize="${junitMem}">
519      <!-- Uncomment the following line to print unchecked warnings
520           (here and in the 'compileCommon' target. -->
521      <!-- <compilerarg value="-Xlint:unchecked"/> -->
522      <classpath refid="compile.classpath"/>
523      <include name="**/*.java"/>
524      <exclude name="${usefulPackage}/*.java"/>
525      <exclude name="${unicodePackage}/*.java"/>
526    </javac>
527  </target>
528
529  <target name="compile" depends="compileAll"/>
530
531  <target name="check.blas" depends="init">
532    <javac destdir="${build}" srcdir="${src}/com/sun/fortress/numerics">
533      <classpath refid="compile.classpath"/>
534    </javac>
535
536    <java failonerror="true"
537          classname="com.sun.fortress.numerics.CheckBlasEnvironment">
538      <classpath refid="compile.classpath"/>
539    </java>
540  </target>
541
542  <target name="check.linux">
543    <condition property="blas.islinux">
544      <equals arg1="${os.name}" arg2="Linux" />
545    </condition>
546  </target>
547
548  <target name="blas.linux" depends="check.linux" if="blas.islinux">
549    <echo message="Generating C header and stub files." />
550    <javah class="com.sun.fortress.numerics.Blas"
551           destdir="c"
552           classpath="build"
553           />
554    <echo message="Now compiling C stubs for blas on arch linux."/>
555    <exec executable="gcc" failonerror="true">
556      <arg value="-fPIC" />
557      <arg value="-Ic" />
558      <arg value="-I${env.BLAS_INCLUDE}" />
559      <arg value="-L${env.BLAS_LIB}" />
560      <arg value="-I${env.JAVA_HOME}/include" />
561      <arg value="-I${env.JAVA_HOME}/include/linux" />
562      <arg value="c/blas.c" />
563      <arg value="-lcblas" />
564      <arg value="-lblas" />
565      <arg value="-shared" />
566      <arg value="-olibblas.so" />
567    </exec>
568  </target>
569
570  <target name="check.osx">
571    <condition property="blas.is.osx">
572      <equals arg1="${os.name}" arg2="Mac OS X" />
573    </condition>
574  </target>
575
576  <target name="blas.osx" depends="check.osx" if="blas.is.osx">
577    <echo message="Generating C header and stub files." />
578    <javah class="com.sun.fortress.numerics.Blas"
579           destdir="c"
580           classpath="build"
581           />
582    <echo message="Now compiling C stubs for blas on arch OS X."/>
583    <exec executable="gcc" failonerror="true">
584      <arg line="-D OSX" />
585      <arg value="-fPIC" />
586      <arg value="-Ic" />
587      <arg line="-framework Accelerate" />
588      <arg value="-I${env.JAVA_LIB}/Headers" />
589      <arg value="c/blas.c" />
590      <arg value="-lcblas" />
591      <arg value="-lblas" />
592      <arg value="-shared" />
593      <arg value="-bundle" />
594      <arg line="-o libblas.dylib" />
595    </exec>
596  </target>
597
598  <target name="check.sunos">
599    <condition property="blas.is.sunos">
600      <equals arg1="${os.name}" arg2="SunOS" />
601    </condition>
602  </target>
603
604  <target name="blas.sunos" depends="check.sunos" if="blas.is.sunos">
605    <echo message="Generating C header and stub files." />
606    <javah class="com.sun.fortress.numerics.Blas"
607           destdir="c"
608           classpath="build"
609           />
610    <echo message="Now compiling C stubs for blas on arch SunOS."/>
611    <exec executable="cc" failonerror="true">
612      <arg line="-D SUNOS" />
613      <arg value="-fPIC" />
614      <arg value="-Ic" />
615      <arg value="-I${env.JAVA_HOME}/include" />
616      <arg value="-I${env.JAVA_HOME}/include/solaris" />
617      <arg value="c/sunperf_blas.c" />
618      <arg value="-shared" />
619      <arg value="-dalign" />
620      <arg value="-xlic_lib=sunperf" />
621      <arg value="-olibblas.so" />
622    </exec>
623  </target>
624
625  <target name="blas" depends="check.blas,blas.linux,blas.osx,blas.sunos"></target>
626
627  <target name="compileLint"
628          depends="compileCommonLint, makeAST, parser, operatorsGen"
629          description="Compile all interpreter code.">
630    <depend srcdir="${src}"
631            destdir="${build}"
632            closure="yes"
633            cache="${basedir}/.dependencies"/>
634    <javac
635        srcdir="${src}"
636        destdir="${build}"
637        source="${javaSourceVersion}"
638        debug="true"
639        includeantruntime="false"
640        fork="true"
641        memorymaximumsize="${junitMem}">
642      <!-- Uncomment the following line to print unchecked warnings. -->
643      <classpath refid="compile.classpath"/>
644      <compilerarg value="-Xlint:unchecked"/>
645      <include name="**/*.java"/>
646      <exclude name="${usefulPackage}/*.java"/>
647      <exclude name="${unicodePackage}/*.java"/>
648    </javac>
649  </target>
650
651  <target name="compileCommon" depends="init"
652          description="Compile interpreter-indepedent code.">
653    <depend srcdir="${src}"
654            destdir="${build}"
655            closure="yes"
656            cache="${basedir}/.dependencies"/>
657    <javac
658        srcdir="${src}"
659        destdir="${build}"
660        source="${javaSourceVersion}"
661        debug="true"
662        includeantruntime="false"
663        fork="true">
664      <!-- Uncomment the following line to print unchecked warnings. -->
665      <!-- <compilerarg value="-Xlint:unchecked"/>  -->
666      <classpath refid="compile.classpath"/>
667      <include name="${blahblahblah}/useful/*.java"/>
668      <include name="${blahblahblah}/unicode/*.java"/>
669    </javac>
670  </target>
671
672  <target name="compileCommonLint" depends="init"
673          description="Compile interpreter-indepedent code.">
674    <depend srcdir="${src}"
675            destdir="${build}"
676            closure="yes"
677            cache="${basedir}/.dependencies"/>
678    <javac
679        srcdir="${src}"
680        destdir="${build}"
681        source="${javaSourceVersion}"
682        debug="true"
683        includeantruntime="false"
684        fork="true">
685      <classpath refid="compile.classpath"/>
686      <!-- Uncomment the following line to print unchecked warnings. -->
687      <compilerarg value="-Xlint:unchecked"/>
688      <include name="${usefulPackage}/*.java"/>
689      <include name="${unicodePackage}/*.java"/>
690    </javac>
691  </target>
692
693
694  <target name="interpreter-jar" depends="compileAll"
695          description="Package up the interpreter in a jar.">
696    <jar
697        destfile="../bin/interpreter.jar"
698        basedir="${build}"
699        includes="**/*"/>
700  </target>
701
702  <target name="testOnly" depends="compileAll"
703          description="Run specific tests (use -DtestPattern=...).">
704    <mkdir dir="${test.results}"/>
705    <mkdir dir="${basedir}/test-tmp" />
706    <junit printsummary="off"
707           haltonerror="off"
708           haltonfailure="off"
709           showoutput="yes"
710           fork="true"
711           maxmemory="${junitMem}"
712           errorProperty="tests.failed"
713           failureProperty="tests.failed">
714      <classpath refid="compile.classpath"/>
715      <jvmarg value="-Djava.io.tmpdir=${basedir}/test-tmp" />
716      <formatter type="plain" usefile="false"/>
717      <syspropertyset>
718        <propertyref prefix="plt." />
719      </syspropertyset>
720      <batchtest fork="true" todir="${test.results}">
721        <fileset dir="${build}">
722          <and>
723            <filename name="**/*${testPattern}*/**" />
724            <or>
725              <filename name="**/*JUTest.class" />
726              <filename name="**/*JUTestAll.class" />
727              <filename name="**/*JxTest.class" />
728            </or>
729          </and>
730          <exclude name="**/*$*.class"/>
731        </fileset>
732      </batchtest>
733    </junit>
734    <delete dir="${basedir}/test-tmp" />
735    <fail message="Tests expected to pass are failing!" if="tests.failed"/>
736  </target>
737
738  <target name="test" depends="compileAll, testFast"
739          description="Clean, compile everything, and run all unit and system tests.">
740  </target>
741
742  <target name ="testNative" depends="cleanCache, compile"
743          description="Test the native code generator">
744    <mkdir dir="${test.results}"/>
745    <mkdir dir="${basedir}/test-tmp" />
746    <junit printsummary="on"
747           haltonerror="off"
748           haltonfailure="off"
749           showoutput="yes"
750           fork="true"
751           maxmemory="${junitMem}"
752           errorProperty="tests.failed"
753           failureProperty="tests.failed">
754      <classpath refid="compile.classpath"/>
755      <jvmarg value="-Djava.io.tmpdir=${basedir}/test-tmp" />
756      <formatter type="plain" usefile="true"/>
757      <batchtest fork="true" todir="${test.results}">
758        <fileset dir="${build}">
759          <include name="**/WrapperGeneratorJUTest.class"/>
760        </fileset>
761      </batchtest>
762    </junit>
763    <delete dir="${basedir}/test-tmp" />
764    <fail message="Tests expected to pass are failing!" if="tests.failed"/>
765  </target>
766
767  <target name="testFast"
768          description="Run all unit and system tests expected to pass.">
769    <mkdir dir="${test.results}"/>
770    <mkdir dir="${basedir}/test-tmp" />
771    <junit printsummary="on"
772           haltonerror="off"
773           haltonfailure="off"
774           showoutput="yes"
775           fork="true"
776           maxmemory="${junitMem}"
777           errorProperty="tests.failed"
778           failureProperty="tests.failed">
779      <classpath refid="compile.classpath"/>
780      <jvmarg value="-Djava.io.tmpdir=${basedir}/test-tmp" />
781      <formatter type="plain" usefile="true"/>
782      <batchtest fork="true" todir="${test.results}">
783        <fileset dir="${build}">
784          <include name="**/*JUTest.class"/>
785          <include name="**/*JUTests.class"/>
786          <exclude name="**/*$*.class"/>
787          <exclude name="**/SyntaxAbstractionJUTestAll.class"/>
788          <exclude name="**/tools/AstJUTest.class"/>
789        </fileset>
790      </batchtest>
791    </junit>
792    <delete dir="${basedir}/test-tmp" />
793    <fail message="Tests expected to pass are failing!" if="tests.failed"/>
794  </target>
795
796  <target name="testCruiseControl" depends="compileAll"
797          description="Run all unit and system tests expected to pass.">
798    <mkdir dir="${test.results}"/>
799    <mkdir dir="${basedir}/test-tmp" />
800    <junit printsummary="on"
801           haltonerror="off"
802           haltonfailure="off"
803           showoutput="yes"
804           fork="true"
805           maxmemory="${junitMem}"
806           errorProperty="tests.failed"
807           failureProperty="tests.failed">
808      <classpath refid="compile.classpath"/>
809      <jvmarg value="-Djava.io.tmpdir=${basedir}/test-tmp" />
810      <formatter type="plain" usefile="true"/>
811      <batchtest fork="true" todir="${junit.dir}">
812        <formatter type="brief" usefile="false" />
813        <formatter type="xml" />
814        <fileset dir="${build}">
815          <include name="**/*JUTest.class"/>
816          <include name="**/*JUTests.class"/>
817          <exclude name="**/*$*.class"/>
818          <exclude name="**/SyntaxAbstractionJUTestAll.class"/>
819          <exclude name="**/tools/AstJUTest.class"/>
820        </fileset>
821      </batchtest>
822    </junit>
823    <delete dir="${basedir}/test-tmp" />
824    <fail message="Tests expected to pass are failing!" if="tests.failed"/>
825  </target>
826
827  <target name="testNotPassing" depends="compileAll"
828          description="Run system tests that aren't passing yet.">
829    <mkdir dir="${test.results}"/>
830    <mkdir dir="${basedir}/test-tmp" />
831    <junit printsummary="on"
832           haltonerror="off"
833           haltonfailure="off"
834           showoutput="yes"
835           fork="true"
836           maxmemory="${junitMem}"
837           errorProperty="tests.failed"
838           failureProperty="tests.failed">
839      <classpath refid="compile.classpath"/>
840      <jvmarg value="-Djava.io.tmpdir=${basedir}/test-tmp" />
841      <formatter type="brief" usefile="true"/>
842      <batchtest fork="true" todir="${test.results}">
843        <fileset dir="${build}">
844          <include name="**/*NotPassingYet.class"/>
845        </fileset>
846      </batchtest>
847    </junit>
848    <delete dir="${basedir}/test-tmp" />
849    <fail message="Tests expected to fail are failing!" if="tests.failed"/>
850  </target>
851
852  <target name="testSpecData" depends="compileAll"
853          description="Run SpecDataJUTests.">
854    <mkdir dir="${test.results}"/>
855    <mkdir dir="${basedir}/test-tmp" />
856    <junit printsummary="on"
857           haltonerror="off"
858           haltonfailure="off"
859           showoutput="yes"
860           fork="true"
861           maxmemory="${junitMem}"
862           errorProperty="tests.failed"
863           failureProperty="tests.failed">
864      <classpath refid="compile.classpath"/>
865      <jvmarg value="-Djava.io.tmpdir=${basedir}/test-tmp" />
866      <formatter type="plain" usefile="true"/>
867      <batchtest fork="true" todir="${test.results}">
868        <fileset dir="${build}">
869          <include name="**/SpecDataJUTest.class"/>
870        </fileset>
871      </batchtest>
872    </junit>
873    <delete dir="${basedir}/test-tmp" />
874    <fail message="Tests expected to pass are failing!" if="tests.failed"/>
875  </target>
876
877  <target name="testSystem" depends="compileAll"
878          description="Run SystemJUTests.">
879    <mkdir dir="${test.results}"/>
880    <mkdir dir="${basedir}/test-tmp" />
881    <junit printsummary="on"
882           haltonerror="off"
883           haltonfailure="off"
884           showoutput="yes"
885           fork="true"
886           maxmemory="${junitMem}"
887           errorProperty="tests.failed"
888           failureProperty="tests.failed">
889      <classpath refid="compile.classpath"/>
890      <jvmarg value="-Djava.io.tmpdir=${basedir}/test-tmp" />
891      <formatter type="plain" usefile="true"/>
892      <batchtest fork="true" todir="${test.results}">
893        <fileset dir="${build}">
894          <include name="**/SystemJUTest.class"/>
895        </fileset>
896      </batchtest>
897    </junit>
898    <delete dir="${basedir}/test-tmp" />
899    <fail message="Tests expected to pass are failing!" if="tests.failed"/>
900  </target>
901
902  <target name="testblas" depends="compile,blas" description="Test blas">
903    <mkdir dir="${basedir}/test-tmp" />
904    <junit printsummary="on"
905           haltonerror="off"
906           haltonfailure="off"
907           showoutput="yes"
908           fork="true"
909           maxmemory="${junitMem}"
910           errorProperty="tests.failed"
911           failureProperty="tests.failed">
912      <classpath refid="compile.classpath"/>
913      <jvmarg value="-Djava.io.tmpdir=${basedir}/test-tmp" />
914      <formatter type="plain" usefile="true"/>
915      <batchtest fork="true" todir="${test.results}">
916        <fileset dir="${build}">
917          <include name="**/BlasJxTest.class"/>
918        </fileset>
919      </batchtest>
920    </junit>
921    <delete dir="${basedir}/test-tmp" />
922    <fail message="Tests expected to pass are failing!" if="tests.failed"/>
923  </target>
924
925  <target name="testsyntax" depends="compileAll"
926          description="Run SyntaxAbstractionJUTests.">
927    <mkdir dir="${test.results}"/>
928    <mkdir dir="${basedir}/test-tmp" />
929    <junit printsummary="on"
930           haltonerror="off"
931           haltonfailure="off"
932           showoutput="yes"
933           fork="true"
934           maxmemory="${junitMem}"
935           errorProperty="tests.failed"
936           failureProperty="tests.failed">
937      <classpath refid="compile.classpath"/>
938      <jvmarg value="-Djava.io.tmpdir=${basedir}/test-tmp" />
939      <formatter type="plain" usefile="true"/>
940      <batchtest fork="true" todir="${test.results}">
941        <fileset dir="${build}">
942          <include name="**/SyntaxAbstractionJUTest.class"/>
943          <include name="**/SyntaxAbstractionJUTestAll.class"/>
944        </fileset>
945      </batchtest>
946    </junit>
947    <delete dir="${basedir}/test-tmp" />
948    <fail message="Tests expected to pass are failing!" if="tests.failed"/>
949  </target>
950
951  <target name="testDemos" depends="compileAll"
952          description="Run demos in a test harness.">
953    <mkdir dir="${test.results}"/>
954    <mkdir dir="${basedir}/test-tmp" />
955    <junit printsummary="on"
956           haltonerror="off"
957           haltonfailure="off"
958           showoutput="yes"
959           fork="true"
960           maxmemory="${junitMem}"
961           errorProperty="tests.failed"
962           failureProperty="tests.failed">
963      <classpath refid="compile.classpath"/>
964      <jvmarg value="-Djava.io.tmpdir=${basedir}/test-tmp" />
965      <formatter type="brief" usefile="true"/>
966      <batchtest fork="true" todir="${test.results}">
967        <fileset dir="${build}">
968          <include name="**/DemoTests.class"/>
969        </fileset>
970      </batchtest>
971    </junit>
972    <delete dir="${basedir}/test-tmp" />
973    <fail message="Tests expected to pass are failing!" if="tests.failed"/>
974  </target>
975
976  <target name="testAll"
977          depends="test, testNotPassing, testDemos, reportNotPassing"
978          description="Run all tests, including those known not to pass yet.">
979  </target>
980
981  <target name="testNightly" depends="test, testDemos, testsyntax"
982          description="Run tests, demos, and syntax abstraction tests.">
983  </target>
984
985  <target name="reportNotPassing"
986          if="not.passing.yet"
987          depends="test,testNotPassing">
988    <echo message="Some tests expected to fail still aren't passing."/>
989  </target>
990
991  <!-- If the generated file Fortress.java is no older than all rats files
992       in the parser directory, then the parser must be up to date.
993       This is a conservative test; a more precise test would perform a
994       dependency analysis over Rats! code.-->
995  <target name="checkParserUptodate" depends="init">
996    <condition property="parser.uptodate">
997      <and>
998        <uptodate targetfile="${parser}/Fortress.java">
999          <srcfiles dir="${parser}" includes="**/*.rats"/>
1000        </uptodate>
1001        <uptodate targetfile="${preparser}/PreFortress.java">
1002          <srcfiles dir="${parser}" includes="**/*.rats"/>
1003          <srcfiles dir="${preparser}" includes="**/*.rats"/>
1004        </uptodate>
1005        <uptodate targetfile="${importcollector}/ImportCollector.java">
1006          <srcfiles dir="${parser}" includes="**/*.rats"/>
1007          <srcfiles dir="${importcollector}" includes="**/*.rats"/>
1008        </uptodate>
1009        <uptodate targetfile="${templateparser}/TemplateParser.java">
1010          <srcfiles dir="${parser}" includes="**/*.rats"/>
1011          <srcfiles dir="${templateparser}" includes="**/*.rats"/>
1012        </uptodate>
1013      </and>
1014    </condition>
1015    <echo>Parser up to date? ${parser.uptodate}</echo>
1016  </target>
1017
1018  <target name="checkFortressParserUptodate" depends="init">
1019    <uptodate property="fortressparser.uptodate"
1020              targetfile="${parser}/Fortress.java">
1021      <srcfiles dir="${parser}" includes="**/*.rats"/>
1022    </uptodate>
1023    <echo>Fortress parser up to date? ${parser.uptodate}</echo>
1024  </target>
1025
1026  <target name="checkPreparserUptodate" depends="init">
1027    <uptodate property="preparser.uptodate"
1028              targetfile="${preparser}/PreFortress.java">
1029      <srcfiles dir="${parser}" includes="**/*.rats"/>
1030      <srcfiles dir="${preparser}" includes="**/*.rats"/>
1031    </uptodate>
1032    <echo>Preparser up to date? ${preparser.uptodate}</echo>
1033  </target>
1034
1035  <target name="checkImportCollectorUptodate" depends="init">
1036    <uptodate property="importcollector.uptodate"
1037              targetfile="${importcollector}/ImportCollector.java">
1038      <srcfiles dir="${parser}" includes="**/*.rats"/>
1039      <srcfiles dir="${importcollector}" includes="**/*.rats"/>
1040    </uptodate>
1041    <echo>ImportCollector up to date? ${importcollector.uptodate}</echo>
1042  </target>
1043
1044  <target name="checkTemplateparserUptodate" depends="init">
1045    <uptodate property="templateparser.uptodate"
1046              targetfile="${templateparser}/TemplateParser.java">
1047      <srcfiles dir="${parser}" includes="**/*.rats"/>
1048      <srcfiles dir="${templateparser}" includes="**/*.rats"/>
1049    </uptodate>
1050    <echo>Templateparser up to date? ${templateparser.uptodate}</echo>
1051  </target>
1052
1053  <target name="checkInstrumentedParserUptodate" depends="init">
1054    <uptodate property="instrumentedparser.uptodate"
1055              targetfile="${parser}/FortressInstrumented.java">
1056      <srcfiles dir="${parser}" includes="**/*.rats"/>
1057      <srcfiles dir="${src}/${instrumentationPackage}"
1058                includes="*.java"/>
1059    </uptodate>
1060    <echo>Fortress parser up to date? ${parser.uptodate}</echo>
1061  </target>
1062
1063  <macrodef name="buildparser">
1064    <attribute name="name" />
1065    <attribute name="file" />
1066    <attribute name="dir" />
1067    <sequential>
1068      <echo message="Rebuilding @{name}..."/>
1069      <java fork="yes"
1070            failonerror="yes"
1071            dir="@{dir}"
1072            classname="xtc.parser.Rats"
1073            classpath="${xtc}/xtc.jar">
1074        <arg value="-in"/>
1075        <arg value="${src}"/>
1076        <arg value="@{file}"/>
1077      </java>
1078    </sequential>
1079  </macrodef>
1080
1081  <target name="fortressparser" unless="fortressparser.uptodate"
1082          depends="checkFortressParserUptodate"
1083          description="Fortress Parser">
1084    <buildparser name="Fortress" dir="${parser}" file="Fortress.rats" />
1085  </target>
1086
1087  <target name="preparser" unless="preparser.uptodate"
1088          depends="checkPreparserUptodate"
1089          description="Preparser">
1090    <buildparser name="preparser" dir="${preparser}" file="PreFortress.rats" />
1091  </target>
1092
1093  <target name="importcollector" unless="importcollector.uptodate"
1094          depends="checkImportCollectorUptodate"
1095          description="ImportCollector">
1096    <buildparser name="importcollector" dir="${importcollector}" file="ImportCollector.rats" />
1097  </target>
1098
1099  <target name="templateparser" unless="templateparser.uptodate"
1100          depends="checkTemplateparserUptodate"
1101          description="Templateparser">
1102    <buildparser name="template parser" dir="${templateparser}"
1103                 file="TemplateParser.rats" />
1104  </target>
1105
1106  <target name="instrumentedparser" unless="instrumentedparser.uptodate"
1107          depends="compile, checkInstrumentedParserUptodate"
1108          description="Instrumented Parser">
1109    <java fork="yes"
1110          maxmemory="512m"
1111          failonerror="yes"
1112          classname="${instrumentation.package}.InstrumentedParserGenerator">
1113      <classpath refid="instrumentedparser.classpath"/>
1114      <arg value="${parser}"/> <!-- input dir -->
1115      <arg value="${parser}"/> <!-- output dir for FortressInstrumented.java -->
1116    </java>
1117  </target>
1118
1119  <target name="optimizeParser"
1120          depends="compile"
1121          description="Optimized Parser">
1122    <java fork="yes"
1123          maxmemory="512m"
1124          failonerror="yes"
1125          classname="${instrumentation.package}.OptimizedParserGenerator">
1126      <classpath refid="instrumentedparser.classpath"/>
1127      <arg value="${parser}"/> <!-- input dir -->
1128      <arg value="${parser}"/> <!-- output dir for Fortress.java -->
1129      <arg value="${instrumentation.transient}"/>
1130    </java>
1131    <ant target="compile"/>
1132  </target>
1133
1134  <target name="parser" unless="parser.uptodate"
1135          depends="checkParserUptodate, operatorsGen"
1136          description="Fortress Parser">
1137    <ant target="fortressparser" />
1138    <ant target="preparser" />
1139    <ant target="importcollector" />
1140    <ant target="templateparser" />
1141  </target>
1142
1143  <target name="compileGrammarCoverage" depends="compile, instrumentedparser">
1144    <depend srcdir="${src}"
1145            destdir="${build}"
1146            closure="yes"
1147            cache="${basedir}/.dependencies"/>
1148    <javac
1149        srcdir="${src}"
1150        destdir="${build}"
1151        source="${javaSourceVersion}"
1152        debug="true"
1153        includeantruntime="false"
1154        fork="true"
1155        memorymaximumsize="${junitMem}">
1156      <!-- Uncomment the following line to print unchecked warnings
1157           (here and in the 'compileCommon' target. -->
1158      <!-- <compilerarg value="-Xlint:unchecked"/> -->
1159      <classpath refid="compile.classpath"/>
1160      <include name="${packagePrefix}/parser/FortressInstrumented.java"/>
1161    </javac>
1162  </target>
1163
1164  <target name="grammarCoverage" depends="compileGrammarCoverage">
1165    <java fork="yes"
1166          failonerror="yes"
1167          classname="${instrumentation.package}.Coverage"
1168          output="${instrumentation.outfile}">
1169      <classpath refid="compile.classpath"/>
1170    </java>
1171    <echo message="Wrote grammar coverage report to ${instrumentation.outfile}"/>
1172  </target>
1173
1174  <target name="doc" depends="compileAll">
1175    <javadoc overview="${src}/overview.html" destdir="${docs}" maxmemory="${junitMem}">
1176      <classpath refid="compile.classpath"/>
1177      <packageset dir="${src}">
1178        <include name="**/*"/>
1179      </packageset>
1180      <header><![CDATA[Fortress Interpreter]]></header>
1181      <doctitle><![CDATA[<h1>Fortress Interpreter Source Code</h1>]]></doctitle>
1182      <group title="Evaluator Packages"
1183             packages="com.sun.fortress.interpreter.evaluator.*"/>
1184      <link href="http://junit.org/junit/javadoc/3.8.1/"/>
1185      <link href="http://java.sun.com/j2se/1.5/docs/api/"/>
1186      <link href="http://drjava.org/javadoc/plt/"/>
1187    </javadoc>
1188  </target>
1189
1190  <target name="jar"
1191          depends="compileAll"
1192          description="Package up a Fortress distribution as a self-extracting jar.">
1193    <tstamp>
1194      <format
1195          property="jar.DSTAMP"
1196          timezone="GMT"
1197          pattern="yyyy_MMdd_hhmm"/>
1198    </tstamp>
1199
1200    <!-- Extract Ant jars into build directory to be packaged up.-->
1201    <unjar src="${protofortress}/lib/ant.jar" dest="${build}"/>
1202    <unjar src="${protofortress}/lib/ant-launcher.jar" dest="${build}"/>
1203
1204    <!-- Place anthooks.jar in the protofortress. -->
1205    <copy file="${src}/com/sun/fortress/shell/anthooks.xml"
1206          todir="${protofortress}/bin"/>
1207
1208    <!-- Package up class files as a new shell.jar,
1209         and place them in the protofortress. -->
1210    <jar
1211        destfile="fortress/FORTRESS/lib/shell.jar"
1212        basedir="${build}"
1213        includes="**/*"/>
1214
1215    <!-- Then package up the protofortress and place it
1216         in the build directory (so it can be extracted later). -->
1217    <jar
1218        destfile="${build}/com/sun/fortress/shell/fortress.jar"
1219        basedir="fortress"
1220        includes="**/*" />
1221
1222    <!-- Write timestamp of jar creation to a file for retrieval during
1223         extraction. -->
1224    <echo message="${jar.DSTAMP}" file="${build}/TIMESTAMP"/>
1225
1226    <!-- Finally, package up the build directory into a jar that
1227         extracts the protofortress at a destination site. -->
1228    <jar
1229        destfile="Fortress_${jar.DSTAMP}.jar"
1230        basedir="${build}"
1231        includes="**/*" >
1232      <manifest>
1233        <attribute name="Manifest-Version" value="${jar.DSTAMP}"/>
1234        <attribute name="Created-By" value="Sun Microsystems, Inc."/>
1235        <attribute name="Main-Class" value="com.sun.fortress.shell.Extractor"/>
1236        <section name="common/class1.class">
1237          <attribute name="Sealed" value="false"/>
1238        </section>
1239      </manifest>
1240    </jar>
1241  </target>
1242
1243  <target name="copy.anthooks" depends="init" unless="anthooks.uptodate">
1244    <copy file="${src}/com/sun/fortress/shell/anthooks.xml"
1245          todir="${build}/com/sun/fortress/shell"
1246          overwrite="false"/>
1247  </target>
1248
1249  <target name="installer" depends="compileAll"
1250          description="build a new installer as a jar">
1251    <delete dir="${installerDir}"/>
1252    <mkdir dir="${installerDir}/fortress"/>
1253    <copy todir="${installerDir}/fortress/FORTRESS">
1254      <fileset dir="FORTRESS"/>
1255    </copy>
1256    <copy todir="${installerDir}/fortress/bin">
1257      <fileset dir="bin"/>
1258    </copy>
1259    <copy file="docs/installer/README.txt" todir="${installerDir}/fortress"/>
1260    <tar
1261        destfile="fortress.tar.gz"
1262        basedir="${installerDir}"
1263        longfile="fail"
1264        compression="gzip"
1265        />
1266    <delete dir="${installerDir}"/>
1267  </target>
1268
1269  <target name="createNestedJarUpgrade"
1270          description="wrap up a jar for inclusion in a mock upgrade">
1271    <jar
1272        destfile="jars/fortress_mock_upgrade/java/mock_upgrade.jar"
1273        basedir="jars/nested_jar_upgrade"
1274        includes="**/*"
1275        />
1276  </target>
1277
1278  <target name="createMockUpgrade" depends="createNestedJarUpgrade"
1279          description="build a mock upgrade file for testing selfupgrade">
1280    <jar
1281        destfile="FORTRESS/test/fortress_mock_upgrade.jar"
1282        basedir="jars/fortress_mock_upgrade"
1283        includes="**/*"
1284        />
1285  </target>
1286</project>
Note: See TracBrowser for help on using the browser.