| 
									
										
										
										
											2013-09-27 10:10:38 -05:00
										 |  |  | <project name="OpenRocket" basedir="."> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	<property file="resources/build.properties" /> | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	<property name="src.dir"    	value="${basedir}/src"/>		<!-- Source directory --> | 
					
						
							|  |  |  | 	<property name="src-test.dir"	value="${basedir}/test"/>		<!-- Test directory --> | 
					
						
							|  |  |  | 	<property name="build.dir"   	value="${basedir}/build"/>		<!-- Build directory --> | 
					
						
							|  |  |  | 	<property name="build-test.dir" value="${basedir}/build/test"/>		<!-- Build directory --> | 
					
						
							|  |  |  | 	<property name="lib.dir"     	value="${basedir}/lib"/>		<!-- Library source directory --> | 
					
						
							| 
									
										
										
										
											2013-09-30 11:38:54 -05:00
										 |  |  | 	<property name="libtest.dir"	value="${basedir}/../lib-test"/>		<!-- Library test source directory --> | 
					
						
							|  |  |  | 	<property name="libant.dir"	value="${basedir}/../lib-ant"/>		<!-- Library ant source directory --> | 
					
						
							| 
									
										
										
										
											2013-09-27 10:10:38 -05:00
										 |  |  | 	<property name="tmp.dir"	value="${basedir}/tmp"/>		<!-- Temporary directory --> | 
					
						
							|  |  |  | 	<property name="resources.dir"	value="${basedir}/resources"/>		<!-- Resources directory --> | 
					
						
							|  |  |  | 	<property name="resources-src.dir"	value="${basedir}/resources-src"/> | 
					
						
							|  |  |  |         <property name="core.dir" value="${basedir}/../core"/> | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	<!-- Distribution directory, from which stuff is jar'ed --> | 
					
						
							|  |  |  | 	<property name="classes.dir"    	value="${build.dir}/classes"/>  | 
					
						
							|  |  |  | 	<property name="dist-test.dir"	value="${build.dir}/dist-test"/> | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	<property name="jar.dir"     value="${build.dir}/jar"/>	<!-- Directory for built jar's --> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	<property name="pkgname"     value="${ant.project.name}-${build.version}"/> | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	<property name="jar.file"    value="${jar.dir}/${ant.project.name}.jar"/> | 
					
						
							|  |  |  | 	<property name="dist.bin"    value="${jar.dir}/${pkgname}.jar"/> | 
					
						
							|  |  |  | 	<property name="dist.src"    value="${jar.dir}/${pkgname}-src.zip"/> | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	<!-- The main class of the application --> | 
					
						
							| 
									
										
										
										
											2014-12-21 11:51:18 -07:00
										 |  |  | 	<property name="main-class"  value="net.sf.openrocket.startup.OpenRocket"/> | 
					
						
							| 
									
										
										
										
											2013-09-27 10:10:38 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	<!-- Classpath definitions --> | 
					
						
							|  |  |  | 	<path id="classpath"> | 
					
						
							|  |  |  | 		<fileset dir="${lib.dir}" includes="**/*.jar"/> | 
					
						
							|  |  |  |                 <fileset dir="${core.dir}/build/jar" includes="OpenRocket-Core.jar"/> | 
					
						
							|  |  |  |                 <fileset dir="${core.dir}/lib" includes="**/*.jar"/> | 
					
						
							|  |  |  | 	</path> | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	<path id="test-classpath"> | 
					
						
							|  |  |  | 		<path refid="classpath"/> | 
					
						
							|  |  |  | 		<pathelement location="${resources.dir}"/> | 
					
						
							|  |  |  | 		<pathelement location="${build-test.dir}"/> | 
					
						
							|  |  |  | 		<pathelement location="${classes.dir}"/> | 
					
						
							|  |  |  | 		<pathelement location="${src-test.dir}"/> | 
					
						
							|  |  |  | 		<fileset dir="${libtest.dir}/" includes="*.jar"/> | 
					
						
							| 
									
										
										
										
											2013-09-30 11:38:54 -05:00
										 |  |  | 		<pathelement location="../core/build/test"/> | 
					
						
							| 
									
										
										
										
											2013-09-27 10:10:38 -05:00
										 |  |  | 	</path> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	<path id="run-classpath"> | 
					
						
							|  |  |  | 		<path refid="classpath"/> | 
					
						
							|  |  |  | 		<pathelement location="${resources.dir}"/> | 
					
						
							|  |  |  | 		<pathelement location="${classes.dir}"/> | 
					
						
							|  |  |  | 	</path> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	<!-- Add Ant-contrib tasks so we can use for loop --> | 
					
						
							|  |  |  | 	<taskdef resource="net/sf/antcontrib/antlib.xml"> | 
					
						
							|  |  |  | 		<classpath> | 
					
						
							| 
									
										
										
										
											2013-09-30 11:38:54 -05:00
										 |  |  | 			<pathelement location="${libant.dir}/ant-contrib-1.0b3.jar"/> | 
					
						
							| 
									
										
										
										
											2013-09-27 10:10:38 -05:00
										 |  |  | 		</classpath> | 
					
						
							|  |  |  | 	</taskdef> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	<!-- CLEAN --> | 
					
						
							|  |  |  | 	<target name="clean" description="Removes all build artifacts"> | 
					
						
							|  |  |  | 		<delete dir="${build.dir}"/> | 
					
						
							|  |  |  | 		<delete dir="${tmp.dir}/"/> | 
					
						
							|  |  |  | 	</target> | 
					
						
							|  |  |  | 		 | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	<!-- BUILD --> | 
					
						
							|  |  |  | 	<target name="build"> | 
					
						
							|  |  |  | 		<mkdir dir="${classes.dir}"/> | 
					
						
							|  |  |  | 		<echo level="info">Compiling main classes</echo> | 
					
						
							| 
									
										
										
										
											2020-03-11 20:22:10 -04:00
										 |  |  | 		<javac debug="true" srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath" includeantruntime="false" source="1.8" target="1.8"/> | 
					
						
							| 
									
										
										
										
											2013-09-27 10:10:38 -05:00
										 |  |  | 	</target> | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	<!-- Executible Eclipse-Jar-In-Jar style JAR --> | 
					
						
							|  |  |  | 	<target name="jar" depends="build,serialize-presets" description="Create the OpenRocket executable JAR"> | 
					
						
							|  |  |  | 		<mkdir dir="${jar.dir}" /> | 
					
						
							|  |  |  | 		<jar destfile="${jar.file}" basedir="${classes.dir}"> | 
					
						
							|  |  |  | 			<manifest> | 
					
						
							|  |  |  | 				<attribute name="Main-Class" value="${main-class}" /> | 
					
						
							|  |  |  | 				<attribute name="SplashScreen-Image" value="pix/splashscreen.png" /> | 
					
						
							|  |  |  | 				<attribute name="Classpath-Jars" value="lib/gluegen-rt.jar lib/jogl-all.jar" /> | 
					
						
							|  |  |  | 			</manifest> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			<!-- Include, in the root of the JAR, the resources needed by OR --> | 
					
						
							|  |  |  | 			<fileset dir="${src.dir}/" includes="META-INF/,logback.xml" /> | 
					
						
							|  |  |  | 			<fileset dir="${resources.dir}/" /> | 
					
						
							|  |  |  | 			 | 
					
						
							|  |  |  | 			 | 
					
						
							|  |  |  | 			<!-- Libraries to extract into base JAR --> | 
					
						
							| 
									
										
										
										
											2013-09-30 12:03:15 -05:00
										 |  |  | 			<zipfileset src="${core.dir}/build/jar/OpenRocket-Core.jar" /> | 
					
						
							| 
									
										
										
										
											2013-11-08 20:12:17 -06:00
										 |  |  | 			<zipfileset src="${lib.dir}/miglayout-4.0-swing.jar" /> | 
					
						
							| 
									
										
										
										
											2020-03-06 08:52:20 -05:00
										 |  |  | 			<zipfileset src="${core.dir}/lib/guava-26.0-jre.jar" /> | 
					
						
							| 
									
										
										
										
											2020-04-02 15:56:55 -07:00
										 |  |  | 			<zipfileset src="${core.dir}/lib/guice-4.2.3-no_aop.jar" /> | 
					
						
							| 
									
										
										
										
											2013-09-27 10:10:38 -05:00
										 |  |  | 			<zipfileset src="${core.dir}/lib/aopalliance.jar"/> | 
					
						
							| 
									
										
										
										
											2020-03-07 12:08:08 -05:00
										 |  |  | 			<zipfileset src="${core.dir}/lib/script-api-1.0.jar"/> | 
					
						
							| 
									
										
										
										
											2013-09-27 10:10:38 -05:00
										 |  |  | 			<zipfileset src="${lib.dir}/iText-5.0.2.jar"/> | 
					
						
							| 
									
										
										
										
											2020-03-06 08:52:20 -05:00
										 |  |  | 			<zipfileset src="${core.dir}/lib/istack-commons-runtime.jar"/> | 
					
						
							|  |  |  | 			<zipfileset src="${core.dir}/lib/istack-commons-tools.jar"/> | 
					
						
							|  |  |  | 			<zipfileset src="${core.dir}/lib/javax.activation-api-2.3.1.jar"/> | 
					
						
							| 
									
										
										
										
											2013-09-27 10:10:38 -05:00
										 |  |  | 			<zipfileset src="${core.dir}/lib/javax.inject.jar"/> | 
					
						
							| 
									
										
										
										
											2020-03-06 08:52:20 -05:00
										 |  |  | 			<zipfileset src="${core.dir}/lib/javax.json-1.1.3.jar"/> | 
					
						
							|  |  |  | 			<zipfileset src="${core.dir}/lib/javax.json-api-1.1.3.jar"/> | 
					
						
							|  |  |  | 			<zipfileset src="${core.dir}/lib/jaxb-api.2.3.1.jar"/> | 
					
						
							|  |  |  | 			<zipfileset src="${core.dir}/lib/jaxb-runtime.2.3.1.jar"/> | 
					
						
							| 
									
										
										
										
											2013-09-27 10:10:38 -05:00
										 |  |  | 			<zipfileset src="${lib.dir}/jcommon-1.0.18.jar"/> | 
					
						
							|  |  |  | 			<zipfileset src="${lib.dir}/jfreechart-1.0.15.jar"/> | 
					
						
							| 
									
										
										
										
											2020-03-06 08:52:20 -05:00
										 |  |  | 			<zipfileset src="${core.dir}/lib/opencsv-4.3.2.jar"/> | 
					
						
							|  |  |  | 			<zipfileset src="${core.dir}/lib/annotation-detector-3.0.5.jar"/> | 
					
						
							| 
									
										
										
										
											2020-03-07 20:50:27 -05:00
										 |  |  | 			<zipfileset src="${core.dir}/lib/slf4j-api-1.7.30.jar"/> | 
					
						
							| 
									
										
										
										
											2020-03-06 08:52:20 -05:00
										 |  |  | 			<zipfileset src="${core.dir}/lib/logback-classic-1.2.3.jar"/> | 
					
						
							|  |  |  | 			<zipfileset src="${core.dir}/lib/logback-core-1.2.3.jar"/> | 
					
						
							| 
									
										
										
										
											2014-12-27 20:20:32 +02:00
										 |  |  | 			<zipfileset src="${lib.dir}/rsyntaxtextarea-2.5.6.jar"/> | 
					
						
							| 
									
										
										
										
											2020-03-07 20:50:27 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-09-27 10:10:38 -05:00
										 |  |  | 			<!-- JOGL libraries need to be jar-in-jar --> | 
					
						
							|  |  |  | 			<zipfileset dir="${lib.dir}/jogl" prefix="lib"> | 
					
						
							|  |  |  | 				<include name="*.jar"/> | 
					
						
							|  |  |  | 			</zipfileset> | 
					
						
							|  |  |  | 			 | 
					
						
							|  |  |  | 			<!-- Include metafiles about OR --> | 
					
						
							|  |  |  | 			<fileset dir="${basedir}" includes="LICENSE.TXT README.TXT ChangeLog ReleaseNotes fileformat.txt" /> | 
					
						
							|  |  |  | 		</jar> | 
					
						
							|  |  |  | 	</target> | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	<target name="serialize-presets" depends="build" description="Preprocess the orc preset files into serialized form"> | 
					
						
							|  |  |  | 	    <java classname="net.sf.openrocket.utils.SerializePresets" | 
					
						
							|  |  |  | 	          fork="true" | 
					
						
							|  |  |  | 			  classpathref="run-classpath" | 
					
						
							|  |  |  | 			  failonerror="true"> | 
					
						
							|  |  |  | 	    </java> | 
					
						
							|  |  |  | 	</target> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	<!-- CONVERT vendor csv to ORC files --> | 
					
						
							|  |  |  | 	<macrodef name="build-orc-file"> | 
					
						
							|  |  |  | 		<attribute name="dir"/> | 
					
						
							|  |  |  | 		<attribute name="vendor"/> | 
					
						
							|  |  |  | 		<sequential> | 
					
						
							|  |  |  | 			<echo>Generating ORC file for vendor @{vendor}</echo> | 
					
						
							|  |  |  | 			<java classname="net.sf.openrocket.preset.loader.RocksimComponentFileTranslator" | 
					
						
							|  |  |  | 				fork="true" | 
					
						
							|  |  |  | 				classpathref="run-classpath" | 
					
						
							|  |  |  | 				failonerror="true"> | 
					
						
							|  |  |  | 				<arg value="@{dir}"/> | 
					
						
							|  |  |  | 				<arg value="${resources-src.dir}/datafiles/presets/@{vendor}.orc"/> | 
					
						
							|  |  |  | 			</java> | 
					
						
							|  |  |  | 		</sequential> | 
					
						
							|  |  |  | 	</macrodef> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	<target name="generate-orc-files" | 
					
						
							|  |  |  | 		description="Generate ORC file from vendor csv" | 
					
						
							|  |  |  | 		depends="build"> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		<for param="vendor-dir"> | 
					
						
							|  |  |  | 			<dirset dir="${resources-src.dir}/datafiles/rocksim_components" | 
					
						
							|  |  |  | 				includes="*"/> | 
					
						
							|  |  |  | 			<sequential> | 
					
						
							|  |  |  | 				<propertyregex property="vendor" | 
					
						
							|  |  |  | 					override="true" | 
					
						
							|  |  |  | 					input="@{vendor-dir}" | 
					
						
							|  |  |  | 					select="\1" | 
					
						
							|  |  |  | 					regexp=".*[/\\]([^/\\]*)$"/> | 
					
						
							|  |  |  | 				<build-orc-file dir="@{vendor-dir}" vendor="${vendor}"/> | 
					
						
							|  |  |  | 			</sequential> | 
					
						
							|  |  |  | 		</for> | 
					
						
							|  |  |  | 	</target> | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	<!-- DIST-SRC --> | 
					
						
							|  |  |  | 	<target name="dist-src"> | 
					
						
							|  |  |  | 		<echo>			 | 
					
						
							|  |  |  | 		Building source distribution | 
					
						
							|  |  |  | 		</echo> | 
					
						
							|  |  |  | 		<mkdir dir="${build.dir}/${pkgname}"/> | 
					
						
							|  |  |  | 		<mkdir dir="${jar.dir}"/> | 
					
						
							|  |  |  | 		<copy todir="${build.dir}/${pkgname}"> | 
					
						
							|  |  |  | 			<fileset dir="${basedir}" includes="*" excludes="*.log"> | 
					
						
							|  |  |  | 				<type type="file"/> | 
					
						
							|  |  |  | 			</fileset> | 
					
						
							|  |  |  | 			<fileset dir="${basedir}" includes="resources/ lib/ lib-test/ src/ test/ resources-src/datafiles/"/> | 
					
						
							|  |  |  | 		</copy> | 
					
						
							|  |  |  | 		<zip destfile="${dist.src}" basedir="${build.dir}" includes="${pkgname}/"/> | 
					
						
							|  |  |  | 		<delete dir="${build.dir}/${pkgname}"/> | 
					
						
							|  |  |  | 	</target> | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	<!-- DIST-SRC-TEST --> | 
					
						
							|  |  |  | 	<target name="dist-src-test" depends="dist-src"> | 
					
						
							|  |  |  | 		<echo> | 
					
						
							|  |  |  | 		Testing source distribution | 
					
						
							|  |  |  | 		</echo> | 
					
						
							|  |  |  | 		<delete dir="${dist-test.dir}"/> | 
					
						
							|  |  |  | 		<mkdir dir="${dist-test.dir}"/> | 
					
						
							|  |  |  | 		<unzip dest="${dist-test.dir}" src="${dist.src}"/> | 
					
						
							|  |  |  | 		<ant dir="${dist-test.dir}/${pkgname}" antfile="build.xml" target="jar"/> | 
					
						
							|  |  |  | 		<ant dir="${dist-test.dir}/${pkgname}" antfile="build.xml" target="unittest"/> | 
					
						
							|  |  |  | 		<delete dir="${dist-test.dir}"/> | 
					
						
							|  |  |  | 		<echo> | 
					
						
							|  |  |  | 		Source distribution test successful | 
					
						
							|  |  |  | 		</echo> | 
					
						
							|  |  |  | 	</target>	 | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	<!-- DIST-BIN --> | 
					
						
							|  |  |  | 	<target name="dist-bin" depends="check,clean,unittest,jar"> | 
					
						
							|  |  |  | 		<move file="${jar.file}" tofile="${dist.bin}"/> | 
					
						
							|  |  |  | 	</target> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	<!-- DIST --> | 
					
						
							|  |  |  | 	<target name="dist" depends="dist-bin,dist-src,dist-src-test"> | 
					
						
							|  |  |  | 		<echo>Distribution ${build.version} (${build.source}) built into directory ${jar.dir}</echo> | 
					
						
							|  |  |  | 	</target> | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	<!-- CHECK --> | 
					
						
							|  |  |  | 	<target name="check" depends="checktodo,checkascii"/> | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	<!-- CHECK TODOs --> | 
					
						
							|  |  |  | 	<target name="todo" depends="checktodo"/> | 
					
						
							|  |  |  | 	<target name="checktodo"> | 
					
						
							|  |  |  | 		<tempfile property="todo.file" prefix="checktodo-" destDir="${tmp.dir}"/> | 
					
						
							|  |  |  | 		<echo>Checking project for FIXMEs.</echo> | 
					
						
							|  |  |  | 		<concat destfile="${todo.file}"> | 
					
						
							|  |  |  | 			<fileset dir="${src.dir}"> | 
					
						
							|  |  |  | 			    <include name="**/*.java"/> | 
					
						
							|  |  |  | 			</fileset> | 
					
						
							|  |  |  | 			<fileset dir="${src-test.dir}"> | 
					
						
							|  |  |  | 			    <include name="**/*.java"/> | 
					
						
							|  |  |  | 			</fileset> | 
					
						
							|  |  |  | 			<filterchain> | 
					
						
							|  |  |  | 				<linecontainsregexp> | 
					
						
							|  |  |  | 					<regexp pattern="(FIXME|TODO:.*CRITICAL)"/> | 
					
						
							|  |  |  | 				</linecontainsregexp> | 
					
						
							|  |  |  | 			</filterchain> | 
					
						
							|  |  |  | 		</concat> | 
					
						
							|  |  |  | 		<loadfile srcfile="${todo.file}" property="criticaltodos"/> | 
					
						
							|  |  |  | 		<delete file="${todo.file}"/> | 
					
						
							|  |  |  | 		<fail if="criticaltodos">CRITICAL TODOs exist in project: | 
					
						
							|  |  |  | ${criticaltodos}</fail> | 
					
						
							|  |  |  | 		<echo>No critical TODOs in project.</echo> | 
					
						
							|  |  |  | 	</target> | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	<!-- CHECK ASCII --> | 
					
						
							|  |  |  | 	<target name="ascii" depends="checkascii"/> | 
					
						
							|  |  |  | 	<target name="checkascii"> | 
					
						
							|  |  |  | 		<tempfile property="ascii.file" prefix="checkascii-" destDir="${tmp.dir}"/> | 
					
						
							|  |  |  | 		<echo>Checking project for non-ASCII characters.</echo> | 
					
						
							|  |  |  | 		<concat destfile="${ascii.file}"> | 
					
						
							|  |  |  | 			<fileset dir="${src.dir}"> | 
					
						
							|  |  |  | 			    <include name="**/*.java"/> | 
					
						
							|  |  |  | 			</fileset> | 
					
						
							|  |  |  | 			<fileset dir="${src-test.dir}"> | 
					
						
							|  |  |  | 			    <include name="**/*.java"/> | 
					
						
							|  |  |  | 			</fileset> | 
					
						
							|  |  |  | 			<filterchain> | 
					
						
							|  |  |  | 				<linecontainsregexp> | 
					
						
							|  |  |  | 					<regexp pattern="\P{ASCII}"/> | 
					
						
							|  |  |  | 				</linecontainsregexp> | 
					
						
							|  |  |  | 			</filterchain> | 
					
						
							|  |  |  | 		</concat> | 
					
						
							|  |  |  | 		<loadfile srcfile="${ascii.file}" property="nonascii"/> | 
					
						
							|  |  |  | 		<delete file="${ascii.file}"/> | 
					
						
							|  |  |  | 		<fail if="nonascii">Non-ASCII characters exist in project: | 
					
						
							|  |  |  | ${nonascii}</fail> | 
					
						
							|  |  |  | 		<echo>No non-ASCII characters in project.</echo> | 
					
						
							|  |  |  | 	</target> | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	<!--  Unit tests  --> | 
					
						
							|  |  |  | 	<target name="unittest" description="Execute unit tests" depends="build"> | 
					
						
							|  |  |  | 		<echo>Building unit tests</echo> | 
					
						
							|  |  |  | 		<mkdir dir="${build-test.dir}"/> | 
					
						
							|  |  |  | 		<javac debug="true" srcdir="${src-test.dir}" destdir="${build-test.dir}" classpathref="test-classpath"/> | 
					
						
							|  |  |  | 		 | 
					
						
							|  |  |  | 		<echo>Running unit tests</echo> | 
					
						
							|  |  |  | 		<mkdir dir="${tmp.dir}/rawtestoutput"/> | 
					
						
							|  |  |  | 		<junit fork="yes" forkmode="once" printsummary="false" failureproperty="junit.failure"> | 
					
						
							|  |  |  | 			<classpath> | 
					
						
							|  |  |  | 				<path refid="test-classpath"/> | 
					
						
							|  |  |  | 				<path location="${basedir}"/> | 
					
						
							|  |  |  | 			</classpath> | 
					
						
							|  |  |  | 			<batchtest todir="${tmp.dir}/rawtestoutput"> | 
					
						
							|  |  |  | 				<fileset dir="${build-test.dir}"> | 
					
						
							|  |  |  | 					<include name="**/Test*.class" /> | 
					
						
							|  |  |  | 					<include name="**/*Test.class" /> | 
					
						
							|  |  |  | 					<exclude name="**/*$*.class" /> | 
					
						
							|  |  |  | 					<exclude name="Test.class" /> | 
					
						
							|  |  |  | 				</fileset> | 
					
						
							|  |  |  | 				<formatter type="xml"/> | 
					
						
							| 
									
										
										
										
											2013-10-09 14:35:23 -05:00
										 |  |  | 				<formatter type="plain" usefile="false" /> | 
					
						
							| 
									
										
										
										
											2013-09-27 10:10:38 -05:00
										 |  |  | 			</batchtest> | 
					
						
							|  |  |  | 		</junit> | 
					
						
							|  |  |  | 		<junitreport todir="${tmp.dir}"> | 
					
						
							|  |  |  | 			<fileset dir="${tmp.dir}/rawtestoutput"/> | 
					
						
							|  |  |  | 			<report todir="${tmp.dir}/test-reports"/> | 
					
						
							|  |  |  | 		</junitreport> | 
					
						
							|  |  |  | 		<fail if="junit.failure" message="Unit test(s) failed.  See report in ${tmp.dir}/test-reports/index.html"/> | 
					
						
							|  |  |  | 		<echo> | 
					
						
							|  |  |  | 	Unit tests passed successfully. | 
					
						
							|  |  |  | 		</echo> | 
					
						
							|  |  |  |  	</target> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	<!--  Unit test (show errors in output stream instead of junit report)  --> | 
					
						
							|  |  |  | 	<target name="unittest-no-junit-report" description="Execute unit tests, show report to output stream" depends="build"> | 
					
						
							|  |  |  | 		<echo>Building unit tests</echo> | 
					
						
							|  |  |  | 		<mkdir dir="${build-test.dir}"/> | 
					
						
							|  |  |  | 		<javac debug="true" srcdir="${src-test.dir}" destdir="${build-test.dir}" classpathref="test-classpath"/> | 
					
						
							|  |  |  | 		 | 
					
						
							|  |  |  | 		<echo>Running unit tests</echo> | 
					
						
							|  |  |  | 		<mkdir dir="${tmp.dir}/rawtestoutput"/> | 
					
						
							|  |  |  | 		<junit fork="yes" forkmode="once" printsummary="false" failureproperty="junit.failure"> | 
					
						
							|  |  |  | 			<classpath> | 
					
						
							|  |  |  | 				<path refid="test-classpath"/> | 
					
						
							|  |  |  | 				<path location="${basedir}"/> | 
					
						
							|  |  |  | 			</classpath> | 
					
						
							|  |  |  | 			<batchtest todir="${tmp.dir}/rawtestoutput"> | 
					
						
							|  |  |  | 				<fileset dir="${build-test.dir}"> | 
					
						
							|  |  |  | 					<include name="**/Test*.class" /> | 
					
						
							|  |  |  | 					<include name="**/*Test.class" /> | 
					
						
							|  |  |  | 					<exclude name="**/*$*.class" /> | 
					
						
							|  |  |  | 					<exclude name="Test.class" /> | 
					
						
							|  |  |  | 				</fileset> | 
					
						
							|  |  |  | 				<!-- <formatter type="xml"/> --> | 
					
						
							|  |  |  |                 <formatter type="plain" usefile="false" /> | 
					
						
							|  |  |  | 			</batchtest> | 
					
						
							|  |  |  |             <jvmarg value="-Dlogback.configurationFile=config/logback-stdout-level-error.xml"/> | 
					
						
							|  |  |  | 		</junit> | 
					
						
							|  |  |  | 		<fail if="junit.failure" message="Unit test(s) failed.  See output above for failures."/> | 
					
						
							|  |  |  | 		<echo> | 
					
						
							|  |  |  | 	Unit tests passed successfully. | 
					
						
							|  |  |  | 		</echo> | 
					
						
							|  |  |  |  	</target> | 
					
						
							|  |  |  |      | 
					
						
							|  |  |  |      | 
					
						
							|  |  |  | </project> |