-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
332 lines (298 loc) · 13.3 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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
<?xml version="1.0" encoding="UTF-8"?>
<project name="jchart2d" default="makejarBinary">
<description>
A swing-widget for precise visualisation of charts.
</description>
<!-- General Properties -->
<property name="project.name" value="jchart2d-uimenu" />
<property name="project.version" value="1.0.0" />
<property name="libdir" value="${basedir}/ext" />
<property name="outjar" value="${basedir}/${project.name}-${project.version}.jar" />
<property name="distfolder" value="${basedir}/${project.name}-${project.version}/" />
<property name="distfile" value="${basedir}/${project.name}-${project.version}.zip" />
<property name="builddir" value="${basedir}/bin" />
<property name="sourcedir" value="${basedir}/src" />
<property name="sourcedir.test" value="${basedir}/test" />
<!-- Taskdefs -->
<!--
Shrinking for the Applet jar...
The resource is a properties file within the proguard.jar
and informs about the task implementation.
-->
<taskdef resource="proguard/ant/task.properties" classpath="${libdir}/build/proguard-4.5.1.jar" />
<!-- General paths & filesets. -->
<path description="Classpath of project" id="classpath">
<pathelement path="${builddir}" />
<fileset refid="allJars" />
</path>
<fileset description="Source files of project" dir="${sourcedir}" id="sourcefiles">
<include name="**/*.java" />
</fileset>
<fileset description="Compiled classfiles of project" dir="${builddir}" id="classfiles">
<include name="**/*.class" />
</fileset>
<!--
These files will be shipped in the jchart2d package
by extracting them to the project's basedir, before the
whole project is packed into a jar.
See the rule integrateJars
-->
<fileset dir="${libdir}" id="externalJars" description="3rd party library jar files that will be shipped with the distribution.">
<include name="*.jar" />
</fileset>
<!-- Emit fileset to property -->
<property name="externalJars" refid="externalJars" />
<fileset dir="${basedir}" id="licenses" description="License files of JChart2d and it's 3rd party jar files.">
<include name="lgpl.txt" />
<include name="LICENSE-apache-xmlgraphics-commons" />
<include name="NOTICE-apache-xmlgraphics-commons" />
<include name="LICENSE-infovis.txt" />
<include name="3rdpartylicenses.txt" />
</fileset>
<!--
All jars that have to be on the classpath for compilation.
-->
<fileset dir="${libdir}" id="allJars" description="External library jar files that will be shipped with this *.jar distribution.">
<include name="**/*.jar" />
</fileset>
<!-- compile the java sources -->
<target name="init">
<tstamp />
<mkdir dir="${builddir}" />
<mkdir dir="${libdir}" />
<mkdir dir="${sourcedir}" />
</target>
<target name="build" depends="init">
<exec executable="java">
<arg value="-version" />
</exec>
<javac srcdir="${sourcedir}" fork="false" debug="true" source="1.6" target="1.6" destdir="${builddir}" includeantruntime="false">
<classpath refid="classpath" />
</javac>
</target>
<target name="build.test" depends="build">
<javac srcdir="${sourcedir.test}" fork="true" debug="true" source="1.6" verbose="true" target="1.6" destdir="${builddir}" includeantruntime="false">
<classpath refid="classpath" />
</javac>
<!-- copy the test resources -->
<copy todir="${builddir}">
<fileset dir="${sourcedir.test}">
<include name="**/*.properties" />
</fileset>
</copy>
</target>
<target name="makejarFat" depends="delete.classfiles,build">
<jar destfile="${project.name}-${project.version}.jar" basedir="${builddir}" update="false" manifest="manifest.mf">
<include name="**/*.class" />
</jar>
<!-- rebuild test classes as eclipse would show errors afterwards. -->
<antcall target="build.test">
</antcall>
</target>
<target name="zip.binaries" depends="makejarBinary">
<description>Creates a zip file containing the core jar file and all 3rd party libraries.</description>
<delete dir="${distfolder}">
</delete>
<mkdir dir="${distfolder}" />
<property name="externalJars" refid="externalJars" />
<echo message="files to add = ${externalJars}" />
<copy todir="${distfolder}" verbose="yes" failonerror="true">
<!--<file file="$"/> -->
<fileset refid="externalJars" />
<fileset refid="licenses" />
</copy>
<move todir="${distfolder}" file="${outjar}">
</move>
<delete file="${distfile}">
</delete>
<zip destfile="${distfile}">
<fileset dir="${distfolder}">
</fileset>
</zip>
<delete dir="${distfolder}" />
</target>
<target name="dist" depends="zip.binaries,makejarApplet,makezipEclipseProject,zip.javadoc">
<description>Shortcut to build every file for a release.</description>
</target>
<target name="makejarBinary" depends="makejarFat">
<!--
Shrink the jar file as external jars (e.g. infovis for range chooser panel)
contain many unused classes.
Ignorewarnings is on as external jar infovis depends on further jars.
Tun this off is more jars have deps that may not be ignored.
-->
<proguard obfuscate="false" shrink="true" overloadaggressively="false" warn="true" verbose="true" ignorewarnings="true" printmapping="true" allowaccessmodification="false" optimize="false">
<libraryjar>
<pathelement path="${java.home}/lib/rt.jar" />
<fileset dir="${libdir}">
<include name="*.jar" />
</fileset>
</libraryjar>
<!--
caution: The name attribut value has to be the same expression
as the destfile of the makejar- target [depend].
-->
<injar name="${outjar}" />
<outjar name="${basedir}/${project.name}-${project.version}-shrinked.jar" />
<!-- Filter -->
<!-- keep all interfaces -->
<keep name="*" type="interface" >
<method name="*"/>
</keep>
<!-- keep the demos along with all methods -->
<keep access="public" name="info.monitorenter.gui.chart.uidemos.*">
<method name="*" />
<constructor />
</keep>
<!-- keep all getters, setters and constants of classes that are preserved -->
<keepclassmembers>
<method name="get*" />
<method name="set*" />
<method name="is*" />
<field access="public static final" />
</keepclassmembers>
<!-- Since version 4.0 of proguard Exceptions have to be kept -->
<keepattribute />
<!--
<keepattribute name="Exceptions" />
<keepattribute name="Deprecated" />
<keepattribute name="Sourcefile" />
<keepattribute name="LocalVariableTable" />
<keepattribute name="LocalVariableTypeTable" />
<keepattribute name="InnerClasses" />
-->
</proguard>
<!-- Delete big jar and rename shrinked to that name. -->
<delete file="${outjar}" />
<move tofile="${outjar}" file="${basedir}/${project.name}-${project.version}-shrinked.jar" />
</target>
<target name="makejarApplet" depends="makejarFat">
<description>
Create a jar file that is shrinked by proguard for
faster download. Only the codepath for the applet
init will be kept.
</description>
<proguard obfuscate="false" shrink="true" overloadaggressively="false" warn="true" verbose="true" ignorewarnings="true" printmapping="true" allowaccessmodification="false" optimize="false">
<libraryjar name="${java.home}/lib/rt.jar" />
<!--
caution: The name attribut value has to be the same expression
as the destfile of the makejar- target [depend].
-->
<injar name="${outjar}" />
<outjar name="${basedir}/${project.name}-applet.jar" />
<!-- Filter -->
<keep access="public" name="info.monitorenter.gui.chart.demos.Showcase">
<method access="public" name="init" />
</keep>
<!-- keep all error bar stuff -->
<keep access="public" name="info.monitorenter.gui.chart.errorbars.**" allowoptimization="false">
<constructor />
<method access="public" name="**" />
</keep>
</proguard>
<!--
<genkey alias="jchart2.sourceforge.net" storepass="password" keystore="${basedir}/.keystore" >
<dname>
<param name="CN" value="Achim Westermann"/>
<param name="OU" value="JChart2D"/>
<param name="O" value="monitorenter.info"/>
<param name="C" value="DE"/>
</dname>
</genkey>
-->
<!-- Not working on my box for now -->
<signjar jar="${basedir}/${project.name}-applet.jar" alias="jchart2.sourceforge.net" keystore="${basedir}/.keystore" verbose="true" storepass="password" keypass="tracerunner" />
</target>
<!-- Dependency only for ensuring validity -->
<target name="makezipEclipseProject" depends="build">
<property name="sourcezip" value="${project.name}-eclipse-project-${project.version}.zip" />
<delete file="${basedir}/${sourcezip}" />
<zip destfile="${sourcezip}" basedir="${basedir}/.." update="false">
<include name="${project.name}/src/**/*.java" />
<include name="${project.name}/test/**/*.java" />
<include name="${project.name}/ext/**/*.jar" />
<include name="${project.name}/.classpath" />
<include name="${project.name}/.project" />
<include name="${project.name}/build.xml" />
<include name="${project.name}/manifest.mf" />
<include name="${project.name}/checkstyle.xml" />
<include name="${project.name}/formatting.xml" />
<include name="${project.name}/history.txt" />
<include name="${project.name}/doc/docs/javadoc/jchart2d.css" />
<!-- Works when defaultexcludes="no" is set -->
<include name="${project.name}/.cvsignore" />
<!-- The eclipse builders -->
<include name="${project.name}/.externalToolBuilders/**/*" />
<fileset refid="licenses">
</fileset>
</zip>
</target>
<target name="javadoc" depends="delete.doc">
<delete dir="${basedir}/doc/docs/javadoc" />
<mkdir dir="${basedir}/doc/docs/javadoc" />
<javadoc destdir="${basedir}/doc/docs/javadoc" access="protected" use="false" notree="false" nonavbar="false" noindex="false" splitindex="true" Author="true" version="true" nodeprecatedlist="false" nodeprecated="false" doctitle="JChart2D API documentation, Version ${project.version}" windowtitle="JChart2D API documentation, Version ${project.version}" Verbose="true" stylesheetfile="${basedir}/doc/docs/javadoc/jchart2d.css" charset="UTF-8" docencoding="UTF-8">
<classpath refid="classpath" />
<bottom>
<![CDATA[<i>Copyright © 2001 - 2011 <a href="http://www.opensource.org/licenses/lgpl-license.php" target="_blank">LGPL</a>, All Rights Footloose.</i>]]></bottom>
<fileset refid="sourcefiles" />
<link offline="false" href="http://java.sun.com/j2se/1.5.0/docs/api/" packagelistLoc="${java.home}/docs/api/" />
<link offline="false" href="http://logging.apache.org/log4j/1.2/apidocs/" packagelistLoc="http://logging.apache.org/log4j/1.2/apidocs/package-list" />
</javadoc>
</target>
<target name="zip.javadoc" depends="javadoc">
<description>
Zip the javadoc API documentation to a zip named after the property project.name.
</description>
<zip basedir="${basedir}/doc/docs/javadoc/" destfile="${basedir}/${project.name}-doc-${project.version}.zip" includes="**/*.html,**/*.css,package-list" />
</target>
<!-- remove all resources in builddir and the current jar file-->
<target name="delete.classfiles">
<delete verbose="true" failonerror="true">
<fileset dir="${builddir}" />
<file file="${outjar}" />
</delete>
</target>
<target name="delete.doc">
<description>Delete the generated documentation.</description>
<delete includeEmptyDirs="true" verbose="true">
<fileset dir="${basedir}">
<include name="doc/docs/javadoc/**/*" />
<!-- Also delete the zip file with the doc! -->
<include name="${project.name}doc.zip" />
<exclude name="doc/docs/javadoc/jchart2d.css" />
</fileset>
</delete>
</target>
<target name="delete.local" depends="delete.classfiles,delete.doc">
<description>
Delete only the local generated files. This target is intended to
be used before the project is checked in into the cmvc.
</description>
</target>
<!--
Hard rebuild: scrubbing all classfiles and the generated *.java files of antlr before
invoking compilation.
-->
<target name="rebuild" depends="delete.classfiles,build" />
<target name="profile.runningchart">
<description>
Runs info.monitorenter.gui.chart.demos.RunningChart with
the JIP (java interactive profiler). Change project to java 1.5
as it requires the new -javaagent: argument.
</description>
<!--
<exec dir="${basedir}"
executable="java"
os="Windows 2000"
output="profiler-output.txt">
<arg line="-version" />
</exec>
-->
<exec dir="${basedir}" executable="java" os="Windows 2000" output="profiler-output.txt">
<arg line="-javaagent:${basedir}/ext/build/profile.jar -Xmx100M -Dprofile.properties=${basedir}/ext/build/profiler.properties -classpath ${basedir}/bin/;${basedir}/ext/build/junit.jar info.monitorenter.gui.chart.demos.RunningChart" />
</exec>
<exec dir="${basedir}" executable="java" os="Windows 2000">
<arg line="-classpath ${basedir}/ext/build/jipViewer.jar com.tivo.jipviewer.JipViewer profiler.xml" />
</exec>
</target>
</project>