-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.xml
218 lines (195 loc) · 8.5 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
<project name="RPlot" default="compile-test">
<property name="build.sysclasspath" value="ignore"/>
<taskdef resource="net/sf/antcontrib/antcontrib.properties" />
<echo message="Building for ${user.name} on ${os.name}" />
<!-- Build file for Cartesian SLIM. Other subprojects are not addressed -->
<property file="${user.name}.${os.name}.build.properties" />
<property file="${user.name}.build.properties" />
<property name="rplot.sandbox.dir" location="${basedir}" />
<property name="src.dir" location="src"/>
<property name="test.dir" location="test"/>
<property name="lib.dir" location="lib"/>
<property name="dist.dir" location="dist"/>
<property name="build.dir" location="build"/>
<property name="build.src" location="${build.dir}/src"/>
<property name="build.test" location="${build.dir}/test"/>
<property name="build.junit" location="${build.dir}/junit"/>
<property name="vcs.info.cmd" value="git"/>
<property name="vcs.info.args" value="rev-list --abbrev-commit -n 1 HEAD"/>
<property name="ant.build.javac.source" value="1.7" />
<property name="ant.build.javac.target" value="1.7" />
<defaultexcludes add="**/.hg"/>
<defaultexcludes add="**/.hg/**"/>
<target name="class-clean" description="Delete only class compilation destination">
<delete dir="${build.src}" />
<delete dir="${build.test}" />
</target>
<target name="clean" depends="class-clean">
<delete dir="${dist.dir}"/>
<delete dir="${build.dir}"/>
</target>
<target name="init">
<mkdir dir="${dist.dir}"/>
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.src}"/>
<mkdir dir="${build.test}"/>
<mkdir dir="${build.junit}"/>
</target>
<target name="rplot-vcs-info" depends="init" unless="rplot.vcs.commit.revision">
<exec executable="${vcs.info.cmd}" outputproperty="rplot.vcs.commit.revision">
<arg line="${vcs.info.args}"/>
</exec>
<echo message="Current build revision is ${rplot.vcs.commit.revision}"/>
</target>
<target name="compile-src" depends="init" description="Compiles all code in src.">
<javac destdir="${build.src}" srcdir="${src.dir}" includes="**/*.java" debug="true">
<compilerarg value="-Xlint" />
<compilerarg value="-Xlint:-serial" />
<classpath>
<pathelement path="${src.dir}"/>
<fileset dir="${lib.dir}">
<!-- <include name="gzipfix.jar" /> -->
</fileset>
<fileset dir="${lib.dir}" includes="**/*.jar" />
</classpath>
</javac>
</target>
<target name="compile-test" depends="compile-src" description="Compiles all code in test.">
<javac destdir="${build.test}" srcdir="${test.dir}" includes="**/*.java" debug="true">
<compilerarg value="-Xlint" />
<compilerarg value="-Xlint:-serial" />
<classpath>
<pathelement path="${build.src}"/>
<pathelement path="${test.dir}"/>
<fileset dir="${lib.dir}" includes="*.jar" />
</classpath>
</javac>
</target>
<target name="compile" depends="compile-test" description="Compile all Java source code."/>
<target name="set-rplot-build-version" depends="init,rplot-vcs-info">
<loadfile property="old-rplot.version" srcFile="${build.src}/rplot.version" failonerror="false"/>
<if>
<not>
<equals arg1="${old-rplot.version}" arg2="${rplot.vcs.commit.revision}"/>
</not>
<then>
<echo message="Setting rplot build revision to ${rplot.vcs.commit.revision}"/>
<echo file="${build.src}/rplot.version" message="${rplot.vcs.commit.revision}"/>
<tstamp> <format property="build.time" pattern="yyyy-MM-dd" /></tstamp>
<echo file="${build.src}/build.time" message="${build.time}" />
</then>
</if>
</target>
<target name="copy-dependencies">
<jar jarfile="${build.src}/dependencies-all.jar">
<zipgroupfileset dir="${lib.dir}/">
<include name="VectorGraphics2D*.jar" />
</zipgroupfileset>
</jar>
</target>
<target name="RPlot.jar" depends="compile-src,compile-test,copy-dependencies" description="Version with all code.">
<jar destfile="${build.dir}/RPlot.jar" duplicate="fail">
<manifest>
<attribute name="Main-Class" value="com.reeltwo.plot.demo.SwingPlot"/>
<attribute name="Implementation-Title" value="RPlot"/>
<attribute name="Implementation-Vendor" value="NetValue Ltd"/>
<attribute name="Class-Path" value="."/>
</manifest>
<fileset dir="${build.src}">
<include name="com/**/*.class"/>
<include name="rplot.version"/>
<include name="build.time" />
</fileset>
<fileset dir="${build.test}">
<include name="com/**/*.class"/>
</fileset>
<fileset dir="${src.dir}">
<include name="com/**/*.png"/>
</fileset>
<fileset dir="${test.dir}">
<include name="com/reeltwo/**/*.txt"/>
<include name="com/reeltwo/**/resources/*"/>
</fileset>
<!-- <zipfileset src="${lib.dir}/junit.jar" excludes="META-INF/**"/> -->
<zipfileset src="${build.src}/dependencies-all.jar" excludes="META-INF/**"/>
</jar>
</target>
<target name="runalltests" depends="compile-src,compile-test" description="Run all tests">
<java classname="com.reeltwo.plot.AllTests" fork="true" failonerror="true" dir="${build.junit}">
<jvmarg value="-Xmx900M" />
<jvmarg value="-server" />
<jvmarg value="-ea" />
<classpath>
<pathelement path="${build.src}" />
<pathelement path="${build.test}" />
<pathelement path="${src.dir}" />
<pathelement path="${test.dir}" />
<fileset dir="${lib.dir}" includes="*.jar" />
</classpath>
</java>
</target>
<target name="runtest" depends="compile-src,compile-test" description="Run a test class. -Dtest.class=xxx">
<fail unless="test.class" message="test.class property must be set"/>
<java classname="junit.textui.TestRunner" fork="true" failonerror="true" dir="${build.junit}">
<arg line="${test.class}" />
<jvmarg value="-server" />
<jvmarg value="-ea" />
<classpath>
<pathelement path="${build.src}" />
<pathelement path="${build.test}" />
<pathelement path="${src.dir}" />
<pathelement path="${test.dir}" />
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
</classpath>
</java>
</target>
<!-- Stuff for jumble -->
<path id="test.classpath">
<pathelement path="${build.src}" />
<pathelement path="${build.internal}" />
<pathelement path="${build.test}" />
<pathelement path="${internal.dir}" />
<pathelement path="${src.dir}" />
<pathelement path="${test.dir}" />
<fileset dir="${lib.dir}" includes="*.jar" />
</path>
<property name="test.classpath" refid="test.classpath" />
<!-- checkstyle -->
<taskdef resource="checkstyletask.properties" classpath="${lib.dir}/checkstyle-5.5-all.jar:.cvscheck/checkstyle-extra-checks.jar" />
<property name="checkstyle.suppressions.file" location=".cvscheck/checkstyle_suppressions.xml" />
<target name="checkstyle" depends="compile" description="Run checkstyle on all source code.">
<checkstyle config=".cvscheck/checkstyle_config.xml" classpathref="test.classpath">
<fileset dir="src" includes="**/*.java" />
<fileset dir="test" includes="**/*.java" />
<formatter type="plain" />
</checkstyle>
</target>
<target name="javadoc" depends="compile-src" description="Build javadocs">
<javadoc sourcepath="${src.dir}" destdir="${build.dir}/javadocs" source="1.7"
Author="true" Version="true" Package="true" useexternalfile="true" additionalparam="-quiet">
<tag name="has" enabled="false"/>
<tag name="assoc" enabled="false"/>
<tag name="depend" enabled="false"/>
<tag name="composed" enabled="false"/>
<tag name="minOccurs" enabled="false"/>
<tag name="maxOccurs" enabled="false"/>
<tag name="nillable" enabled="false"/>
<tag name="nillableContainer" enabled="false"/>
<tag name="minOccursContainer" enabled="false"/>
<tag name="length" enabled="false"/>
<tag name="minLength" enabled="false"/>
<tag name="maxLength" enabled="false"/>
<tag name="enumeration" enabled="false"/>
<tag name="pattern" enabled="false"/>
<tag name="minExclusive" enabled="false"/>
<tag name="maxExclusive" enabled="false"/>
<tag name="minInclusive" enabled="false"/>
<tag name="maxInclusive" enabled="false"/>
<classpath>
<fileset dir="${lib.dir}" includes="*.jar" />
</classpath>
</javadoc>
</target>
</project>