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

Revision 7, 8.0 KB checked in by jdalbey, 10 years ago (diff)

build.xml Add description field to 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 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        <manifest>
91            <attribute name="Main-Class" value="tmcsim.cadsimulator.CADSimulator"/>
92        </manifest>
93      </jar>
94
95      <!--                   *** Build Sim Manager Only Jar ***         -->
96      <jar destfile="${deploy.dir}/SimManager.jar"
97       basedir="${build.dir}/classes"
98       includes="tmcsim/simulationmanager/**, tmcsim/common/**, tmcsim/cadmodels/**,
99            tmcsim/client/cadclientgui/**, tmcsim/interfaces/**"
100       excludes="**/Test.class">
101        <manifest>
102            <attribute name="Main-Class" value="tmcsim.simulationmanager.SimulationManager"/>
103        </manifest>
104      </jar>
105
106      <!--                   *** Build CAD Client Only Jar ***         -->
107      <jar destfile="${deploy.dir}/CADClient.jar"
108       basedir="${build.dir}/classes"
109       includes="tmcsim/client/**, tmcsim/common/**, tmcsim/interfaces/**,
110            tmcsim/cadmodels/**">
111        <manifest>
112            <attribute name="Main-Class" value="tmcsim.client.CADClient"/>
113        </manifest>
114      </jar>
115      <!-- Remove the following line when we get CADClient to run
116      <delete file="${deploy.dir}/CADClient.jar"/>-->
117     
118      <!--                   *** Build Paramics Communicator Only Jar ***         -->
119      <jar destfile="${deploy.dir}/ParamicsCommunicator.jar"
120       basedir="${build.dir}/classes"
121       includes="tmcsim/paramicscommunicator/**, tmcsim/common/**"
122       excludes="**/Test.class">
123        <manifest>
124            <attribute name="Main-Class" value="tmcsim.paramicscommunicator.ParamicsCommunicator"/>
125        </manifest>
126      </jar>
127</target>
128    <!--
129
130    There exist several targets which are by default empty and which can be
131    used for execution of your tasks. These targets are usually executed
132    before and after some main targets. They are:
133
134      -pre-init:                 called before initialization of project properties
135      -post-init:                called after initialization of project properties
136      -pre-compile:              called before javac compilation
137      -post-compile:             called after javac compilation
138      -pre-compile-single:       called before javac compilation of single file
139      -post-compile-single:      called after javac compilation of single file
140      -pre-compile-test:         called before javac compilation of JUnit tests
141      -post-compile-test:        called after javac compilation of JUnit tests
142      -pre-compile-test-single:  called before javac compilation of single JUnit test
143      -post-compile-test-single: called after javac compilation of single JUunit test
144      -pre-jar:                  called before JAR building
145      -post-jar:                 called after JAR building
146      -post-clean:               called after cleaning build products
147
148    (Targets beginning with '-' are not intended to be called on their own.)
149
150    Example of inserting an obfuscator after compilation could look like this:
151
152        <target name="-post-compile">
153            <obfuscate>
154                <fileset dir="${build.classes.dir}"/>
155            </obfuscate>
156        </target>
157
158    For list of available properties check the imported
159    nbproject/build-impl.xml file.
160
161
162    Another way to customize the build is by overriding existing main targets.
163    The targets of interest are:
164
165      -init-macrodef-javac:     defines macro for javac compilation
166      -init-macrodef-junit:     defines macro for junit execution
167      -init-macrodef-debug:     defines macro for class debugging
168      -init-macrodef-java:      defines macro for class execution
169      -do-jar-with-manifest:    JAR building (if you are using a manifest)
170      -do-jar-without-manifest: JAR building (if you are not using a manifest)
171      run:                      execution of project
172      -javadoc-build:           Javadoc generation
173      test-report:              JUnit report generation
174
175    An example of overriding the target for project execution could look like this:
176
177        <target name="run" depends="TMCSim-impl.jar">
178            <exec dir="bin" executable="launcher.exe">
179                <arg file="${dist.jar}"/>
180            </exec>
181        </target>
182
183    Notice that the overridden target depends on the jar target and not only on
184    the compile target as the regular run target does. Again, for a list of available
185    properties which you can use, check the target you are overriding in the
186    nbproject/build-impl.xml file.
187
188    -->
189</project>
Note: See TracBrowser for help on using the repository browser.