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

Revision 393, 12.9 KB checked in by jdalbey, 7 years ago (diff)

Modify webapp revision numbering files.

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 Server" name="cadserver">
16    <antcall target="run-single">
17       <param name="javac.includes" value="tmcsim/cadsimulator/CADServer.java"/>
18       <param name="run.class" value="tmcsim/cadsimulator/CADServer"/>
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 Server - 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 Server - 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    <!-- Write the version number to a javascript file -->
83    <echo file="${work.dir}/webapps/common/js/revision_number.dat" append="false">
84    var revisionNumber = "${svna.version}";
85    </echo>
86    <echo>Setting SVN version: ${svna.version}</echo>
87</target>
88<target name="-post-jar" description="Sets the buildversion for the current build">
89    <propertyfile file="${src.dir}/tmcsim/application.properties">
90        <entry key="Application.buildnumber" value="1" type="int" operation="+"/>
91    </propertyfile>
92</target>
93<!--
94                =================
95                LOC counter
96                =================
97-->
98<target description="Count Lines of Code in src directory." name="loc">
99        <java classname="textui.LOC"
100              classpath="${workdir}/lib/JavaLOC.jar">
101               <arg line="-r -d ${workdir}/src"/>
102        </java>
103</target>
104<!--
105                =================
106                CHECKSTYLE SECTION
107                =================
108     -->
109<target description="Run checkstyle on src directory." name="checkstyle">
110<taskdef resource="checkstyletask.properties"
111         classpath="${workdir}/lib/customcheckstylechecks.jar;${workdir}/lib/checkstyle-all-4.4.jar"/>
112<checkstyle config="${workdir}/lib/jdstyle.xml" failOnViolation="true">
113            <!-- Specify includes and excludes -->
114            <fileset dir="${workdir}/src/tmcsim" includes="**/*.java"
115            />
116</checkstyle>
117</target>
118<!--
119                =================
120                ZIP for Web-CAT SECTION for CPE 305 assignments
121                =================
122Create a zip file of source to CADSimulator for submission to Web-CAT grader.
123-->
124<target name="webcat-zip" depends="jar">
125
126    <zip destfile="${workdir}/webcatsubmit.zip">
127        <fileset dir="${workdir}/src/">
128                 <include name="tmcsim/cadsimulator/viewer/**/*.java" />
129                 <include name="tmcsim/cadsimulator/viewer/model/**/*.java" />
130                 <include name="tmcsim/cadsimulator/viewer/actions/**/*.java" />
131                 <include name="tmcsim/cadsimulator/videocontrol/**/*.java" />
132                 <exclude name="tmcsim/paramics*/**"/>
133                 <exclude name="tmcsim/simulationmanager/**"/>
134                 <exclude name="tmcsim/cadsimulator/MP3Driver.java"/>
135        </fileset>
136        <!--
137        <fileset dir="${workdir}"  includes="scripts/Cardfile.xml"/>
138        -->
139        <fileset dir="${workdir}/test/">
140                 <include name="tmcsim/cadsimulator/viewer/CADSimulatorViewModelTest.java" />
141        </fileset>
142    </zip>
143</target>
144<!--
145                =================
146                PACKAGE JARS SECTION
147                =================
148-->
149<target description="Build separate jar files for each component of the TMC system."
150        name="package-jars" depends="jar">
151
152    <!--         *** Build a jar with everything ***            -->
153    <property name="deploy.jar.name" value="TMCSimAll"/>
154    <property name="deploy.dir" value="${workdir}/deploy"/>
155    <property name="deploy.jar" value="${deploy.dir}/${deploy.jar.name}.jar"/>
156
157    <echo message="Packaging ${application.title} into a single JAR at ${deploy.jar}"/>
158
159    <delete dir="${deploy.dir}"/>
160    <mkdir dir="${deploy.dir}"/>
161    <tstamp>
162        <format property="TODAY" pattern="yyyy.MM.dd HH:mm" />
163    </tstamp>
164    <jar destfile="${deploy.dir}/temp_final.jar" filesetmanifest="skip">
165        <zipgroupfileset dir="dist" includes="*.jar"/>
166        <!-- zipgroupfileset dir="dist/lib" includes="*.jar"/ -->
167        <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar"/>
168
169        <manifest>
170            <attribute name="Main-Class" value="${main.class}"/>
171        </manifest>
172    </jar>
173
174    <zip destfile="${deploy.jar}">
175        <zipfileset src="${deploy.dir}/temp_final.jar"
176        excludes="META-INF/*.SF, META-INF/*.DSA, META-INF/*.RSA"/>
177    </zip>
178
179    <delete file="${deploy.dir}/temp_final.jar"/>
180
181    <!--                   *** Build CAD Server Only Jar ***         -->
182      <jar destfile="${deploy.dir}/CADserver_r${svna.version}.jar"
183       basedir="${build.dir}/classes"
184       includes="tmcsim/cadsimulator/**, tmcsim/common/**, tmcsim/interfaces/**,
185                 tmcsim/client/cadclientgui/**, tmcsim/cadmodels/**, atmsdriver/model/**,
186                 tmcsim/application.properties"
187       excludes="**/Test.class">
188        <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar,jaco-mp3-player-0.9.3.jar"/>
189        <manifest>
190            <attribute name="Main-Class" value="tmcsim.cadsimulator.CADServer"/>
191        </manifest>
192      </jar>
193
194      <!--                   *** Build Sim Manager Only Jar ***         -->
195      <jar destfile="${deploy.dir}/SimManager_r${svna.version}.jar"
196       basedir="${build.dir}/classes"
197       includes="tmcsim/simulationmanager/**, tmcsim/common/**, tmcsim/cadmodels/**,
198            tmcsim/client/cadclientgui/**, tmcsim/interfaces/**"
199       excludes="**/Test.class">
200        <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar,SimTimeSelector_r28.jar"/>
201        <manifest>
202            <attribute name="Main-Class" value="tmcsim.simulationmanager.SimulationManager"/>
203        </manifest>
204      </jar>
205
206      <!--                   *** Build CAD Client Only Jar ***         -->
207      <jar destfile="${deploy.dir}/CADclient_r${svna.version}.jar"
208       basedir="${build.dir}/classes"
209       includes="tmcsim/client/**, tmcsim/common/**, tmcsim/interfaces/**,
210            tmcsim/cadmodels/**, tmcsim/simulationmanager/model/LogEntryCellRenderer.class">
211      <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar"/>
212        <manifest>
213            <attribute name="Main-Class" value="tmcsim.client.CADClient"/>
214            <attribute name="Implementation-Version" value="${TODAY}"/>
215        </manifest>
216      </jar>
217      <!-- Remove the following line when we get CADClient to run
218      <delete file="${deploy.dir}/CADClient.jar"/>-->
219
220      <!--                   *** Build Clock Client Only Jar ***         -->
221      <jar destfile="${deploy.dir}/ClockClient_r${svna.version}.jar"
222       basedir="${build.dir}/classes"
223       includes="tmcsim/client/ClockClient*.class, tmcsim/client/ClockView.class,
224        tmcsim/interfaces/**, tmcsim/cadmodels/**, tmcsim/common/**, tmcsim/client/**">
225      <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar"/>
226        <manifest>
227            <attribute name="Main-Class" value="tmcsim.client.ClockClient"/>
228            <attribute name="Implementation-Version" value="${TODAY}"/>
229        </manifest>
230      </jar>
231
232      <!--                   *** Build Paramics Communicator Only Jar ***         -->
233      <jar destfile="${deploy.dir}/ParamicsCommunicator.jar"
234       basedir="${build.dir}/classes"
235       includes="tmcsim/paramicscommunicator/**, tmcsim/common/**, tmcsim/interfaces/**,
236                 tmcsim/client/cadclientgui/**, tmcsim/cadmodels/**, tmcsim/paramicslog/**"
237       excludes="**/Test.class">
238        <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar"/>
239        <manifest>
240            <attribute name="Main-Class" value="tmcsim.paramicscommunicator.ParamicsCommunicator"/>
241        </manifest>
242      </jar>
243     
244      <!--                   *** Console Traffic Driver Only Jar ***         -->
245      <jar destfile="${deploy.dir}/ConsoleTrafficDriver.jar"
246       basedir="${build.dir}/classes"
247       includes="atmsdriver/**, atmsdriver.model/**, tmcsim/common/**"
248       excludes="**/Test.class">
249        <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar"/>
250        <manifest>
251            <attribute name="Main-Class" value="atmsdriver/ConsoleTrafficDriver"/>
252        </manifest>
253      </jar>
254      <!--                   *** Traffic Events Animator Only Jar ***         -->
255      <jar destfile="${deploy.dir}/TrafficEventsAnimator.jar"
256       basedir="${build.dir}/classes"
257       includes="atmsdriver/**, atmsdriver/model/**, tmcsim/common/**,
258            tmcsim/cadsimulator/managers/**"
259       excludes="**/Test.class">
260        <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar"/>
261        <manifest>
262            <attribute name="Main-Class" value="atmsdriver/TrafficEventsAnimator"/>
263        </manifest>
264      </jar>
265      <!--                   *** Spike Only Jar ***         -->
266      <jar destfile="${deploy.dir}/ShowUserDir.jar"
267       basedir="${build.dir}/classes"
268       includes="spikes/**"
269       excludes="**/Test.class">
270        <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar"/>
271        <manifest>
272            <attribute name="Main-Class" value="spikes/ShowUserDir"/>
273        </manifest>
274      </jar>
275      <!--  Set Executable --> 
276      <chmod file="${deploy.dir}/ShowUserDir.jar" perm="a+x"/>
277      <chmod file="${deploy.dir}/CADserver_r${svna.version}.jar" perm="a+x"/>
278      <chmod file="${deploy.dir}/SimManager_r${svna.version}.jar" perm="a+x"/>
279</target>
280
281<target description="Build separate jar files for each component of the TMC system."
282        name="ZipForInstall" depends="package-jars">
283    <!-- Notes:    Create a zip file with jars and all external resources for distributing
284    to other machines.
285    Zip the Jar files.
286    Zip folders for config, images, audio, scripts.
287    Write .bat files and .bash files to launch each app.  Put these in root folder.
288    Zip it all up!
289    -->
290</target>
291
292</project>
Note: See TracBrowser for help on using the repository browser.