3 <project name="MotorSim" basedir=".">
4 <property name="name" value="MotorSim" />
6 <property name="findbugs.root" value="C:\src\Libs\findbugs-1.3.9" />
8 <property name="core.src.dir" value="src" />
9 <property name="test.src.dir" value="test" />
10 <property name="gui.src.dir" value="test" />
12 <property name="core.build.dir" value=".classes" />
13 <property name="test.build.dir" value=".tests" />
14 <property name="gui.build.dir" value=".tests" />
16 <property name="dist.dir" value="dist" />
17 <property name="temp.dir" value=".temp" />
19 <path id="findbugs.classpath">
20 <fileset dir="${findbugs.root}/lib">
21 <include name="*.jar" />
25 <path id="core.classpath">
27 <include name="*.jar" />
31 <path id="gui.classpath">
33 <include name="*.jar" />
36 <include name="*.jar" />
40 <path id="test.classpath">
41 <path refid="core.classpath" />
42 <path refid="gui.classpath" />
43 <fileset dir="${dist.dir}">
44 <include name="*.jar" />
48 <target name="clean" description="Clean output dirs (build, docs, dist)">
49 <delete dir="${core.build.dir}" />
50 <delete dir="${gui.build.dir}" />
51 <delete dir="${test.build.dir}" />
52 <delete dir="${dist.dir}" />
53 <delete dir="${temp.dir}" />
54 <delete file="${name}-findbugs.xml" />
55 <delete file="TEST-UnitTests.xml" />
58 <target name="core.build" description="Compile main source tree java files into class files.">
59 <mkdir dir="${core.build.dir}" />
60 <javac destdir="${core.build.dir}" source="1.5" target="1.5" debug="true" deprecation="false" optimize="false" failonerror="true">
61 <src path="${core.src.dir}" />
62 <classpath refid="core.classpath" />
66 <target name="gui.build" depends='core.jarfile' description="Compile main source tree java files into class files.">
67 <mkdir dir="${gui.build.dir}" />
68 <javac destdir="${gui.build.dir}" source="1.5" target="1.5" debug="true" deprecation="false" optimize="false" failonerror="true">
69 <src path="${gui.src.dir}" />
70 <classpath refid="gui.classpath" />
75 <target name="core.jarfile" depends="core.build" description="Build the jar file">
76 <mkdir dir="${dist.dir}" />
77 <jar jarfile="${dist.dir}/${name}-API.jar" compress="true" basedir="${cure.build.dir}" />
80 <target name="gui.jarfile" depends="gui.build" description="Build the jar file">
81 <mkdir dir="${dist.dir}" />
82 <jar jarfile="${dist.dir}/${name}-API.jar" compress="true" basedir="${cure.build.dir}" />
87 <taskdef resource="net/sf/antcontrib/antcontrib.properties">
90 <include name="*.jar" />
95 <target name="dist" depends="Fat-Jar">
97 <fileset dir="${dist.dir}/installers" includes="*"/>
99 <mkdir dir="${dist.dir}" />
100 <mkdir dir="${dist.dir}/installers" />
103 <ant dir="RPM" target="dist" inheritAll='false' />
104 <ant target="One-Jar"/>
107 <ant dir="MSI" target="dist" inheritAll='false' />
109 <catch><echo>Skipping MSI</echo></catch>
116 <taskdef name="one-jar" classname="com.simontuffs.onejar.ant.OneJarTask">
119 <include name="*.jar" />
123 <target name='One-Jar' depends='jarfile-main, jarfile-api'>
\r
124 <property file=".classes/MarProbe.version.properties" />
125 <property name="destfilename" value="${name}-${version}.jar"/>
126 <one-jar destfile="${dist.dir}/installers/${destfilename}" manifest="manifest.mf">
128 <fileset dir="${src.dir}">
129 <include name="log4j.properties" />
130 <include name="martello.pem" />
131 <include name="MartelloKey.der" />
135 <fileset dir="${dist.dir}">
136 <include name="${name}.jar" />
137 <include name="${name}-API.jar" />
139 <fileset dir="lib/build">
140 <include name="*.jar" />
142 <fileset dir="lib/runtime">
143 <include name="*.jar" />
146 <fileset dir="${build.dir}">
147 <include name="com/martellotech/Diagnostic*.class" />
153 <target name="Fat-Jar" depends="jarfile-main, jarfile-api">
154 <delete dir="${temp.dir}" quiet="true" />
155 <unjar dest="${temp.dir}">
156 <fileset dir="lib/build">
157 <include name="**/*.jar" />
159 <fileset dir="lib/runtime">
160 <include name="**/*.jar" />
163 <unjar dest="${temp.dir}">
164 <fileset dir="lib/build">
165 <include name="**/Martello-*.jar" />
167 <fileset dir="lib/runtime">
168 <include name="**/Martello-*.jar" />
171 <unjar dest="${temp.dir}">
172 <fileset dir="${dist.dir}">
173 <include name="${name}.jar" />
174 <include name="${name}-API.jar" />
177 <delete dir='${temp.dir}/META-INF'/>
178 <jar jarfile="${dist.dir}/${name}-Fat.jar" basedir="${temp.dir}" includes="**/*.*" update="false" compress="true">
179 <fileset dir="${src.dir}">
180 <include name="log4j.properties" />
181 <include name="martello.pem" />
182 <include name="MartelloKey.der" />
189 <target name="findbugs" depends="jarfile-main, jarfile-api">
191 <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="findbugs.classpath" />
193 <findbugs home="${findbugs.root}" output="xml" outputFile="${name}-findbugs.xml">
194 <auxClasspath refid="test-classpath" />
195 <sourcePath path="${src.dir}" />
196 <class location="${dist.dir}/${name}.jar" />
201 <target name="test" depends="dist">
202 <mkdir dir="${test.build.dir}" />
203 <javac destdir="${test.build.dir}" source="1.5" target="1.5" debug="true" deprecation="false" optimize="false" failonerror="true">
204 <src path="${test.src.dir}" />
205 <classpath refid="test-classpath" />
207 <copy todir="${test.build.dir}">
208 <fileset dir="${test.src.dir}">
209 <include name="**/*.xml" />
210 <include name="**/*.properties" />
213 <mkdir dir="${dist.dir}" />
214 <jar jarfile="${dist.dir}/${name}-tests.jar" compress="true" basedir="${test.build.dir}" />
215 <junit printsummary="yes" fork="yes" haltonfailure="no" haltonerror="false" showoutput="yes">
218 <classpath refid="test-classpath" />
221 <formatter type="xml" />
224 <test name="UnitTests" />