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

Revision 2, 6.8 KB checked in by jdalbey, 10 years ago (diff)

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