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

Revision 12, 8.3 KB checked in by jdalbey, 10 years ago (diff)

Fix package-jars target to include xerces jar

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 description="Build separate jar files for each component of the TMC system." 
55        name="package-jars" depends="jar">
56
57    <!--         *** Build a jar with everything ***            -->
58    <property name="deploy.jar.name" value="TMCSimAll"/>
59    <property name="deploy.dir" value="deploy"/>
60    <property name="deploy.jar" value="${deploy.dir}/${deploy.jar.name}.jar"/>
61
62    <echo message="Packaging ${application.title} into a single JAR at ${deploy.jar}"/>
63
64    <delete dir="${deploy.dir}"/>
65    <mkdir dir="${deploy.dir}"/>
66
67    <jar destfile="${deploy.dir}/temp_final.jar" filesetmanifest="skip">
68        <zipgroupfileset dir="dist" includes="*.jar"/>
69        <!-- zipgroupfileset dir="dist/lib" includes="*.jar"/ -->
70        <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar"/>
71
72        <manifest>
73            <attribute name="Main-Class" value="${main.class}"/>
74        </manifest>
75    </jar>
76
77    <zip destfile="${deploy.jar}">
78        <zipfileset src="${deploy.dir}/temp_final.jar"
79        excludes="META-INF/*.SF, META-INF/*.DSA, META-INF/*.RSA"/>
80    </zip>
81
82    <delete file="${deploy.dir}/temp_final.jar"/>
83
84    <!--                   *** Build CAD Server Only Jar ***         -->
85      <jar destfile="${deploy.dir}/CADserver.jar"
86       basedir="${build.dir}/classes"
87       includes="tmcsim/cadsimulator/**, tmcsim/common/**, tmcsim/interfaces/**,
88                 tmcsim/client/cadclientgui/**, tmcsim/cadmodels/**"
89       excludes="**/Test.class">
90        <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar"/>
91        <manifest>
92            <attribute name="Main-Class" value="tmcsim.cadsimulator.CADSimulator"/>
93        </manifest>
94      </jar>
95
96      <!--                   *** Build Sim Manager Only Jar ***         -->
97      <jar destfile="${deploy.dir}/SimManager.jar"
98       basedir="${build.dir}/classes"
99       includes="tmcsim/simulationmanager/**, tmcsim/common/**, tmcsim/cadmodels/**,
100            tmcsim/client/cadclientgui/**, tmcsim/interfaces/**"
101       excludes="**/Test.class">
102        <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar"/>
103        <manifest>
104            <attribute name="Main-Class" value="tmcsim.simulationmanager.SimulationManager"/>
105        </manifest>
106      </jar>
107
108      <!--                   *** Build CAD Client Only Jar ***         -->
109      <jar destfile="${deploy.dir}/CADClient.jar"
110       basedir="${build.dir}/classes"
111       includes="tmcsim/client/**, tmcsim/common/**, tmcsim/interfaces/**,
112            tmcsim/cadmodels/**">
113        <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar"/>
114        <manifest>
115            <attribute name="Main-Class" value="tmcsim.client.CADClient"/>
116        </manifest>
117      </jar>
118      <!-- Remove the following line when we get CADClient to run
119      <delete file="${deploy.dir}/CADClient.jar"/>-->
120     
121      <!--                   *** Build Paramics Communicator Only Jar ***         -->
122      <jar destfile="${deploy.dir}/ParamicsCommunicator.jar"
123       basedir="${build.dir}/classes"
124       includes="tmcsim/paramicscommunicator/**, tmcsim/common/**"
125       excludes="**/Test.class">
126        <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar"/>
127        <manifest>
128            <attribute name="Main-Class" value="tmcsim.paramicscommunicator.ParamicsCommunicator"/>
129        </manifest>
130      </jar>
131</target>
132    <!--
133
134    There exist several targets which are by default empty and which can be
135    used for execution of your tasks. These targets are usually executed
136    before and after some main targets. They are:
137
138      -pre-init:                 called before initialization of project properties
139      -post-init:                called after initialization of project properties
140      -pre-compile:              called before javac compilation
141      -post-compile:             called after javac compilation
142      -pre-compile-single:       called before javac compilation of single file
143      -post-compile-single:      called after javac compilation of single file
144      -pre-compile-test:         called before javac compilation of JUnit tests
145      -post-compile-test:        called after javac compilation of JUnit tests
146      -pre-compile-test-single:  called before javac compilation of single JUnit test
147      -post-compile-test-single: called after javac compilation of single JUunit test
148      -pre-jar:                  called before JAR building
149      -post-jar:                 called after JAR building
150      -post-clean:               called after cleaning build products
151
152    (Targets beginning with '-' are not intended to be called on their own.)
153
154    Example of inserting an obfuscator after compilation could look like this:
155
156        <target name="-post-compile">
157            <obfuscate>
158                <fileset dir="${build.classes.dir}"/>
159            </obfuscate>
160        </target>
161
162    For list of available properties check the imported
163    nbproject/build-impl.xml file.
164
165
166    Another way to customize the build is by overriding existing main targets.
167    The targets of interest are:
168
169      -init-macrodef-javac:     defines macro for javac compilation
170      -init-macrodef-junit:     defines macro for junit execution
171      -init-macrodef-debug:     defines macro for class debugging
172      -init-macrodef-java:      defines macro for class execution
173      -do-jar-with-manifest:    JAR building (if you are using a manifest)
174      -do-jar-without-manifest: JAR building (if you are not using a manifest)
175      run:                      execution of project
176      -javadoc-build:           Javadoc generation
177      test-report:              JUnit report generation
178
179    An example of overriding the target for project execution could look like this:
180
181        <target name="run" depends="TMCSim-impl.jar">
182            <exec dir="bin" executable="launcher.exe">
183                <arg file="${dist.jar}"/>
184            </exec>
185        </target>
186
187    Notice that the overridden target depends on the jar target and not only on
188    the compile target as the regular run target does. Again, for a list of available
189    properties which you can use, check the target you are overriding in the
190    nbproject/build-impl.xml file.
191
192    -->
193</project>
Note: See TracBrowser for help on using the repository browser.