-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
233 lines (204 loc) · 7.23 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
<?xml version="1.0" encoding="iso-8859-1" ?>
<project name="MapExplorer" default="compile">
<description>DDM Map Explorer</description>
<property environment="env" />
<property name="build.dir" location="build" />
<property name="classes.dir" location="${build.dir}/classes" />
<property name="build.debug" value="true" />
<property name="test.dir" location="${build.dir}/test" />
<property name="test.data.dir" location="${test.dir}/data" />
<property name="test.reports.dir" location="${test.dir}/reports" />
<property name="findbugs.home" value="/usr/share/findbugs" />
<path id="compile.classpath">
<pathelement location="${classes.dir}" />
</path>
<path id="test.classpath">
<path refid="compile.classpath" />
<pathelement location="lib/junit4.jar" />
<pathelement location="${test.dir}" />
</path>
<target name="init">
<mkdir dir="${classes.dir}" />
<mkdir dir="dist" />
<mkdir dir="doc" />
<mkdir dir="tmp" />
</target>
<target name="test-init">
<mkdir dir="${test.dir}" />
<delete dir="${test.data.dir}" />
<delete dir="${test.reports.dir}" />
<mkdir dir="${test.data.dir}" />
<mkdir dir="${test.reports.dir}" />
</target>
<target name="compile" depends="init" description="Compile">
<javac srcdir="src"
destdir="${classes.dir}"
source="7"
target="7"
encoding="utf-8"
debug="${build.debug}">
<classpath refid="compile.classpath" />
<compilerarg value="-Xlint:all" />
</javac>
</target>
<target name="test-compile" depends="compile,test-init">
<javac destdir="${test.dir}"
debug="${build.debug}"
includeAntRuntime="true"
source="7"
target="7"
encoding="utf-8"
srcdir="test">
<classpath refid="test.classpath" />
<compilerarg value="-Xlint:all" />
</javac>
</target>
<target name="test" depends="test-compile" description="Run unit tests">
<junit printsummary="false"
errorProperty="test.failed"
failureProperty="test.failed">
<classpath>
<path refid="test.classpath" />
</classpath>
<formatter type="brief" usefile="false" />
<formatter type="xml" />
<batchtest todir="${test.data.dir}">
<fileset dir="${test.dir}" includes="**/*Test.class" />
</batchtest>
</junit>
<junitreport todir="${test.data.dir}">
<fileset dir="${test.data.dir}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames"
todir="${test.reports.dir}" />
</junitreport>
<fail message="Tests failed. Check protocols and reports."
if="test.failed" />
</target>
<target name="jar" depends="test, manifest" description="Make jar">
<jar destfile="dist/${ant.project.name}.jar"
manifest="tmp/MANIFEST.MF">
<fileset dir="${classes.dir}" />
<fileset dir="." includes="icons/*.png" />
</jar>
</target>
<target name="dist" depends="jar" description="Make distribution archive">
<zip destfile="dist/${ant.project.name}.zip">
<zipfileset dir="dist" prefix="MapExplorer" includes="${ant.project.name}.jar" />
<zipfileset dir="lib" prefix="MapExplorer">
<include name="*.jar" />
<include name="*.map" />
<include name="check-results.dat" />
<!-- <include name="mapexplorer" /> -->
<include name="*.bat" />
<include name="README.*" />
</zipfileset>
</zip>
</target>
<target name="manifest" depends="init" description="Create manifest for jar">
<manifest file="tmp/MANIFEST.MF">
<attribute name="Built-By" value="${user.name}" />
<attribute name="Built-On" value="${timestamp.isoformat}" />
<attribute name="Main-Class" value="de.bokeh.ddm.mapexplorer.MapExplorer" />
<!-- <attribute name="Class-Path" value="log4j-1.2.12.jar" /> -->
</manifest>
</target>
<target name="findbugs" depends="dist" description="Run findbugs">
<taskdef name="findbugs"
classname="edu.umd.cs.findbugs.anttask.FindBugsTask" />
<findbugs home="${findbugs.home}"
output="html"
outputFile="findbugs-results.html"
excludeFilter="fb-exclude.xml"
reportLevel="low"
effort="max" >
<sourcePath path="src" />
<class location="dist/${ant.project.name}.jar" />
</findbugs>
</target>
<target name="doc" depends="compile" description="Generate Javadoc documentation">
<javadoc destdir="doc"
packagenames="de.bokeh.ddm.*"
sourcepath="src"
source="7"
encoding="utf-8"
locale="de_DE"
use="true">
<tag name="to.do" description="To Do:" />
<classpath refid="compile.classpath" />
</javadoc>
</target>
<target name="clean" description="Delete temporary build files">
<delete dir="${build.dir}" />
<delete dir="dist" />
<delete dir="doc" />
<delete dir="tmp" />
</target>
<path id="pmd.classpath">
<pathelement location="${build}"/>
<fileset dir="${env.HOME}/bin/pmd/lib/">
<include name="*.jar"/>
</fileset>
</path>
<target name="pmd" depends="compile">
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.classpath" />
<pmd shortFilenames="true"
encoding="UTF-8"
targetjdk="1.7">
<ruleset>basic</ruleset>
<ruleset>imports</ruleset>
<ruleset>coupling</ruleset>
<ruleset>sunsecure</ruleset>
<ruleset>unusedcode</ruleset>
<formatter type="html" toFile="pmd_report.html" />
<fileset dir="src/">
<include name="**/*.java"/>
</fileset>
<fileset dir="test/">
<include name="**/*.java"/>
</fileset>
</pmd>
</target>
<property name="cpd.minTokenCount" value="50" />
<target name="cpd" depends="compile" description="Find duplicate code">
<taskdef name="cpd" classname="net.sourceforge.pmd.cpd.CPDTask" classpathref="pmd.classpath" />
<cpd minimumTokenCount="${cpd.minTokenCount}" outputFile="cpd1.txt">
<fileset dir="src/">
<include name="**/*.java"/>
</fileset>
</cpd>
<cpd minimumTokenCount="${cpd.minTokenCount}" ignoreLiterals="true" outputFile="cpd2.txt">
<fileset dir="src/">
<include name="**/*.java"/>
</fileset>
</cpd>
<cpd minimumTokenCount="${cpd.minTokenCount}" ignoreLiterals="true" ignoreIdentifiers="true" outputFile="cpd3.txt">
<fileset dir="src/">
<include name="**/*.java"/>
</fileset>
</cpd>
</target>
<target name="profile" description="Profiling">
<fail unless="netbeans.home">This target can only run inside the NetBeans IDE.</fail>
<nbprofiledirect>
<classpath>
<pathelement location="dist/MapExplorer.jar" />
</classpath>
</nbprofiledirect>
<java classname="de.bokeh.ddm.mapexplorer.MapExplorer"
failonerror="true"
fork="true">
<classpath>
<pathelement location="dist/MapExplorer.jar" />
</classpath>
<!-- <jvmarg value="-verbose" /> -->
<jvmarg value="-server" />
<jvmarg value="-Xmx64m" />
<jvmarg value="-ea" />
<jvmarg value="-Xfuture" />
<jvmarg value="${profiler.info.jvmargs.agent}" />
<arg value="lib/Fane_of_Lolth.map" />
</java>
</target>
</project>