source: tmcsimulator/trunk/IDE_metadata/NetBeans/TMCSim/build.xml @ 64

Revision 64, 13.7 KB checked in by jdalbey, 9 years ago (diff)

Renamed to ClockClient?, added build target for it.

Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!-- You may freely edit this file. See commented blocks below for -->
3<!-- some examples of how to customize the build. -->
4<!-- (If you delete it and reopen the project it will be recreated.) -->
5<!-- By default, only the Clean and Build commands use this build script. -->
6<!-- Commands such as Run, Debug, and Test only use this build script if -->
7<!-- the Compile on Save feature is turned off for the project. -->
8<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
9<!-- in the project's Project Properties dialog box.-->
10<project name="TMCSim" default="default" basedir=".">
11    <description>Builds, tests, and runs the project TMCSim.</description>
12    <import file="nbproject/build-impl.xml"/>
13    <property name="workdir" value="../../.."/>
14<!--        SYSTEM TEST SECTION      -->
15    <target description="CAD Simulator" name="cadsimulator">
16    <antcall target="run-single">
17       <param name="javac.includes" value="tmcsim/cadsimulator/CADSimulator.java"/>
18       <param name="run.class" value="tmcsim/cadsimulator/CADSimulator"/>
19    </antcall>
20    </target>
21    <target description="Visible System Test of CADSimulator"  name="VisibleSystemTest">
22    <antcall target="test-single">
23       <param name="javac.includes" value="tmcsim/cadsimulator/VisibleSystemTest.java"/>
24       <param name="test.includes" value="tmcsim/cadsimulator/VisibleSystemTest.java"/>
25    </antcall>
26    </target>
27    <target description="CAD Simulator - console" name="cadconsole">
28        <java jar="deploy/CADserver.jar"
29           fork="true">
30         <classpath>
31           <pathelement location="deploy/CADserver.jar"/>
32         </classpath>
33       </java>
34    </target>
35    <target description="CAD Simulator - GUI" name="cadgui">
36        <java jar="deploy/CADserver.jar"
37           fork="true"><jvmarg value="-version"/>
38         <classpath>
39           <pathelement location="deploy/CADserver.jar"/>
40         </classpath>
41       </java>
42    </target>
43    <target description="Run Paramics Communicator" name="pcomm">
44    <antcall target="run-single">
45       <param name="javac.includes" value="tmcsim/paramicscommunicator/PComm.java"/>
46       <param name="run.class" value="tmcsim/paramicscommunicator/PComm"/>
47    </antcall>
48    </target>
49    <target description="Run Simulation Manager" name="simmgr">
50    <antcall target="run-single">
51       <param name="javac.includes" value="tmcsim/simulationmanager/SimulationManager.java"/>
52       <param name="run.class" value="tmcsim/simulationmanager/SimulationManager"/>
53    </antcall>
54    </target>
55    <target description="Emulate Paramics Modeler" name="emulate">
56        <echo file="${workdir}/paramics_status.xml" append="false">
57            &lt;Paramics&gt; &lt;Network_Status&gt;WARMING&lt;/Network_Status&gt; &lt;Network_ID&gt;1&lt;/Network_ID&gt; &lt;/Paramics&gt;
58        </echo>
59        <sleep seconds="5"/>
60        <echo file="${workdir}/paramics_status.xml" append="false">
61            &lt;Paramics&gt; &lt;Network_Status&gt;LOADED&lt;/Network_Status&gt; &lt;Network_ID&gt;1&lt;/Network_ID&gt; &lt;/Paramics&gt;
62        </echo>
63    </target>
64
65<!--        STORE SUBVERSION BUILD STRING      -->
66<target name="-post-init" description="Sets the buildversion for the current build">
67    <exec outputproperty="svna.version" executable="svnversion">
68        <arg value="-c" />
69        <arg value="${workdir}" />
70        <redirector>
71            <outputfilterchain>
72                <tokenfilter>
73                    <replaceregex pattern="^[0-9]*:?" replace="" flags="g"/>
74                    <replaceregex pattern="M" replace="" flags="g"/>
75                </tokenfilter>
76            </outputfilterchain>
77        </redirector>
78    </exec>
79    <propertyfile file="${src.dir}/tmcsim/application.properties">
80        <entry key="Application.revision" value="${svna.version}" type="int" operation="="/>
81    </propertyfile>
82    <echo>Setting SVN version: ${svna.version}</echo>
83</target>
84<target name="-post-jar" description="Sets the buildversion for the current build">
85    <propertyfile file="${src.dir}/tmcsim/application.properties">
86        <entry key="Application.buildnumber" value="1" type="int" operation="+"/>
87    </propertyfile>
88</target>
89<!--
90                =================
91                LOC counter
92                =================
93-->
94<target description="Count Lines of Code in src directory." name="loc">
95        <java classname="textui.LOC"
96              classpath="${workdir}/lib/JavaLOC.jar">
97               <arg line="-r -d ${workdir}/src"/>
98        </java>
99</target>
100<!--
101                =================
102                CHECKSTYLE SECTION
103                =================
104     -->
105<target description="Run checkstyle on src directory." name="checkstyle">
106<taskdef resource="checkstyletask.properties"
107         classpath="${workdir}/lib/customcheckstylechecks.jar;${workdir}/lib/checkstyle-all-4.4.jar"/>
108<checkstyle config="${workdir}/lib/jdstyle.xml" failOnViolation="true">
109            <!-- Specify includes and excludes -->
110            <fileset dir="${workdir}/src/tmcsim" includes="**/*.java"
111            />
112</checkstyle>
113</target>
114<!--
115                =================
116                ZIP for Web-CAT SECTION for CPE 305 assignments
117                =================
118Create a zip file of source to CADSimulator for submission to Web-CAT grader.
119-->
120<target name="webcat-zip" depends="jar">
121
122    <zip destfile="${workdir}/webcatsubmit.zip">
123        <fileset dir="${workdir}/src/">
124                 <include name="tmcsim/cadsimulator/viewer/**/*.java" />
125                 <include name="tmcsim/cadsimulator/viewer/model/**/*.java" />
126                 <include name="tmcsim/cadsimulator/viewer/actions/**/*.java" />
127                 <include name="tmcsim/cadsimulator/videocontrol/**/*.java" />
128                 <exclude name="tmcsim/paramics*/**"/>
129                 <exclude name="tmcsim/simulationmanager/**"/>
130                 <exclude name="tmcsim/cadsimulator/MP3Driver.java"/>
131        </fileset>
132        <!--
133        <fileset dir="${workdir}"  includes="scripts/Cardfile.xml"/>
134        -->
135        <fileset dir="${workdir}/test/">
136                 <include name="tmcsim/cadsimulator/viewer/CADSimulatorViewModelTest.java" />
137        </fileset>
138    </zip>
139</target>
140<!--
141                =================
142                PACKAGE JARS SECTION
143                =================
144-->
145<target description="Build separate jar files for each component of the TMC system."
146        name="package-jars" depends="jar">
147
148    <!--         *** Build a jar with everything ***            -->
149    <property name="deploy.jar.name" value="TMCSimAll"/>
150    <property name="deploy.dir" value="${workdir}/deploy"/>
151    <property name="deploy.jar" value="${deploy.dir}/${deploy.jar.name}.jar"/>
152
153    <echo message="Packaging ${application.title} into a single JAR at ${deploy.jar}"/>
154
155    <delete dir="${deploy.dir}"/>
156    <mkdir dir="${deploy.dir}"/>
157    <tstamp>
158        <format property="TODAY" pattern="yyyy.MM.dd HH:mm" />
159    </tstamp>
160    <jar destfile="${deploy.dir}/temp_final.jar" filesetmanifest="skip">
161        <zipgroupfileset dir="dist" includes="*.jar"/>
162        <!-- zipgroupfileset dir="dist/lib" includes="*.jar"/ -->
163        <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar"/>
164
165        <manifest>
166            <attribute name="Main-Class" value="${main.class}"/>
167        </manifest>
168    </jar>
169
170    <zip destfile="${deploy.jar}">
171        <zipfileset src="${deploy.dir}/temp_final.jar"
172        excludes="META-INF/*.SF, META-INF/*.DSA, META-INF/*.RSA"/>
173    </zip>
174
175    <delete file="${deploy.dir}/temp_final.jar"/>
176
177    <!--                   *** Build CAD Server Only Jar ***         -->
178      <jar destfile="${deploy.dir}/CADserver.jar"
179       basedir="${build.dir}/classes"
180       includes="tmcsim/cadsimulator/**, tmcsim/common/**, tmcsim/interfaces/**,
181                 tmcsim/client/cadclientgui/**, tmcsim/cadmodels/**,
182                 tmcsim/application.properties"
183       excludes="**/Test.class">
184        <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar"/>
185        <manifest>
186            <attribute name="Main-Class" value="tmcsim.cadsimulator.CADSimulator"/>
187        </manifest>
188      </jar>
189
190      <!--                   *** Build Sim Manager Only Jar ***         -->
191      <jar destfile="${deploy.dir}/SimManager.jar"
192       basedir="${build.dir}/classes"
193       includes="tmcsim/simulationmanager/**, tmcsim/common/**, tmcsim/cadmodels/**,
194            tmcsim/client/cadclientgui/**, tmcsim/interfaces/**"
195       excludes="**/Test.class">
196        <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar"/>
197        <manifest>
198            <attribute name="Main-Class" value="tmcsim.simulationmanager.SimulationManager"/>
199        </manifest>
200      </jar>
201
202      <!--                   *** Build CAD Client Only Jar ***         -->
203      <jar destfile="${deploy.dir}/CADClient.jar"
204       basedir="${build.dir}/classes"
205       includes="tmcsim/client/**, tmcsim/common/**, tmcsim/interfaces/**,
206            tmcsim/cadmodels/**, tmcsim/simulationmanager/model/LogEntryCellRenderer.class">
207      <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar"/>
208        <manifest>
209            <attribute name="Main-Class" value="tmcsim.client.CADClient"/>
210            <attribute name="Implementation-Version" value="${TODAY}"/>
211        </manifest>
212      </jar>
213      <!-- Remove the following line when we get CADClient to run
214      <delete file="${deploy.dir}/CADClient.jar"/>-->
215
216      <!--                   *** Build Clock Client Only Jar ***         -->
217      <jar destfile="${deploy.dir}/ClockClient.jar"
218       basedir="${build.dir}/classes"
219       includes="tmcsim/client/ClockClient*.class, tmcsim/client/ClockView.class,
220        tmcsim/interfaces/**, tmcsim/cadmodels/**, tmcsim/common/**, tmcsim/client/**">
221      <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar"/>
222        <manifest>
223            <attribute name="Main-Class" value="tmcsim.client.ClockClient"/>
224            <attribute name="Implementation-Version" value="${TODAY}"/>
225        </manifest>
226      </jar>
227
228      <!--                   *** Build Paramics Communicator Only Jar ***         -->
229      <jar destfile="${deploy.dir}/ParamicsCommunicator.jar"
230       basedir="${build.dir}/classes"
231       includes="tmcsim/paramicscommunicator/**, tmcsim/common/**, tmcsim/interfaces/**,
232                 tmcsim/client/cadclientgui/**, tmcsim/cadmodels/**, tmcsim/paramicslog/**"
233       excludes="**/Test.class">
234        <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar"/>
235        <manifest>
236            <attribute name="Main-Class" value="tmcsim.paramicscommunicator.ParamicsCommunicator"/>
237        </manifest>
238      </jar>
239</target>
240
241<target description="Build separate jar files for each component of the TMC system."
242        name="ZipForInstall" depends="package-jars">
243    <!-- Notes:    Create a zip file with jars and all external resources for distributing
244    to other machines.
245    Zip the Jar files.
246    Zip folders for config, images, audio, scripts.
247    Write .bat files and .bash files to launch each app.  Put these in root folder.
248    Zip it all up!
249    -->
250</target>
251
252    <!--
253
254    There exist several targets which are by default empty and which can be
255    used for execution of your tasks. These targets are usually executed
256    before and after some main targets. They are:
257
258      -pre-init:                 called before initialization of project properties
259      -post-init:                called after initialization of project properties
260      -pre-compile:              called before javac compilation
261      -post-compile:             called after javac compilation
262      -pre-compile-single:       called before javac compilation of single file
263      -post-compile-single:      called after javac compilation of single file
264      -pre-compile-test:         called before javac compilation of JUnit tests
265      -post-compile-test:        called after javac compilation of JUnit tests
266      -pre-compile-test-single:  called before javac compilation of single JUnit test
267      -post-compile-test-single: called after javac compilation of single JUunit test
268      -pre-jar:                  called before JAR building
269      -post-jar:                 called after JAR building
270      -post-clean:               called after cleaning build products
271
272    (Targets beginning with '-' are not intended to be called on their own.)
273
274    Example of inserting an obfuscator after compilation could look like this:
275
276        <target name="-post-compile">
277            <obfuscate>
278                <fileset dir="${build.classes.dir}"/>
279            </obfuscate>
280        </target>
281
282    For list of available properties check the imported
283    nbproject/build-impl.xml file.
284
285
286    Another way to customize the build is by overriding existing main targets.
287    The targets of interest are:
288
289      -init-macrodef-javac:     defines macro for javac compilation
290      -init-macrodef-junit:     defines macro for junit execution
291      -init-macrodef-debug:     defines macro for class debugging
292      -init-macrodef-java:      defines macro for class execution
293      -do-jar-with-manifest:    JAR building (if you are using a manifest)
294      -do-jar-without-manifest: JAR building (if you are not using a manifest)
295      run:                      execution of project
296      -javadoc-build:           Javadoc generation
297      test-report:              JUnit report generation
298
299    An example of overriding the target for project execution could look like this:
300
301        <target name="run" depends="TMCSim-impl.jar">
302            <exec dir="bin" executable="launcher.exe">
303                <arg file="${dist.jar}"/>
304            </exec>
305        </target>
306
307    Notice that the overridden target depends on the jar target and not only on
308    the compile target as the regular run target does. Again, for a list of available
309    properties which you can use, check the target you are overriding in the
310    nbproject/build-impl.xml file.
311
312    -->
313</project>
Note: See TracBrowser for help on using the repository browser.