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