| 
									
										
										
										
											2013-09-27 10:10:38 -05:00
										 |  |  | <project name="OpenRocket-Core" basedir="."> | 
					
						
							| 
									
										
										
										
											2009-05-31 17:23:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-01-11 03:15:10 +00:00
										 |  |  | 	<property file="resources/build.properties" /> | 
					
						
							| 
									
										
										
										
											2009-06-09 16:56:52 +00:00
										 |  |  | 	 | 
					
						
							| 
									
										
										
										
											2012-12-16 21:05:48 -08:00
										 |  |  | 	<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 --> | 
					
						
							| 
									
										
										
										
											2012-12-16 21:05:48 -08:00
										 |  |  | 	<property name="libextra.dir"	value="${basedir}/lib-extra"/>		<!-- Library extra source directory --> | 
					
						
							|  |  |  | 	<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"/>	<!-- Resources directory --> | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2009-05-31 17:23:49 +00:00
										 |  |  | 	<!-- Distribution directory, from which stuff is jar'ed --> | 
					
						
							| 
									
										
										
										
											2009-09-01 15:25:04 +00:00
										 |  |  | 	<property name="dist.dir"    	value="${build.dir}/dist"/>  | 
					
						
							|  |  |  | 	<property name="dist-test.dir"	value="${build.dir}/dist-test"/> | 
					
						
							| 
									
										
										
										
											2009-05-31 17:23:49 +00:00
										 |  |  | 	 | 
					
						
							|  |  |  | 	<property name="classes.dir" value="${dist.dir}"/>	<!-- Directory for classes --> | 
					
						
							|  |  |  | 	<property name="jar.dir"     value="${build.dir}/jar"/>	<!-- Directory for built jar's --> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-06-09 18:27:33 +00:00
										 |  |  | 	<property name="pkgname"     value="${ant.project.name}-${build.version}"/> | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2009-06-09 16:56:52 +00:00
										 |  |  | 	<property name="jar.file"    value="${jar.dir}/${ant.project.name}.jar"/> | 
					
						
							| 
									
										
										
										
											2009-09-26 17:06:37 +00:00
										 |  |  | 	<!-- Classpath definitions --> | 
					
						
							| 
									
										
										
										
											2009-05-31 17:23:49 +00:00
										 |  |  | 	<path id="classpath"> | 
					
						
							|  |  |  | 		<fileset dir="${lib.dir}" includes="**/*.jar"/> | 
					
						
							|  |  |  | 	</path> | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2009-09-26 17:06:37 +00:00
										 |  |  | 	<path id="test-classpath"> | 
					
						
							|  |  |  | 		<path refid="classpath"/> | 
					
						
							| 
									
										
										
										
											2012-12-16 21:05:48 -08:00
										 |  |  | 		<pathelement location="${resources.dir}"/> | 
					
						
							| 
									
										
										
										
											2009-09-26 17:06:37 +00:00
										 |  |  | 		<pathelement location="${build-test.dir}"/> | 
					
						
							|  |  |  | 		<pathelement location="${classes.dir}"/> | 
					
						
							| 
									
										
										
										
											2010-03-20 13:36:07 +00:00
										 |  |  | 		<pathelement location="${src-test.dir}"/> | 
					
						
							| 
									
										
										
										
											2012-12-16 21:05:48 -08:00
										 |  |  | 		<fileset dir="${libtest.dir}/" includes="*.jar"/> | 
					
						
							| 
									
										
										
										
											2009-09-26 17:06:37 +00:00
										 |  |  | 	</path> | 
					
						
							| 
									
										
										
										
											2012-04-26 21:12:35 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	<path id="run-classpath"> | 
					
						
							|  |  |  | 		<path refid="classpath"/> | 
					
						
							| 
									
										
										
										
											2012-12-16 21:05:48 -08:00
										 |  |  | 		<pathelement location="${resources.dir}"/> | 
					
						
							| 
									
										
										
										
											2012-04-26 21:12:35 +00:00
										 |  |  | 		<pathelement location="${classes.dir}"/> | 
					
						
							|  |  |  | 	</path> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-08-20 15:15:11 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-05-31 17:23:49 +00:00
										 |  |  | 	<!-- CLEAN --> | 
					
						
							| 
									
										
										
										
											2012-04-26 21:12:35 +00:00
										 |  |  | 	<target name="clean" description="Removes all build artifacts"> | 
					
						
							| 
									
										
										
										
											2009-05-31 17:23:49 +00:00
										 |  |  | 		<delete dir="${build.dir}"/> | 
					
						
							| 
									
										
										
										
											2012-12-16 21:05:48 -08:00
										 |  |  | 		<delete dir="${tmp.dir}/"/> | 
					
						
							| 
									
										
										
										
											2009-05-31 17:23:49 +00:00
										 |  |  | 	</target> | 
					
						
							|  |  |  | 		 | 
					
						
							| 
									
										
										
										
											2009-06-09 16:56:52 +00:00
										 |  |  | 	 | 
					
						
							| 
									
										
										
										
											2009-05-31 17:23:49 +00:00
										 |  |  | 	<!-- BUILD --> | 
					
						
							|  |  |  | 	<target name="build"> | 
					
						
							|  |  |  | 		<mkdir dir="${classes.dir}"/> | 
					
						
							| 
									
										
										
										
											2010-07-17 22:52:23 +00:00
										 |  |  | 		<echo level="info">Compiling main classes</echo> | 
					
						
							| 
									
										
										
										
											2018-06-09 20:40:35 -04:00
										 |  |  | 		<javac debug="true" srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath" includeantruntime="false" source="1.8" target="1.8"/> | 
					
						
							| 
									
										
										
										
											2009-05-31 17:23:49 +00:00
										 |  |  | 	</target> | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2012-06-11 20:25:41 +00:00
										 |  |  | 	<!-- Executible Eclipse-Jar-In-Jar style JAR --> | 
					
						
							| 
									
										
										
										
											2016-10-11 16:23:39 -05:00
										 |  |  | 	<target name="jar" depends="build" description="Create the OpenRocket Core"> | 
					
						
							| 
									
										
										
										
											2012-06-11 20:25:41 +00:00
										 |  |  | 		<mkdir dir="${jar.dir}" /> | 
					
						
							| 
									
										
										
										
											2012-10-14 17:51:10 +03:00
										 |  |  | 		<jar destfile="${jar.file}" basedir="${dist.dir}"> | 
					
						
							| 
									
										
										
										
											2012-06-11 20:25:41 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 			<!-- Include, in the root of the JAR, the resources needed by OR --> | 
					
						
							| 
									
										
										
										
											2013-05-10 23:50:35 -05:00
										 |  |  | 			<fileset dir="${src.dir}/" includes="META-INF/,logback.xml" /> | 
					
						
							| 
									
										
										
										
											2012-12-16 21:05:48 -08:00
										 |  |  | 			<fileset dir="${resources.dir}/" /> | 
					
						
							| 
									
										
										
										
											2012-06-11 20:25:41 +00:00
										 |  |  | 			 | 
					
						
							|  |  |  | 			 | 
					
						
							|  |  |  | 			<!-- Include metafiles about OR --> | 
					
						
							| 
									
										
										
										
											2022-02-10 08:59:59 -07:00
										 |  |  | 			<fileset dir="${basedir}/.." includes="LICENSE.TXT README.md ChangeLog ReleaseNotes.md fileformat.txt" /> | 
					
						
							| 
									
										
										
										
											2012-06-11 20:25:41 +00:00
										 |  |  | 		</jar> | 
					
						
							|  |  |  | 	</target> | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2012-12-10 22:44:06 +02:00
										 |  |  | 	<target name="serialize-motors" depends="build" description="Preprocess the motor files into serialized form"> | 
					
						
							| 
									
										
										
										
											2015-12-07 22:27:05 -06:00
										 |  |  | 	    <java classname="net.sf.openrocket.thrustcurve.SerializeThrustcurveMotors" | 
					
						
							| 
									
										
										
										
											2012-10-28 11:26:40 -05:00
										 |  |  | 	          fork="true" | 
					
						
							|  |  |  | 			  classpathref="run-classpath" | 
					
						
							|  |  |  | 			  failonerror="true"> | 
					
						
							| 
									
										
										
										
											2012-12-16 21:05:48 -08:00
										 |  |  | 	    	<arg value="${resources-src.dir}/datafiles/thrustcurves/"/> | 
					
						
							|  |  |  | 	    	<arg value="${resources.dir}/datafiles/thrustcurves/thrustcurves.ser"/> | 
					
						
							| 
									
										
										
										
											2012-10-28 11:26:40 -05:00
										 |  |  | 	    </java> | 
					
						
							|  |  |  | 	</target> | 
					
						
							| 
									
										
										
										
											2012-04-26 21:12:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-09-01 15:25:04 +00:00
										 |  |  | 	 | 
					
						
							|  |  |  | 	<!--  Unit tests  --> | 
					
						
							|  |  |  | 	<target name="unittest" description="Execute unit tests" depends="build"> | 
					
						
							|  |  |  | 		<echo>Building unit tests</echo> | 
					
						
							|  |  |  | 		<mkdir dir="${build-test.dir}"/> | 
					
						
							| 
									
										
										
										
											2017-08-20 15:15:11 -04:00
										 |  |  | 		<javac debug="true" srcdir="${src-test.dir}" destdir="${build-test.dir}" classpathref="test-classpath" includeantruntime="false"/> | 
					
						
							| 
									
										
										
										
											2009-09-01 15:25:04 +00:00
										 |  |  | 		 | 
					
						
							|  |  |  | 		<echo>Running unit tests</echo> | 
					
						
							| 
									
										
										
										
											2012-12-16 21:05:48 -08:00
										 |  |  | 		<mkdir dir="${tmp.dir}/rawtestoutput"/> | 
					
						
							| 
									
										
										
										
											2013-09-30 11:38:54 -05:00
										 |  |  | 		<junit fork="yes" forkmode="once" printsummary="false" failureproperty="junit.failure" dir="${basedir}"> | 
					
						
							| 
									
										
										
										
											2009-09-26 17:06:37 +00:00
										 |  |  | 			<classpath> | 
					
						
							|  |  |  | 				<path refid="test-classpath"/> | 
					
						
							|  |  |  | 				<path location="${basedir}"/> | 
					
						
							|  |  |  | 			</classpath> | 
					
						
							| 
									
										
										
										
											2012-12-16 21:05:48 -08:00
										 |  |  | 			<batchtest todir="${tmp.dir}/rawtestoutput"> | 
					
						
							| 
									
										
										
										
											2009-09-26 17:06:37 +00:00
										 |  |  | 				<fileset dir="${build-test.dir}"> | 
					
						
							| 
									
										
										
										
											2010-03-20 13:36:07 +00:00
										 |  |  | 					<include name="**/Test*.class" /> | 
					
						
							|  |  |  | 					<include name="**/*Test.class" /> | 
					
						
							| 
									
										
										
										
											2009-10-10 13:13:32 +00:00
										 |  |  | 					<exclude name="**/*$*.class" /> | 
					
						
							| 
									
										
										
										
											2009-09-26 17:06:37 +00:00
										 |  |  | 					<exclude name="Test.class" /> | 
					
						
							| 
									
										
										
										
											2009-09-01 15:25:04 +00:00
										 |  |  | 				</fileset> | 
					
						
							|  |  |  | 				<formatter type="xml"/> | 
					
						
							| 
									
										
										
										
											2013-10-09 14:35:23 -05:00
										 |  |  | 				<formatter type="plain" usefile="false" /> | 
					
						
							| 
									
										
										
										
											2009-09-01 15:25:04 +00:00
										 |  |  | 			</batchtest> | 
					
						
							|  |  |  | 		</junit> | 
					
						
							| 
									
										
										
										
											2012-12-16 21:05:48 -08:00
										 |  |  | 		<junitreport todir="${tmp.dir}"> | 
					
						
							|  |  |  | 			<fileset dir="${tmp.dir}/rawtestoutput"/> | 
					
						
							|  |  |  | 			<report todir="${tmp.dir}/test-reports"/> | 
					
						
							| 
									
										
										
										
											2009-09-01 15:25:04 +00:00
										 |  |  | 		</junitreport> | 
					
						
							| 
									
										
										
										
											2012-12-16 21:05:48 -08:00
										 |  |  | 		<fail if="junit.failure" message="Unit test(s) failed.  See report in ${tmp.dir}/test-reports/index.html"/> | 
					
						
							| 
									
										
										
										
											2009-10-10 13:13:32 +00:00
										 |  |  | 		<echo> | 
					
						
							|  |  |  | 	Unit tests passed successfully. | 
					
						
							|  |  |  | 		</echo> | 
					
						
							| 
									
										
										
										
											2009-09-01 15:25:04 +00:00
										 |  |  |  	</target> | 
					
						
							| 
									
										
										
										
											2013-04-24 18:22:27 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	<!--  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> | 
					
						
							| 
									
										
										
										
											2013-06-03 17:55:32 -07:00
										 |  |  |             <jvmarg value="-Dlogback.configurationFile=config/logback-stdout-level-error.xml"/> | 
					
						
							| 
									
										
										
										
											2013-04-24 18:22:27 -07:00
										 |  |  | 		</junit> | 
					
						
							|  |  |  | 		<fail if="junit.failure" message="Unit test(s) failed.  See output above for failures."/> | 
					
						
							|  |  |  | 		<echo> | 
					
						
							|  |  |  | 	Unit tests passed successfully. | 
					
						
							|  |  |  | 		</echo> | 
					
						
							|  |  |  |  	</target> | 
					
						
							|  |  |  |      | 
					
						
							| 
									
										
										
										
											2009-09-01 15:25:04 +00:00
										 |  |  |      | 
					
						
							| 
									
										
										
										
											2012-04-26 21:12:35 +00:00
										 |  |  | </project> |