root/trunk/ProjectFortress/build.xml @ 3558

Revision 3558, 46.6 KB (checked in by EricAllen, 8 months ago)

Added a cyclic type hierarchy checker.
Fixed ASTGen-generated Scala apply methods to perform explicit casting.
Added an ast() method to TypeConsIndex?.
Added a flag to scalac so that warnings are printed during the build.
Added compiler tests for cyclic hierarchy checking.

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