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

Revision 6, 7.9 KB checked in by jdalbey, 10 years ago (diff)

Multifile commit. Add version # to Paramics Communicator. Move Load button in Sim Mgr. Add several tests. Add package jars target.

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<!--        STORE SUBVERSION BUILD STRING      -->
15<!-- Store the Subversion version string every time you do clean/build. -->
16<target name="-pre-compile">
17  <exec executable="svnversion"
18    output="${workdir}/config/svn-version.txt"/>
19    <echo file="${workdir}/config/svn-version.txt" append="true">
20        # Do not edit. This file is autogenerated by the Ant build script #
21    </echo>
22</target>
23<!--
24                =================
25                LOC counter
26                =================
27-->
28<target description="Count Lines of Code in src directory." name="loc">
29        <java classname="textui.LOC"
30              classpath="${workdir}/lib/JavaLOC.jar">
31               <arg line="-r -d ${workdir}/src"/>
32        </java>   
33</target>   
34<!--
35                =================
36                CHECKSTYLE SECTION
37                =================
38     -->
39<target description="Run checkstyle on src directory." name="checkstyle">
40<taskdef resource="checkstyletask.properties"
41         classpath="${workdir}/lib/customcheckstylechecks.jar;${workdir}/lib/checkstyle-all-4.4.jar"/>
42<checkstyle config="${workdir}/lib/jdstyle.xml" failOnViolation="true">
43            <!-- Specify includes and excludes -->
44            <fileset dir="${workdir}/src/tmcsim" includes="**/*.java"
45            />
46</checkstyle>
47</target>     
48   
49<!--
50                =================
51                PACKAGE JARS SECTION
52                =================
53-->
54<target name="package-jars" depends="jar">
55
56    <!--         *** Build a jar with everything ***            -->
57    <property name="deploy.jar.name" value="TMCSimAll"/>
58    <property name="deploy.dir" value="deploy"/>
59    <property name="deploy.jar" value="${deploy.dir}/${deploy.jar.name}.jar"/>
60
61    <echo message="Packaging ${application.title} into a single JAR at ${deploy.jar}"/>
62
63    <delete dir="${deploy.dir}"/>
64    <mkdir dir="${deploy.dir}"/>
65
66    <jar destfile="${deploy.dir}/temp_final.jar" filesetmanifest="skip">
67        <zipgroupfileset dir="dist" includes="*.jar"/>
68        <!-- zipgroupfileset dir="dist/lib" includes="*.jar"/ -->
69        <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar"/>
70
71        <manifest>
72            <attribute name="Main-Class" value="${main.class}"/>
73        </manifest>
74    </jar>
75
76    <zip destfile="${deploy.jar}">
77        <zipfileset src="${deploy.dir}/temp_final.jar"
78        excludes="META-INF/*.SF, META-INF/*.DSA, META-INF/*.RSA"/>
79    </zip>
80
81    <delete file="${deploy.dir}/temp_final.jar"/>
82
83    <!--                   *** Build CAD Server Only Jar ***         -->
84      <jar destfile="${deploy.dir}/CADserver.jar"
85       basedir="${build.dir}/classes"
86       includes="tmcsim/cadsimulator/**, tmcsim/common/**, tmcsim/interfaces/**,
87                 tmcsim/client/cadclientgui/**, tmcsim/cadmodels/**"
88       excludes="**/Test.class">
89        <manifest>
90            <attribute name="Main-Class" value="tmcsim.cadsimulator.CADSimulator"/>
91        </manifest>
92      </jar>
93
94      <!--                   *** Build Sim Manager Only Jar ***         -->
95      <jar destfile="${deploy.dir}/SimManager.jar"
96       basedir="${build.dir}/classes"
97       includes="tmcsim/simulationmanager/**, tmcsim/common/**, tmcsim/cadmodels/**,
98            tmcsim/client/cadclientgui/**, tmcsim/interfaces/**"
99       excludes="**/Test.class">
100        <manifest>
101            <attribute name="Main-Class" value="tmcsim.simulationmanager.SimulationManager"/>
102        </manifest>
103      </jar>
104
105      <!--                   *** Build CAD Client Only Jar ***         -->
106      <jar destfile="${deploy.dir}/CADClient.jar"
107       basedir="${build.dir}/classes"
108       includes="tmcsim/client/**, tmcsim/common/**, tmcsim/interfaces/**,
109            tmcsim/cadmodels/**">
110        <manifest>
111            <attribute name="Main-Class" value="tmcsim.client.CADClient"/>
112        </manifest>
113      </jar>
114      <!-- Remove the following line when we get CADClient to run
115      <delete file="${deploy.dir}/CADClient.jar"/>-->
116     
117      <!--                   *** Build Paramics Communicator Only Jar ***         -->
118      <jar destfile="${deploy.dir}/ParamicsCommunicator.jar"
119       basedir="${build.dir}/classes"
120       includes="tmcsim/paramicscommunicator/**, tmcsim/common/**"
121       excludes="**/Test.class">
122        <manifest>
123            <attribute name="Main-Class" value="tmcsim.paramicscommunicator.ParamicsCommunicator"/>
124        </manifest>
125      </jar>
126</target>
127    <!--
128
129    There exist several targets which are by default empty and which can be
130    used for execution of your tasks. These targets are usually executed
131    before and after some main targets. They are:
132
133      -pre-init:                 called before initialization of project properties
134      -post-init:                called after initialization of project properties
135      -pre-compile:              called before javac compilation
136      -post-compile:             called after javac compilation
137      -pre-compile-single:       called before javac compilation of single file
138      -post-compile-single:      called after javac compilation of single file
139      -pre-compile-test:         called before javac compilation of JUnit tests
140      -post-compile-test:        called after javac compilation of JUnit tests
141      -pre-compile-test-single:  called before javac compilation of single JUnit test
142      -post-compile-test-single: called after javac compilation of single JUunit test
143      -pre-jar:                  called before JAR building
144      -post-jar:                 called after JAR building
145      -post-clean:               called after cleaning build products
146
147    (Targets beginning with '-' are not intended to be called on their own.)
148
149    Example of inserting an obfuscator after compilation could look like this:
150
151        <target name="-post-compile">
152            <obfuscate>
153                <fileset dir="${build.classes.dir}"/>
154            </obfuscate>
155        </target>
156
157    For list of available properties check the imported
158    nbproject/build-impl.xml file.
159
160
161    Another way to customize the build is by overriding existing main targets.
162    The targets of interest are:
163
164      -init-macrodef-javac:     defines macro for javac compilation
165      -init-macrodef-junit:     defines macro for junit execution
166      -init-macrodef-debug:     defines macro for class debugging
167      -init-macrodef-java:      defines macro for class execution
168      -do-jar-with-manifest:    JAR building (if you are using a manifest)
169      -do-jar-without-manifest: JAR building (if you are not using a manifest)
170      run:                      execution of project
171      -javadoc-build:           Javadoc generation
172      test-report:              JUnit report generation
173
174    An example of overriding the target for project execution could look like this:
175
176        <target name="run" depends="TMCSim-impl.jar">
177            <exec dir="bin" executable="launcher.exe">
178                <arg file="${dist.jar}"/>
179            </exec>
180        </target>
181
182    Notice that the overridden target depends on the jar target and not only on
183    the compile target as the regular run target does. Again, for a list of available
184    properties which you can use, check the target you are overriding in the
185    nbproject/build-impl.xml file.
186
187    -->
188</project>
Note: See TracBrowser for help on using the repository browser.