-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
246 lines (222 loc) · 12.4 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
<?xml version="1.0"?>
<project name="PrintTalkJ" default="all" basedir=".">
<description>Builds PrintTalkJ.</description>
<!-- Initializes -->
<target name="-init" description="Initializes the build. This target is automatically run before building.">
<echo>Initializing. Using build settings...</echo>
<!-- Sets properties -->
<echo>Make sure you have a directory named 'lib' containing the JAR files of the library dependencies (see lib/DEPENDENCIES.txt).</echo>
<property name="lib.dir" value="./lib" />
<tstamp />
<property name="ant.build.javac.target" value="1.5" />
<property file="version.properties" />
<property name="base.filename" value="PrintTalkJ-${major.version}.${minor.version}" />
<property name="major.filename" value="PrintTalkJ-${major.version}" />
<property name="jdflib.src.dir" value="./src" />
<property name="test.src.dir" value="./test" />
<property name="test.tmp.dir" value="${test.src.dir}/data/temp" />
<property name="dist.dir" value="./dist" />
<property name="doc.dir" value="${dist.dir}/doc" />
<property name="bin.dir" value="${dist.dir}/bin" />
<property name="build.debug" value="yes" />
<property name="build.optimize" value="on" />
<property name="verbose" value="true" />
<!-- Sets class path -->
<path id="project.class.path">
<!-- <pathelement path="${java.class.path}" /> -->
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
</path>
<!-- Creates directories -->
<mkdir dir="${dist.dir}" />
<mkdir dir="${bin.dir}" />
</target>
<target name="prepare" depends="-init">
<!-- Creates directories -->
<mkdir dir="${bin.dir}" />
<mkdir dir="${dist.dir}" />
<mkdir dir="${doc.dir}" />
<!-- delete tmp directory -->
<delete includeEmptyDirs="true">
<fileset dir="${test.tmp.dir}" includes="**/*" />
</delete>
<copy overwrite="true" file="../JDFLibJ/version.properties" todir="." />
<copy overwrite="true" todir="${lib.dir}" flatten="true">
<fileset dir="../JDFLibJ/dist">
<include name="JDFLibJ-2.1.4a.jar" />
</fileset>
<fileset dir="../JDFLibJ/lib">
<include name="xml-apis.jar" />
<include name="xercesImpl.jar" />
<include name="commons-*.jar" />
<include name="activation*.jar" />
</fileset>
</copy>
</target>
<target name="buildnumber">
<buildnumber />
<echo message="Build number:${build.number}" />
</target>
<target name="common-prepare" depends="-init, buildnumber" description="Prepare common for all final targets">
<copy todir="${dist.dir}">
<fileset dir=".">
<include name="Readme.txt" />
<include name="Version.rtf" />
</fileset>
</copy>
</target>
<target name="compile" depends="-init" description="Compiles the JDFLibJ source code.">
<echo>Compiling...</echo>
<javac encoding="UTF-8" destdir="${bin.dir}" debug="${build.debug}" optimize="${build.optimize}" target="1.5" source="1.5" failonerror="false">
<src path="${jdflib.src.dir}" />
<classpath refid="project.class.path" />
<include name="**/*.java" />
</javac>
</target>
<target name="clean" depends="-init" description="Cleans the build.">
<echo>Cleaning...</echo>
<delete dir="${dist.dir}" />
</target>
<target name="jar" depends="compile, buildnumber" description="Builds a JAR archive containing the JDFLibJ binaries.">
<jar destfile="${dist.dir}/${base.filename}.jar" basedir="${bin.dir}">
<manifest>
<attribute name="Main-Class" value="org.cip4.jdflib.CheckJDF" />
<attribute name="Bundle-Name" value="JDFLibJ ${major.version}.${minor.version}.${build.number}" />
<attribute name="Bundle-Vendor" value="CIP4" />
<section name="JDFLibJ">
<attribute name="JDF-Version" value="${jdf.version}" />
<attribute name="JDFLib-Version" value="${major.version}.${minor.version}.${build.number}" />
<attribute name="Build-Date" value="${DSTAMP}" />
</section>
</manifest>
</jar>
</target>
<target name="major_jar" depends="jar" description="Builds a JAR archive containing the JDFLibJ binaries.">
<copy file="${dist.dir}/${base.filename}.jar" tofile="${dist.dir}/${major.filename}.jar" />
</target>
<target name="dist_all" depends="-init" description="builds lots of jars and wars and good things for distribution">
<ant antfile="build.xml" dir="." target="clean" />
<ant antfile="build.xml" dir="." target="spam" />
<ant antfile="build.xml" dir="." target="all" />
<ant antfile="../alces/build.xml" dir="../alces" target="clean" inheritAll="false" />
<ant antfile="../alces/build.xml" dir="../alces" target="dist" inheritAll="false" />
<ant antfile="../JDFEditor/build.xml" dir="../JDFEditor" target="clean" inheritAll="false" />
<ant antfile="../JDFEditor/build.xml" dir="../JDFEditor" target="dist" inheritAll="false" />
<ant antfile="../JDFEditor/build.xml" dir="../JDFEditor" target="dist" inheritAll="false" />
<ant antfile="../JDFEditor/build.xml" dir="../JDFEditor" target="dmgappledist" inheritAll="false" />
<ant antfile="../DropFolder/build.xml" dir="../DropFolder" target="clean" inheritAll="false" />
<ant antfile="../DropFolder/build.xml" dir="../DropFolder" target="dist" inheritAll="false" />
<ant antfile="../Bambi/build-core.xml" dir="../Bambi" target="clean" inheritAll="false" />
<ant antfile="../Bambi/build-simworker.xml" dir="../Bambi" target="war" inheritAll="false" />
<ant antfile="../Bambi/build-proxy.xml" dir="../Bambi" target="war" inheritAll="false" />
<ant antfile="../Bambi/build-console.xml" dir="../Bambi" target="war" inheritAll="false" />
<ant antfile="../jdfutility/build.xml" dir="../jdfutility" target="war" inheritAll="false" />
<ant antfile="../jdfutility/build.xml" dir="../jdfutility" target="clean" inheritAll="false" />
</target>
<!-- ================================================================================== -->
<!-- ================================================================================== -->
<target name="doc" depends="-init, buildnumber" description="Builds the PrintTalkJ Javadoc">
<echo>Generating JavaDoc...</echo>
<mkdir dir="${doc.dir}" />
<javadoc access="public" author="true" classpathref="project.class.path" destdir="doc" nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false" packagenames="org.cip4.jdflib.generator.gui,org.cip4.jdflib.devicecapability,org.cip4.jdflib.resource.process,org.cip4.jdflib.resource.devicecapability,org.cip4.jdflib.node,org.cip4.jdflib.generator,org.cip4.jdflib.core,org.cip4.jdflib.auto,org.cip4.jdflib.pool,org.cip4.jdflib.datatypes,org.cip4.jdflib.util,org.cip4.jdflib.span,org.cip4.jdflib.resource,org.cip4.jdflib.resource.process.press,org.cip4.jdflib.jmf,org.cip4.jdflib.resource.process.postpress,org.cip4.jdflib.resource.intent,org.cip4.jdflib.resource.process.prepress" source="1.3" sourcefiles="test/org/cip4/jdflib/CheckJDFTest.java,apps/org/cip4/jdflib/TestJDF.java,apps/org/cip4/jdflib/CheckJDF.java,test/org/cip4/jdflib/EmptyNamespace.java,apps/org/cip4/jdflib/MergeJDF.java,test/org/cip4/jdflib/AllJDFLibTest.java,apps/org/cip4/jdflib/SpawnJDF.java" sourcepath="test;src;apps" splitindex="true" use="true" version="true" />
<javadoc destdir="${doc.dir}" sourcepath="${jdflib.src.dir}" version="true" private="yes" source="1.5" classpathref="project.class.path" use="true" notree="false" windowtitle="JDFLibJ-${jdflib.version}BLD${build.number}" nonavbar="false" noindex="false" splitindex="true" author="true" nodeprecatedlist="false" nodeprecated="false" additionalparam="-J-Xmx180m">
<packageset dir="${jdflib.src.dir}" defaultexcludes="yes">
<include name="**" />
</packageset>
</javadoc>
</target>
<!-- ================================================================================== -->
<!-- Generates a ZIP which contains everything a developer needs to start using JDFLibJ -->
<!-- i.e. JAR, JavaDoc, and all manually written documentation -->
<!-- ================================================================================== -->
<!-- <target name="pack-bin" depends="common-prepare,jar,doc" description="Bundles a distribution of JDFLibJ binaries and Javadoc in a ZIP file"> -->
<target name="pack-bin" depends="common-prepare,jar,major_jar,doc" description="Bundles a distribution of JDFLibJ binaries and Javadoc in a ZIP file">
<echo message="Building ${base.filename}-bin.zip" />
<zip destfile="${dist.dir}/${base.filename}-bin.zip">
<zipfileset dir="${doc.dir}" prefix="docs" />
<zipfileset dir="${dist.dir}" includes="${base.filename}.jar" />
<zipfileset dir="${dist.dir}" includes="${major.filename}.jar" />
<zipfileset dir="${dist.dir}" includes="Readme.txt,Version.rtf" />
</zip>
</target>
<!-- ====================================================================================== -->
<!-- Generates a ZIP which contains everything a developer needs to further develop JDFLibJ -->
<!-- i.e. all sources, build script and all manually written documentation -->
<!-- ====================================================================================== -->
<target name="pack-src" depends="common-prepare" description="Bundles a distribution of JDFLibJ source in a ZIP file.">
<echo message="Building ${base.filename}-src.zip" />
<zip destfile="${dist.dir}/${base.filename}-src.zip">
<zipfileset dir="${jdflib.src.dir}" prefix="src">
<include name="**/*.java" />
</zipfileset>
<zipfileset dir="${test.src.dir}" prefix="test">
<include name="**/*" />
</zipfileset>
<zipfileset dir="${dist.dir}" includes="Readme.txt,Version.rtf" />
<zipfileset dir="." includes="build.xml" />
</zip>
</target>
<!-- =================================================================== -->
<!-- Builds and packages sources and binary distributions -->
<!-- =================================================================== -->
<target name="all" depends="pack-bin,pack-src" />
<target name="test" description="Runs JUnit tests." depends="compile">
<property name="test.bin.dir" value="${bin.dir}/test" />
<mkdir dir="${test.bin.dir}" />
<property name="test.reports.dir" value="${bin.dir}/test-reports" />
<mkdir dir="${test.reports.dir}" />
<!-- Compile test cases -->
<echo>Compiling unit tests...</echo>
<javac destdir="${test.bin.dir}" debug="${build.debug}" target="1.5" source="1.5">
<src path="${test.src.dir}" />
<classpath refid="project.class.path" />
<classpath path="${bin.dir}" />
<include name="**/*" />
</javac>
<!-- Run test cases -->
<echo>Running unit tests...</echo>
<property name="test.working.dir" value="./" />
<junit timeout="60000" dir="${test.working.dir}" fork="true" tempdir="${test.bin.dir}" failureproperty="test.failure" errorproperty="test.error">
<formatter type="plain" />
<formatter type="xml" />
<classpath>
<pathelement path="${java.class.path}" />
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
<pathelement path="${bin.dir}" />
<pathelement path="${test.bin.dir}" />
<pathelement path="${test.src.dir}" />
</classpath>
<batchtest fork="yes" todir="${test.reports.dir}">
<fileset dir="${test.bin.dir}">
<exclude name="org/cip4/jdflib/AllJDFLibTest.class" />
<include name="**/*Test.class" />
</fileset>
</batchtest>
</junit>
<!-- Delete temp files -->
<delete>
<fileset dir="${test.working.dir}">
<include name="temp*" />
<include name="temp/*" />
</fileset>
</delete>
<echo>Tests reports can be found in: ${test.reports.dir}</echo>
</target>
<target name="recode" depends="-init">
<!--
<mkdir dir="${jdflib.src.dir}/recode" />
<mkdir dir="${jdflib.src.dir}/recode2" />
<native2ascii encoding="Cp1252" reverse="false" src="${jdflib.src.dir}"
includes="**/*.java" dest="${jdflib.src.dir}/recode"/>
<native2ascii encoding="UTF-8" reverse="true" src="${jdflib.src.dir}/recode"
includes="**/*.java" dest="${jdflib.src.dir}/recode2"/>
-->
<mkdir dir="${test.src.dir}/recode" />
<mkdir dir="${test.src.dir}/recode2" />
<native2ascii encoding="Cp1252" reverse="false" src="${test.src.dir}" includes="**/*.java" dest="${test.src.dir}/recode" />
<native2ascii encoding="UTF-8" reverse="true" src="${test.src.dir}/recode" includes="**/*.java" dest="${test.src.dir}/recode2" />
</target>
</project>