Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

720 lines (630 sloc) 28.194 kB
<!--
Copyright 2009 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
Author: Kai Huang
Author: Robert Bowdidge
Author: Neil Sanchala
-->
<project name="Soy" basedir="." default="jar">
<property name="java.src.dir" value="${basedir}/java/src" />
<property name="java.tests.dir" value="${basedir}/java/tests" />
<property name="java.lib.dir" value="${basedir}/java/lib" />
<property name="build.dir" value="${basedir}/build" />
<property name="soy.jar.file" value="${build.dir}/soy.jar" />
<property name="build.classes.dir" value="${build.dir}/classes" />
<property name="build.testclasses.dir" value="${build.dir}/tests" />
<property name="build.genfiles.dir" value="${build.dir}/genfiles" />
<property name="includeDebugInfo" value="true" />
<property name="javadoc.lite.dir" value="${basedir}/javadoc-lite" />
<property name="javadoc.complete.dir" value="${basedir}/javadoc-complete" />
<!-- To release a new stable version of soy, update release.stamp to 'latest' or pass
-Drelease.stamp=latest when running ant. -->
<property name="release.dir" value="${basedir}/release" />
<property name="release.stamp" value="unstable" />
<path id="classpath.path">
<fileset dir="${java.lib.dir}">
<include name="*.jar" />
</fileset>
</path>
<!-- Target to delete the generated files. -->
<target name="clean"
description="Deletes generated files.">
<delete dir="${build.dir}" />
</target>
<!-- Target to compile the Java source. -->
<target name="compile"
description="Compiles the Java source.">
<mkdir dir="${build.classes.dir}" />
<mkdir dir="${build.genfiles.dir}" />
<mkdir dir="${build.genfiles.dir}/com/google/template/soy/exprparse" />
<mkdir dir="${build.genfiles.dir}/com/google/template/soy/soyparse" />
<!-- JavaCC compilation. Generated files go into the 'genfiles' directory. -->
<javacc target="${java.src.dir}/com/google/template/soy/exprparse/ExpressionParser.jj"
outputdirectory="${build.genfiles.dir}/com/google/template/soy/exprparse"
javacchome="buildtools/javacc" />
<javacc target = "${java.src.dir}/com/google/template/soy/soyparse/SoyFileParser.jj"
outputdirectory = "${build.genfiles.dir}/com/google/template/soy/soyparse"
javacchome = "buildtools/javacc" />
<javacc target = "${java.src.dir}/com/google/template/soy/soyparse/TemplateParser.jj"
outputdirectory = "${build.genfiles.dir}/com/google/template/soy/soyparse"
javacchome = "buildtools/javacc" />
<!-- Java compilation. -->
<javac srcdir="${java.src.dir}:${build.genfiles.dir}"
destdir="${build.classes.dir}"
source="1.6"
target="1.6"
includeAntRuntime="true"
debug="${includeDebugInfo}">
<classpath refid="classpath.path" />
<compilerarg value="-Werror"/> <!-- warnings become errors -->
<compilerarg value="-Xlint:deprecation"/>
<compilerarg value="-Xlint:-options"/>
</javac>
</target>
<target name="generated-soyutils"
depends="compile"
description="generates soyutils.js and soyutils_usegoog.js.">
<!-- Load a custom ANT task. -->
<taskdef name="gen.escape.directives"
classname="com.google.template.soy.jssrc.internal.GenerateSoyUtilsEscapingDirectiveCode">
<classpath>
<fileset dir="${java.lib.dir}">
<include name="*.jar" />
</fileset>
<pathelement path="${build.classes.dir}" />
</classpath>
</taskdef>
<mkdir dir="${build.dir}/javascript"/>
<gen.escape.directives>
<input path="${basedir}/javascript/soyutils.js"/>
<output path="${build.dir}/javascript/soyutils.js"/>
</gen.escape.directives>
<gen.escape.directives>
<input path="${basedir}/javascript/soyutils_usegoog.js"/>
<output path="${build.dir}/javascript/soyutils_usegoog.js"/>
<jsdefined pattern="goog.string.*"/>
<jsdefined pattern="goog.asserts.*"/>
</gen.escape.directives>
</target>
<!-- Target to create a standalone jar of all Java class files and dependencies. -->
<target name="jar"
depends="compile"
description="Creates a standalone jar of all Java class files and dependencies.">
<jar destfile="${soy.jar.file}" update="true">
<fileset dir="${build.classes.dir}" />
<zipfileset src="${java.lib.dir}/jsr305.jar" />
<zipfileset src="${java.lib.dir}/guava-11.0.2.jar" />
<zipfileset src="${java.lib.dir}/javax.inject.jar" />
<zipfileset src="${java.lib.dir}/aopalliance.jar" />
<zipfileset src="${java.lib.dir}/guice-3.0.jar" />
<zipfileset src="${java.lib.dir}/guice-multibindings-3.0.jar"
excludes="LICENSE,NOTICE" />
<zipfileset src="${java.lib.dir}/guice-assistedinject-3.0.jar"
excludes="LICENSE,NOTICE" />
<zipfileset src="${java.lib.dir}/args4j-2.0.17.jar" />
<zipfileset src="${java.lib.dir}/icu4j-4_8_1_1.jar" />
</jar>
</target>
<!-- Target to create a non-standalone jar of all Java class files, excluding dependencies. -->
<target name="jar-excluding-deps"
depends="compile"
description="Creates a non-standalone jar of all Java class files, excluding dependencies.">
<jar destfile="${build.dir}/soy-excluding-deps.jar" update="true">
<fileset dir="${build.classes.dir}" />
</jar>
</target>
<!-- Target to create a standalone executable SoyToJsSrcCompiler.jar. -->
<target name="SoyToJsSrcCompiler"
depends="jar"
description="Creates a standalone executable SoyToJsSrcCompiler.jar.">
<jar destfile="${build.dir}/SoyToJsSrcCompiler.jar" update="true">
<manifest>
<attribute name="Main-Class" value="com.google.template.soy.SoyToJsSrcCompiler" />
</manifest>
<zipfileset src="${soy.jar.file}" />
</jar>
</target>
<!-- Target to create a standalone executable SoyParseInfoGenerator.jar. -->
<target name="SoyParseInfoGenerator"
depends="jar"
description="Creates a standalone executable SoyParseInfoGenerator.jar.">
<jar destfile="${build.dir}/SoyParseInfoGenerator.jar" update="true">
<manifest>
<attribute name="Main-Class" value="com.google.template.soy.SoyParseInfoGenerator" />
</manifest>
<zipfileset src="${soy.jar.file}" />
</jar>
</target>
<!-- Target to create a standalone executable SoyMsgExtractor.jar. -->
<target name="SoyMsgExtractor"
depends="jar"
description="Creates a standalone executable SoyMsgExtractor.jar.">
<jar destfile="${build.dir}/SoyMsgExtractor.jar" update="true">
<manifest>
<attribute name="Main-Class" value="com.google.template.soy.SoyMsgExtractor" />
</manifest>
<zipfileset src="${soy.jar.file}" />
</jar>
</target>
<!-- Target to create a standalone executable SoyToJavaSrcCompilerExperimental.jar. -->
<target name="SoyToJavaSrcCompilerExperimental"
depends="jar"
description="Creates a standalone executable SoyToJavaSrcCompilerExperimental.jar.">
<jar destfile="${build.dir}/SoyToJavaSrcCompilerExperimental.jar" update="true">
<manifest>
<attribute name="Main-Class" value="com.google.template.soy.SoyToJavaSrcCompilerExperimental" />
</manifest>
<zipfileset src="${soy.jar.file}" />
</jar>
</target>
<!-- Target to generate lite javadoc (for API users). -->
<target name="javadoc-lite"
depends="compile"
description="Generates lite javadoc (for API users).">
<mkdir dir="${javadoc.lite.dir}" />
<javadoc destdir="${javadoc.lite.dir}"
additionalparam="-notimestamp"
author="false"
windowtitle="Soy Lite"
link="http://java.sun.com/javase/6/docs/api/">
<packageset dir="${java.src.dir}">
<include name="com/google/template/soy" />
<include name="com/google/template/soy/data" />
<include name="com/google/template/soy/javasrc" />
<include name="com/google/template/soy/jssrc" />
<include name="com/google/template/soy/msgs" />
<include name="com/google/template/soy/parseinfo" />
<include name="com/google/template/soy/shared" />
<include name="com/google/template/soy/tofu" />
<include name="com/google/template/soy/xliffmsgplugin" />
</packageset>
<fileset dir="${java.src.dir}">
<include name="com/google/template/soy/base/SoySyntaxException.java" />
</fileset>
<classpath>
<pathelement path="${java.src.dir}" />
<pathelement path="${build.genfiles.dir}" />
<fileset dir="${java.lib.dir}">
<include name="*.jar" />
</fileset>
</classpath>
<doctitle>
<![CDATA[
<h1>Closure Templates (a.k.a. Soy)</h1>
<h4>Lite javadoc for API users.</h4>
<h5><a href="../javadoc-complete/index.html" target="_blank">(Go to complete javadoc.)</a></h5>
]]>
</doctitle>
<bottom>
<![CDATA[
<div id="footer">
<div id="footerlogo" style="float:left">
<img src="http://www.google.com/images/art.gif"
alt="Google colored balls">
</div>
<div id="copyright" style="float:left">
<p>
&copy; 2009 Google -
<a href="http://www.google.com/privacy.html">Privacy Policy</a> -
<a href="http://www.google.com/terms_of_service.html">Terms and Conditions</a> -
<a href="http://www.google.com/about.html">About Google</a>
</p>
</div>
</div>
]]>
</bottom>
</javadoc>
</target>
<!-- Target to generate complete javadoc (for developers and plugin writers). -->
<target name="javadoc-complete"
depends="compile"
description="Generates complete javadoc (for developers and plugin writers).">
<mkdir dir="${javadoc.complete.dir}" />
<javadoc sourcepath="${java.src.dir}:${build.genfiles.dir}"
additionalparam="-notimestamp"
destdir="${javadoc.complete.dir}"
author="false"
windowtitle="Soy Complete"
link="http://java.sun.com/javase/6/docs/api/">
<classpath>
<fileset dir="${java.lib.dir}">
<include name="*.jar" />
</fileset>
</classpath>
<doctitle>
<![CDATA[
<h1>Closure Templates (a.k.a. Soy)</h1>
<h4>Complete javadoc for developers and plugin writers.</h4>
<h5><a href="../javadoc-lite/index.html" target="_blank">(Go to lite javadoc.)</a></h5>
]]>
</doctitle>
<bottom>
<![CDATA[
<div id="footer">
<div id="footerlogo" style="float:left">
<img src="http://www.google.com/images/art.gif"
alt="Google colored balls">
</div>
<div id="copyright" style="float:left">
<p>
&copy; 2009 Google -
<a href="http://www.google.com/privacy.html">Privacy Policy</a> -
<a href="http://www.google.com/terms_of_service.html">Terms and Conditions</a> -
<a href="http://www.google.com/about.html">About Google</a>
</p>
</div>
</div>
]]>
</bottom>
</javadoc>
</target>
<!--*******************************************************************************************-->
<!-- Below are targets for the examples. -->
<property name="examples.dir" value="${basedir}/examples" />
<property name="javascript.examples.dir" value="${basedir}/javascript/examples" />
<property name="java.examples.dir" value="${basedir}/java/src/com/google/template/soy/examples" />
<property name="build.examples.dir" value="${build.dir}/examples" />
<!-- Utility macro. Fails if the specified file is not available. -->
<macrodef name="AssertFileExists">
<attribute name="filename" description="Filename to look for." />
<sequential>
<fail>
<condition>
<not>
<available file="@{filename}" />
</not>
</condition>
</fail>
</sequential>
</macrodef>
<!--
Uses SoyToJsSrcCompiler to compile simple.soy.
In 'build/examples', generates the following file:
simple_generated.js
Should be same as the file in 'javascript/examples'.
-->
<target name="js-simple-example"
depends="SoyToJsSrcCompiler"
description="Uses SoyToJsSrcCompiler to compile simple.soy.">
<mkdir dir="${build.examples.dir}" />
<java jar="${build.dir}/SoyToJsSrcCompiler.jar"
fork="true" failonerror="true">
<arg value="--outputPathFormat" />
<arg value="${build.examples.dir}/{INPUT_FILE_NAME_NO_EXT}_generated.js" />
<arg value="${examples.dir}/simple.soy" />
</java>
<AssertFileExists filename="${build.examples.dir}/simple_generated.js" />
</target>
<!--
Uses SoyToJsSrcCompiler to compile simple.soy and features.soy for locales en and x-zz.
In 'build/examples', generates the following files:
simple_generated_en.js
features_generated_en.js
simple_generated_x-zz.js
features_generated_x-zz.js
Should be same as the files in 'javascript/examples'.
-->
<target name="js-features-example"
depends="SoyToJsSrcCompiler"
description="Uses SoyToJsSrcCompiler to compile simple.soy and features.soy for locales en and x-zz.">
<mkdir dir="${build.examples.dir}" />
<java jar="${build.dir}/SoyToJsSrcCompiler.jar"
fork="true" failonerror="true">
<arg value="--outputPathFormat" />
<arg value="${build.examples.dir}/{INPUT_FILE_NAME_NO_EXT}_generated_{LOCALE}.js" />
<arg value="--locales" />
<arg value="en,x-zz" />
<arg value="--messageFilePathFormat" />
<arg value="${examples.dir}/examples_translated_{LOCALE}.xlf" />
<arg value="--compileTimeGlobalsFile" />
<arg value="${javascript.examples.dir}/features-usage_globals.txt" />
<arg value="--inputPrefix" />
<arg value="${examples.dir}/" /> <!-- note the trailing slash -->
<arg value="simple.soy" />
<arg value="features.soy" />
</java>
<AssertFileExists filename="${build.examples.dir}/simple_generated_en.js" />
<AssertFileExists filename="${build.examples.dir}/features_generated_en.js" />
<AssertFileExists filename="${build.examples.dir}/simple_generated_x-zz.js" />
<AssertFileExists filename="${build.examples.dir}/features_generated_x-zz.js" />
</target>
<!--
Creates an executable jar for rendering the simple examples from Java.
In 'build/examples', generates the following file:
SimpleUsage.jar
This can be executed to render the simple examples from Java:
java -jar SimpleUsage.jar
-->
<target name="java-simple-example"
depends="jar"
description="Creates an executable jar for rendering the simple examples from Java.">
<mkdir dir="${build.examples.dir}" />
<jar destfile="${build.examples.dir}/SimpleUsage.jar" update="true">
<manifest>
<attribute name="Main-Class" value="com.google.template.soy.examples.SimpleUsage" />
</manifest>
<zipfileset src="${soy.jar.file}" />
<!-- Resources. -->
<fileset file="${examples.dir}/simple.soy" />
</jar>
<AssertFileExists filename="${build.examples.dir}/SimpleUsage.jar" />
</target>
<!--
Uses SoyParseInfoGenerator to generate parse info for features.soy.
In 'build/examples', generates the following file:
FeaturesSoyInfo.java
Should be same as the file in 'java/src/com/google/template/soy/examples'.
-->
<target name="parse-info-generation-example"
depends="SoyParseInfoGenerator"
description="Uses SoyParseInfoGenerator to generate parse info for features.soy.">
<mkdir dir="${build.examples.dir}" />
<java jar="${build.dir}/SoyParseInfoGenerator.jar"
fork="true" failonerror="true">
<arg value="--outputDirectory" />
<arg value="${build.examples.dir}" />
<arg value="--javaPackage" />
<arg value="com.google.template.soy.examples" />
<arg value="--javaClassNameSource" />
<arg value="filename" />
<arg value="${examples.dir}/features.soy" />
</java>
<AssertFileExists filename="${build.examples.dir}/FeaturesSoyInfo.java" />
</target>
<!--
Creates an executable jar for rendering the features examples from Java.
In 'build/examples', generates the following file:
FeaturesUsage.jar
This can be executed to render the features examples from Java:
java -jar FeaturesUsage.jar
java -jar FeaturesUsage.jar -locale x-zz
-->
<target name="java-features-example"
depends="jar"
description="Creates an executable jar for rendering the features examples from Java.">
<mkdir dir="${build.examples.dir}" />
<jar destfile="${build.examples.dir}/FeaturesUsage.jar" update="true">
<manifest>
<attribute name="Main-Class" value="com.google.template.soy.examples.FeaturesUsage" />
</manifest>
<zipfileset src="${soy.jar.file}" />
<!-- Resources. -->
<fileset file="${examples.dir}/simple.soy" />
<fileset file="${examples.dir}/features.soy" />
<fileset file="${examples.dir}/examples_translated_en.xlf" />
<fileset file="${examples.dir}/examples_translated_x-zz.xlf" />
<fileset file="${java.examples.dir}/FeaturesUsage_globals.txt" />
</jar>
<AssertFileExists filename="${build.examples.dir}/FeaturesUsage.jar" />
</target>
<!--
********************************************************************************************
Below are targets to generate release zip files, and to test that the generated binaries are
sane.
-->
<!--
Uses SoyMsgExtractor to extract messages from simple.soy and features.soy.
In 'build/examples', generates the following file:
examples_extracted.xlf
Should be same as the file in 'examples'.
-->
<target name="msg-extraction-example"
depends="SoyMsgExtractor"
description="Uses SoyMsgExtractor to extract messages from simple.soy and features.soy.">
<mkdir dir="${build.examples.dir}" />
<java jar="${build.dir}/SoyMsgExtractor.jar"
fork="true" failonerror="true">
<arg value="--outputFile" />
<arg value="${build.examples.dir}/examples_extracted.xlf" />
<arg value="--inputPrefix" />
<arg value="${examples.dir}/" /> <!-- note the trailing slash -->
<arg value="simple.soy" />
<arg value="features.soy" />
</java>
<AssertFileExists filename="${build.examples.dir}/examples_extracted.xlf" />
</target>
<!--
Runs the specified jar with no arguments, and asserts that the specified usage message was
printed.
-->
<macrodef name="RunBuiltJarAndLookForExpectedError">
<attribute name="jar" description="The jar to run and test"/>
<attribute name="expectederror" description="The error message to expect"/>
<sequential>
<!-- Run the jar and dump its output to ${@{jar}_output}. -->
<java jar="${build.dir}/@{jar}.jar"
fork="true"
failonerror="false"
errorproperty="@{jar}_output">
</java>
<!-- Look in the output for the error message we expect to see. -->
<fail message="The output of the specified jar does not include the expected error message.
${line.separator}Expected Error Substring : @{expectederror}
${line.separator}Actual Output : ${@{jar}_output}">
<condition>
<not>
<contains string="${@{jar}_output}" substring="@{expectederror}" />
</not>
</condition>
</fail>
</sequential>
</macrodef>
<target name="test-built-jars" depends="SoyToJsSrcCompiler,
SoyParseInfoGenerator,
SoyMsgExtractor">
<RunBuiltJarAndLookForExpectedError
jar="SoyToJsSrcCompiler"
expectederror="Error: Option &quot;--outputPathFormat&quot; is required" />
<RunBuiltJarAndLookForExpectedError
jar="SoyParseInfoGenerator"
expectederror="Error: Option &quot;--javaClassNameSource&quot; is required" />
<RunBuiltJarAndLookForExpectedError
jar="SoyMsgExtractor"
expectederror="Error: Must provide list of Soy files." />
</target>
<!-- Runs a full build, the examples, and test-built-jars to ensure that the build is sane. -->
<target name="verification-tests"
depends="compile,
jar,
jar-excluding-deps,
SoyToJsSrcCompiler,
SoyParseInfoGenerator,
SoyMsgExtractor,
test-built-jars,
js-simple-example,
js-features-example,
java-simple-example,
parse-info-generation-example,
java-features-example,
msg-extraction-example,
test-forkless" />
<!--
Builds a set of zip files containing releaseable bundles of code. These zip files may be uploaded
to the project's Downloads area at Google Code.
-->
<target name="zips-for-release" depends="jar,
jar-excluding-deps,
generated-soyutils,
SoyMsgExtractor,
SoyParseInfoGenerator,
SoyToJsSrcCompiler,
javadoc-lite">
<mkdir dir="${release.dir}" />
<!--
Rename our three README files to README in appropriately-named directories so they can be
pulled in as just "README" in the zip files below.
-->
<copy file="for-java_jar_README.txt" tofile="${build.dir}/java/README" />
<copy file="for-javascript_jar_README.txt" tofile="${build.dir}/javascript/README" />
<copy file="msg-extractor_jar_README.txt" tofile="${build.dir}/msg_extractor/README" />
<!--
Zip file 1: Create a "msg-extractor" zip files.
Mapping:
COPYING ==> ./COPYING
README.msg_extractor ==> ./README
build/SoyMsgExtractor.jar ==> ./SoyMsgExtractor.jar
-->
<zip destfile="${release.dir}/closure-templates-msg-extractor-${release.stamp}.zip">
<fileset file="COPYING" />
<fileset file="${build.dir}/msg_extractor/README" />
<fileset file="${build.dir}/SoyMsgExtractor.jar" />
</zip>
<!-- Rename soy.jar and soy-excluding-deps.jar to to include a ${release.stamp} suffix. -->
<copy file="${build.dir}/soy-excluding-deps.jar"
tofile="${build.dir}/soy-excluding-deps-${release.stamp}.jar" />
<copy file="${build.dir}/soy.jar"
tofile="${build.dir}/soy-${release.stamp}.jar" />
<!--
Zip file 2.1: Make soy-src-${release.stamp}.zip containing all soy src. Note that this gets
stored in the build directory, not the release directory, because this is only released as part
of the for-java zip.
Mapping:
java/src/** ==> ./**
-->
<zip destfile="${build.dir}/soy-src-${release.stamp}.zip"
basedir="java/src" />
<!--
Zip file 2.2: Create "for-java" zip file.
Mapping:
COPYING ==> ./COPYING
README.java ==> ./README
build/soy.jar ==> ./soy-${release.stamp}.jar
build/SoyParseInfoGenerator.jar ==> ./SoyParseInfoGenerator.jar
java/lib/** ==> ./separate-jars/lib/**
javadoc-lite/** ==> ./separate-jars/javadoc/**
build/soy-excluding-deps.jar ==> ./separate-jars/soy-excluding-deps-${release.stamp}.jar
build/soy-src-${release.stamp}.zip ==> ./separate-jars/soy-src-${release.stamp}.zip
-->
<zip destfile="${release.dir}/closure-templates-for-java-${release.stamp}.zip">
<fileset file="COPYING" />
<fileset file="${build.dir}/java/README" />
<fileset file="${build.dir}/SoyParseInfoGenerator.jar" />
<fileset file="${build.dir}/soy-${release.stamp}.jar" />
<zipfileset dir="${build.dir}"
includes="soy-src-${release.stamp}.zip"
prefix="separate-jars" />
<zipfileset dir="${build.dir}"
includes="soy-excluding-deps-${release.stamp}.jar"
prefix="separate-jars" />
<zipfileset dir="java/lib" prefix="separate-jars/lib" />
<zipfileset dir="javadoc-lite" prefix="separate-jars/javadoc" />
</zip>
<!--
Zip file 3: Create "for-javascript" zip file.
Mapping:
COPYING ==> ./COPYING
README.javascript ==> ./README
build/SoyToJsSrcCompiler.jar ==> ./SoyToJsSrcCompiler.jar
build/javascript/*.js ==> ./soyutils{,_usegoog}.js
-->
<zip destfile="${release.dir}/closure-templates-for-javascript-${release.stamp}.zip">
<fileset file="COPYING" />
<fileset file="${build.dir}/javascript/README" />
<fileset file="${build.dir}/SoyToJsSrcCompiler.jar" />
<fileset dir="${build.dir}/javascript" includes="soyutils.js,soyutils_usegoog.js" />
</zip>
</target>
<target name="compile-tests"
depends="compile"
description="Compiles the tests.">
<mkdir dir="${build.testclasses.dir}" />
<javac srcdir="${java.tests.dir}"
destdir="${build.testclasses.dir}"
source="1.6"
target="1.6"
includeAntRuntime="false"
debug="${includeDebugInfo}">
<classpath refid="classpath.path" />
<classpath>
<pathelement location="${build.classes.dir}" />
</classpath>
</javac>
</target>
<macrodef name="testing">
<attribute name="printsummary" default="off" />
<attribute name="fork" default="off" />
<attribute name="forkmode" default="perTest" />
<sequential>
<antcall target="compile-tests" />
<junit printsummary="@{printsummary}"
fork="@{fork}"
forkmode="@{forkmode}"
showoutput="true">
<classpath refid="classpath.path" />
<classpath>
<pathelement location="${build.classes.dir}" />
<pathelement location="${build.testclasses.dir}" />
<!--
Include the test directory on the classpath so that static resources loaded via
Resources.getResource() do not need to be copied to ${build.testclasses.dir}.
-->
<pathelement location="${java.tests.dir}" />
</classpath>
<formatter type="plain" usefile="false" />
<batchtest haltonfailure="true">
<fileset dir="${build.testclasses.dir}">
<include name="**/*Test.class" />
</fileset>
</batchtest>
</junit>
</sequential>
</macrodef>
<target name="test"
description="Runs all of the tests.">
<testing printsummary="on" fork="on" forkmode="once" />
</target>
<target name="test-forkless"
description="Runs all of the tests without forking the process.">
<testing />
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.