| 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 | <property name="config.dir" value="../../../config"/> |
|---|
| 15 | <!-- SYSTEM TEST SECTION --> |
|---|
| 16 | <target description="CAD Server" name="cadserver"> |
|---|
| 17 | <antcall target="run-single"> |
|---|
| 18 | <param name="javac.includes" value="tmcsim/cadsimulator/CADServer.java"/> |
|---|
| 19 | <param name="run.class" value="tmcsim/cadsimulator/CADServer"/> |
|---|
| 20 | </antcall> |
|---|
| 21 | </target> |
|---|
| 22 | <target description="Visible System Test of CADSimulator" name="VisibleSystemTest"> |
|---|
| 23 | <antcall target="test-single"> |
|---|
| 24 | <param name="javac.includes" value="tmcsim/cadsimulator/VisibleSystemTest.java"/> |
|---|
| 25 | <param name="test.includes" value="tmcsim/cadsimulator/VisibleSystemTest.java"/> |
|---|
| 26 | </antcall> |
|---|
| 27 | </target> |
|---|
| 28 | <target description="CAD Server - console" name="cadconsole"> |
|---|
| 29 | <java jar="deploy/CADserver.jar" |
|---|
| 30 | fork="true"> |
|---|
| 31 | <classpath> |
|---|
| 32 | <pathelement location="deploy/CADserver.jar"/> |
|---|
| 33 | </classpath> |
|---|
| 34 | </java> |
|---|
| 35 | </target> |
|---|
| 36 | <target description="CAD Server - GUI" name="cadgui"> |
|---|
| 37 | <java jar="deploy/CADserver.jar" |
|---|
| 38 | fork="true"><jvmarg value="-version"/> |
|---|
| 39 | <classpath> |
|---|
| 40 | <pathelement location="deploy/CADserver.jar"/> |
|---|
| 41 | </classpath> |
|---|
| 42 | </java> |
|---|
| 43 | </target> |
|---|
| 44 | <target description="Run Paramics Communicator" name="pcomm"> |
|---|
| 45 | <antcall target="run-single"> |
|---|
| 46 | <param name="javac.includes" value="tmcsim/paramicscommunicator/PComm.java"/> |
|---|
| 47 | <param name="run.class" value="tmcsim/paramicscommunicator/PComm"/> |
|---|
| 48 | </antcall> |
|---|
| 49 | </target> |
|---|
| 50 | <target description="Run Simulation Manager" name="simmgr"> |
|---|
| 51 | <antcall target="run-single"> |
|---|
| 52 | <param name="javac.includes" value="tmcsim/simulationmanager/SimulationManager.java"/> |
|---|
| 53 | <param name="run.class" value="tmcsim/simulationmanager/SimulationManager"/> |
|---|
| 54 | </antcall> |
|---|
| 55 | </target> |
|---|
| 56 | <target description="Emulate Paramics Modeler" name="emulate"> |
|---|
| 57 | <echo file="${workdir}/paramics_status.xml" append="false"> |
|---|
| 58 | <Paramics> <Network_Status>WARMING</Network_Status> <Network_ID>1</Network_ID> </Paramics> |
|---|
| 59 | </echo> |
|---|
| 60 | <sleep seconds="5"/> |
|---|
| 61 | <echo file="${workdir}/paramics_status.xml" append="false"> |
|---|
| 62 | <Paramics> <Network_Status>LOADED</Network_Status> <Network_ID>1</Network_ID> </Paramics> |
|---|
| 63 | </echo> |
|---|
| 64 | </target> |
|---|
| 65 | |
|---|
| 66 | <!-- STORE SUBVERSION BUILD STRING --> |
|---|
| 67 | <target name="-post-init" description="Sets the buildversion for the current build"> |
|---|
| 68 | <exec outputproperty="svna.version" executable="svnversion"> |
|---|
| 69 | <arg value="-c" /> |
|---|
| 70 | <arg value="${workdir}" /> |
|---|
| 71 | <redirector> |
|---|
| 72 | <outputfilterchain> |
|---|
| 73 | <tokenfilter> |
|---|
| 74 | <replaceregex pattern="^[0-9]*:?" replace="" flags="g"/> |
|---|
| 75 | <replaceregex pattern="M" replace="" flags="g"/> |
|---|
| 76 | </tokenfilter> |
|---|
| 77 | </outputfilterchain> |
|---|
| 78 | </redirector> |
|---|
| 79 | </exec> |
|---|
| 80 | <propertyfile file="${src.dir}/tmcsim/application.properties"> |
|---|
| 81 | <entry key="Application.revision" value="${svna.version}" type="int" operation="="/> |
|---|
| 82 | </propertyfile> |
|---|
| 83 | <echo file="${config.dir}/application_properties.cfg" append="false"> |
|---|
| 84 | [Versions] |
|---|
| 85 | revision_number = ${svna.version} |
|---|
| 86 | </echo> |
|---|
| 87 | <!-- Write the version number to a javascript file --> |
|---|
| 88 | <echo file="${work.dir}/webapps/common/js/revision_number.dat" append="false"> |
|---|
| 89 | var revisionNumber = "${svna.version}"; |
|---|
| 90 | </echo> |
|---|
| 91 | <echo>Setting SVN version: ${svna.version}</echo> |
|---|
| 92 | </target> |
|---|
| 93 | <target name="-post-jar" description="Sets the buildversion for the current build"> |
|---|
| 94 | <propertyfile file="${src.dir}/tmcsim/application.properties"> |
|---|
| 95 | <entry key="Application.buildnumber" value="1" type="int" operation="+"/> |
|---|
| 96 | </propertyfile> |
|---|
| 97 | </target> |
|---|
| 98 | <!-- |
|---|
| 99 | ================= |
|---|
| 100 | LOC counter |
|---|
| 101 | ================= |
|---|
| 102 | --> |
|---|
| 103 | <target description="Count Lines of Code in src directory." name="loc"> |
|---|
| 104 | <java classname="textui.LOC" |
|---|
| 105 | classpath="${workdir}/lib/JavaLOC.jar"> |
|---|
| 106 | <arg line="-r -d ${workdir}/src"/> |
|---|
| 107 | </java> |
|---|
| 108 | </target> |
|---|
| 109 | <!-- |
|---|
| 110 | ================= |
|---|
| 111 | CHECKSTYLE SECTION |
|---|
| 112 | ================= |
|---|
| 113 | --> |
|---|
| 114 | <target description="Run checkstyle on src directory." name="checkstyle"> |
|---|
| 115 | <taskdef resource="checkstyletask.properties" |
|---|
| 116 | classpath="${workdir}/lib/customcheckstylechecks.jar;${workdir}/lib/checkstyle-all-4.4.jar"/> |
|---|
| 117 | <checkstyle config="${workdir}/lib/jdstyle.xml" failOnViolation="true"> |
|---|
| 118 | <!-- Specify includes and excludes --> |
|---|
| 119 | <fileset dir="${workdir}/src/tmcsim" includes="**/*.java" |
|---|
| 120 | /> |
|---|
| 121 | </checkstyle> |
|---|
| 122 | </target> |
|---|
| 123 | <!-- |
|---|
| 124 | ================= |
|---|
| 125 | ZIP for Web-CAT SECTION for CPE 305 assignments |
|---|
| 126 | ================= |
|---|
| 127 | Create a zip file of source to CADSimulator for submission to Web-CAT grader. |
|---|
| 128 | --> |
|---|
| 129 | <target name="webcat-zip" depends="jar"> |
|---|
| 130 | |
|---|
| 131 | <zip destfile="${workdir}/webcatsubmit.zip"> |
|---|
| 132 | <fileset dir="${workdir}/src/"> |
|---|
| 133 | <include name="tmcsim/cadsimulator/viewer/**/*.java" /> |
|---|
| 134 | <include name="tmcsim/cadsimulator/viewer/model/**/*.java" /> |
|---|
| 135 | <include name="tmcsim/cadsimulator/viewer/actions/**/*.java" /> |
|---|
| 136 | <include name="tmcsim/cadsimulator/videocontrol/**/*.java" /> |
|---|
| 137 | <exclude name="tmcsim/paramics*/**"/> |
|---|
| 138 | <exclude name="tmcsim/simulationmanager/**"/> |
|---|
| 139 | <exclude name="tmcsim/cadsimulator/MP3Driver.java"/> |
|---|
| 140 | </fileset> |
|---|
| 141 | <!-- |
|---|
| 142 | <fileset dir="${workdir}" includes="scripts/Cardfile.xml"/> |
|---|
| 143 | --> |
|---|
| 144 | <fileset dir="${workdir}/test/"> |
|---|
| 145 | <include name="tmcsim/cadsimulator/viewer/CADSimulatorViewModelTest.java" /> |
|---|
| 146 | </fileset> |
|---|
| 147 | </zip> |
|---|
| 148 | </target> |
|---|
| 149 | <!-- |
|---|
| 150 | ================= |
|---|
| 151 | PACKAGE JARS SECTION |
|---|
| 152 | ================= |
|---|
| 153 | --> |
|---|
| 154 | <target description="Build separate jar files for each component of the TMC system." |
|---|
| 155 | name="package-jars" depends="jar"> |
|---|
| 156 | |
|---|
| 157 | <!-- *** Build a jar with everything *** --> |
|---|
| 158 | <property name="deploy.jar.name" value="TMCSimAll"/> |
|---|
| 159 | <property name="deploy.dir" value="${workdir}/deploy"/> |
|---|
| 160 | <property name="deploy.jar" value="${deploy.dir}/${deploy.jar.name}.jar"/> |
|---|
| 161 | |
|---|
| 162 | <echo message="Packaging ${application.title} components into Jar files in deploy folder."/> |
|---|
| 163 | |
|---|
| 164 | <delete dir="${deploy.dir}"/> |
|---|
| 165 | <mkdir dir="${deploy.dir}"/> |
|---|
| 166 | <tstamp> |
|---|
| 167 | <format property="TODAY" pattern="yyyy.MM.dd HH:mm" /> |
|---|
| 168 | </tstamp> |
|---|
| 169 | <jar destfile="${deploy.dir}/temp_final.jar" filesetmanifest="skip"> |
|---|
| 170 | <zipgroupfileset dir="dist" includes="*.jar"/> |
|---|
| 171 | <!-- zipgroupfileset dir="dist/lib" includes="*.jar"/ --> |
|---|
| 172 | <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar"/> |
|---|
| 173 | |
|---|
| 174 | <manifest> |
|---|
| 175 | <attribute name="Main-Class" value="${main.class}"/> |
|---|
| 176 | </manifest> |
|---|
| 177 | </jar> |
|---|
| 178 | |
|---|
| 179 | <!--zip destfile="${deploy.jar}"> |
|---|
| 180 | <zipfileset src="${deploy.dir}/temp_final.jar" |
|---|
| 181 | excludes="META-INF/*.SF, META-INF/*.DSA, META-INF/*.RSA"/> |
|---|
| 182 | </zip--> |
|---|
| 183 | |
|---|
| 184 | <delete file="${deploy.dir}/temp_final.jar"/> |
|---|
| 185 | |
|---|
| 186 | <!-- *** Build CAD Server Only Jar *** --> |
|---|
| 187 | <jar destfile="${deploy.dir}/CADserver_r${svna.version}.jar" |
|---|
| 188 | basedir="${build.dir}/classes" |
|---|
| 189 | includes="tmcsim/cadsimulator/**, tmcsim/common/**, tmcsim/interfaces/**, |
|---|
| 190 | tmcsim/client/cadclientgui/**, tmcsim/cadmodels/**, atmsdriver/model/**, |
|---|
| 191 | tmcsim/highwaymodel/**, tmcsim/application.properties" |
|---|
| 192 | excludes="**/Test.class"> |
|---|
| 193 | <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar,jaco-mp3-player-0.9.3.jar"/> |
|---|
| 194 | <manifest> |
|---|
| 195 | <attribute name="Main-Class" value="tmcsim.cadsimulator.CADServer"/> |
|---|
| 196 | </manifest> |
|---|
| 197 | </jar> |
|---|
| 198 | |
|---|
| 199 | <!-- *** Build Sim Manager Only Jar *** --> |
|---|
| 200 | <jar destfile="${deploy.dir}/SimManager_r${svna.version}.jar" |
|---|
| 201 | basedir="${build.dir}/classes" |
|---|
| 202 | includes="tmcsim/simulationmanager/**, tmcsim/common/**, tmcsim/cadmodels/**, |
|---|
| 203 | tmcsim/client/cadclientgui/**, tmcsim/interfaces/**, |
|---|
| 204 | tmcsim/application.properties" |
|---|
| 205 | excludes="**/Test.class"> |
|---|
| 206 | <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar,SimTimeSelector_r28.jar"/> |
|---|
| 207 | <manifest> |
|---|
| 208 | <attribute name="Main-Class" value="tmcsim.simulationmanager.SimulationManager"/> |
|---|
| 209 | </manifest> |
|---|
| 210 | </jar> |
|---|
| 211 | |
|---|
| 212 | <!-- *** Build CAD Client Only Jar *** --> |
|---|
| 213 | <jar destfile="${deploy.dir}/CADclient_r${svna.version}.jar" |
|---|
| 214 | basedir="${build.dir}/classes" |
|---|
| 215 | includes="tmcsim/client/**, tmcsim/common/**, tmcsim/interfaces/**, |
|---|
| 216 | tmcsim/cadmodels/**, tmcsim/simulationmanager/model/LogEntryCellRenderer.class, |
|---|
| 217 | tmcsim/application.properties"> |
|---|
| 218 | <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar"/> |
|---|
| 219 | <manifest> |
|---|
| 220 | <attribute name="Main-Class" value="tmcsim.client.CADClient"/> |
|---|
| 221 | <attribute name="Implementation-Version" value="${TODAY}"/> |
|---|
| 222 | </manifest> |
|---|
| 223 | </jar> |
|---|
| 224 | |
|---|
| 225 | <!-- *** Build Clock Client Only Jar *** --> |
|---|
| 226 | <jar destfile="${deploy.dir}/ClockClient_r${svna.version}.jar" |
|---|
| 227 | basedir="${build.dir}/classes" |
|---|
| 228 | includes="tmcsim/client/ClockClient*.class, tmcsim/client/ClockView.class, |
|---|
| 229 | tmcsim/interfaces/**, tmcsim/cadmodels/**, tmcsim/common/**, tmcsim/client/**"> |
|---|
| 230 | <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar"/> |
|---|
| 231 | <manifest> |
|---|
| 232 | <attribute name="Main-Class" value="tmcsim.client.ClockClient"/> |
|---|
| 233 | <attribute name="Implementation-Version" value="${TODAY}"/> |
|---|
| 234 | </manifest> |
|---|
| 235 | </jar> |
|---|
| 236 | |
|---|
| 237 | <!-- *** Traffic Events Animator Only Jar *** --> |
|---|
| 238 | <jar destfile="${deploy.dir}/TrafficEventsAnimator.jar" |
|---|
| 239 | basedir="${build.dir}/classes" |
|---|
| 240 | includes="atmsdriver/**, atmsdriver/model/**, tmcsim/common/**, |
|---|
| 241 | tmcsim/cadsimulator/managers/**" |
|---|
| 242 | excludes="**/Test.class"> |
|---|
| 243 | <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar"/> |
|---|
| 244 | <manifest> |
|---|
| 245 | <attribute name="Main-Class" value="atmsdriver/TrafficEventsAnimator"/> |
|---|
| 246 | </manifest> |
|---|
| 247 | </jar> |
|---|
| 248 | |
|---|
| 249 | <!-- *** Spike Only Jar *** --> |
|---|
| 250 | <jar destfile="${deploy.dir}/ShowUserDir.jar" |
|---|
| 251 | basedir="${build.dir}/classes" |
|---|
| 252 | includes="spikes/**" |
|---|
| 253 | excludes="**/Test.class"> |
|---|
| 254 | <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar"/> |
|---|
| 255 | <manifest> |
|---|
| 256 | <attribute name="Main-Class" value="spikes/ShowUserDir"/> |
|---|
| 257 | </manifest> |
|---|
| 258 | </jar> |
|---|
| 259 | |
|---|
| 260 | <!-- *** Build CAD Data Table Test Only Jar *** --> |
|---|
| 261 | <jar destfile="${deploy.dir}/CADDataTableTest_r${svna.version}.jar" |
|---|
| 262 | basedir="${build.dir}/classes" |
|---|
| 263 | includes="tmcsim/client/CadDataTableTest*.class, |
|---|
| 264 | tmcsim/interfaces/**, tmcsim/cadmodels/**, tmcsim/common/**, tmcsim/client/**"> |
|---|
| 265 | <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar"/> |
|---|
| 266 | <manifest> |
|---|
| 267 | <attribute name="Main-Class" value="tmcsim.client.CadDataTableTest"/> |
|---|
| 268 | <attribute name="Implementation-Version" value="${TODAY}"/> |
|---|
| 269 | </manifest> |
|---|
| 270 | </jar> |
|---|
| 271 | |
|---|
| 272 | <!-- ** Unified Logger Zip file ** --> |
|---|
| 273 | <zip destfile="${deploy.dir}/unifiedlogger.zip" |
|---|
| 274 | basedir="${src.dir}/python/unifiedlogger" |
|---|
| 275 | excludes="**/pyc, **/package.sh, wing_project.wpr"/> |
|---|
| 276 | |
|---|
| 277 | <!-- Set Executable --> |
|---|
| 278 | <chmod file="${deploy.dir}/CADserver_r${svna.version}.jar" perm="a+x"/> |
|---|
| 279 | <chmod file="${deploy.dir}/SimManager_r${svna.version}.jar" perm="a+x"/> |
|---|
| 280 | <chmod file="${deploy.dir}/CADclient_r${svna.version}.jar" perm="a+x"/> |
|---|
| 281 | <chmod file="${deploy.dir}/ClockClient_r${svna.version}.jar" perm="a+x"/> |
|---|
| 282 | <chmod file="${deploy.dir}/TrafficEventsAnimator.jar" perm="a+x"/> |
|---|
| 283 | <chmod file="${deploy.dir}/ShowUserDir.jar" perm="a+x"/> |
|---|
| 284 | <chmod file="${deploy.dir}/unifiedlogger.zip" perm="a+x"/> |
|---|
| 285 | </target> |
|---|
| 286 | |
|---|
| 287 | <target description="Build separate jar files for each component of the TMC system." |
|---|
| 288 | name="ZipForInstall" depends="package-jars"> |
|---|
| 289 | <!-- Notes: Create a zip file with jars and all external resources for distributing |
|---|
| 290 | to other machines. |
|---|
| 291 | Zip the Jar files. |
|---|
| 292 | Zip folders for config, images, audio, scripts. |
|---|
| 293 | Write .bat files and .bash files to launch each app. Put these in root folder. |
|---|
| 294 | Zip it all up! |
|---|
| 295 | --> |
|---|
| 296 | </target> |
|---|
| 297 | |
|---|
| 298 | </project> |
|---|