-
Notifications
You must be signed in to change notification settings - Fork 51
/
common.xml
247 lines (212 loc) · 8.45 KB
/
common.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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
Copyright (c) 2012 Original authors and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
Contributors:
Original authors and others - initial API and implementation
-->
<!--
Common set of Ant tasks
These taks are invoked once for each module, via subant call
-->
<project basedir="." default="build" name="nattable">
<tstamp />
<property name="datetime.stamp" value="${DSTAMP}${TSTAMP}" />
<property environment="env" />
<!-- Look in the user home for the clipse install. You can override by
using -DECLIPSE_HOME="xxx" on the command line -->
<property name="ECLIPSE_HOME" value="${user.home}/eclipse_rcp_3_5" />
<property name="debuglevel" value="source,lines,vars" />
<property name="target" value="1.5" />
<property name="source" value="1.5" />
<property name="version" value="2.0.0" />
<!-- src and binaries -->
<property name="src.dir" value="src" />
<property name="build.tools.dir" value="../deps/tools" />
<property name="target.dir" value="target" />
<!-- Class files go here -->
<property name="build.dir" value="${target.dir}/bin" />
<!-- Jars go here -->
<property name="dist.dir" value="${target.dir}/dist" />
<property name="emma.metadata.dir" location="${target.dir}/emma/metadata" />
<!-- Junit test reports -->
<property name="junit.reports.dir" value="${target.dir}/reports/junit" />
<!-- Findbugs reports -->
<property name="findbugs.report.dir" value="${target.dir}/reports/findbugs" />
<!-- Eclipse deps linked off an eclipse RCP install -->
<filelist id="eclipse.lib" dir="${ECLIPSE_HOME}/plugins">
<file name="org.apache.commons.lang_2.3.0.v200803061910.jar" />
<file name="org.apache.commons.logging_1.0.4.v200904062259.jar" />
<file name="org.eclipse.core.commands_3.5.0.I20090525-2000.jar" />
<file name="org.eclipse.core.runtime_3.5.0.v20090525.jar" />
<file name="org.eclipse.equinox.common_3.5.0.v20090520-1800.jar" />
<file name="org.eclipse.equinox.registry_3.4.100.v20090520-1800.jar" />
<file name="org.eclipse.core.runtime.compatibility.registry_3.2.200.v20090429-1800/runtime_registry_compatibility.jar" />
<file name="org.eclipse.jface_3.5.0.I20090525-2000.jar" />
<file name="org.eclipse.equinox.common_3.5.0.v20090520-1800.jar" />
<file name="org.eclipse.equinox.registry_3.4.100.v20090520-1800.jar" />
<file name="org.eclipse.osgi_3.5.0.v20090520.jar" />
<file name="org.hamcrest.core_1.1.0.v20090501071000.jar" />
<file name="org.junit4_4.5.0.v20090423/junit.jar" />
<!-- SWT jar names are platform dependent -->
<file name="org.eclipse.swt_3.5.0.v3550b.jar" />
</filelist>
<!-- SWT libs, pick up the available SWT jar depending on the platform -->
<filelist id="swt.lib" dir="${ECLIPSE_HOME}/plugins">
<file name="org.eclipse.swt.gtk.linux.x86_3.5.0.v3550b.jar"/>
<file name="org.eclipse.swt.win32.win32.x86_3.5.0.v3550b.jar"/>
</filelist>
<!-- Glazed lists -->
<filelist id="glazedlists.lib" dir="../deps/plugins">
<file name="glazedlists_java15-1.8.0.jar"/>
</filelist>
<!-- Setup Emma (code coverage) -->
<path id="emma.lib">
<pathelement location="${build.tools.dir}/emma.jar" />
<pathelement location="${build.tools.dir}/emma_ant.jar" />
</path>
<taskdef resource="emma_ant.properties" classpathref="emma.lib" />
<!-- Setup findbugs (static analysis) -->
<property name="FINDBUGS_HOME" value="${user.home}/findbugs-1.3.9" />
<path id="findbugs.lib" location="${FINDBUGS_HOME}/lib/findbugs-ant.jar" />
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="findbugs.lib"/>
<path id="build.classpath">
<filelist refid="eclipse.lib" />
<filelist refid="swt.lib" />
<filelist refid="glazedlists.lib" />
<path refid="emma.lib" />
<path refid="build.dependencies" />
</path>
<target name="init" description="Create dirs and copy source">
<mkdir dir="${build.dir}" />
<mkdir dir="${dist.dir}" />
<copy includeemptydirs="false" todir="${build.dir}">
<fileset dir="${src.dir}">
<exclude name="**/*.launch" />
</fileset>
</copy>
</target>
<!-- Clean -->
<target name="clean">
<echo message="Eclipse home: ${ECLIPSE_HOME}" />
<echo message="Findbugs home: ${FINDBUGS_HOME}" />
<delete dir="${target.dir}" />
</target>
<!--
Build
At the conclusion of the build the jars are generated and the class files
are instrumented for recording coverage
-->
<target name="build" depends="init" description="Compile all sources for the module">
<echo message="Building ${basedir}/${src.dir}" />
<javac fork="true" memoryInitialSize="128m" memoryMaximumSize="512m" debug="true" verbose="false"
debuglevel="${debuglevel}" destdir="${build.dir}" srcdir="${src.dir}"
source="${source}" target="${target}">
<src path="${src.dir}" />
<classpath>
<path refid="build.classpath" />
<pathelement location="${build.dir}" />
</classpath>
</javac>
<!--
Build Jars and insrument for code coverage
Emma instruments the classfiles in place. Hence the jar need to be
build before the code is instrumented
-->
<antcall>
<target name="jar" />
<target name="srcjar" />
</antcall>
</target>
<!-- Jar -->
<target name="jar">
<echo message="Creating jar in ${dist.dir}" />
<jar jarfile="${dist.dir}/${jar.file.prefix}_${version}.${datetime.stamp}.jar" manifest="${basedir}/META-INF/MANIFEST.MF">
<fileset dir="${build.dir}">
<exclude name="**/*.java" />
</fileset>
<manifest>
<attribute name="Build-date" value="${datetime.stamp}"/>
</manifest>
</jar>
</target>
<!-- Source Jar -->
<target name="srcjar" unless="no.source.jar">
<echo message="Creating source jar in ${dist.dir}" />
<jar jarfile="${dist.dir}/${jar.file.prefix}.source_${version}.${datetime.stamp}.jar" manifest="${basedir}/META-INF/MANIFEST.MF">
<fileset dir="${build.dir}"/>
<manifest>
<attribute name="Build-date" value="${datetime.stamp}"/>
</manifest>
</jar>
</target>
<!-- Junit Test -->
<target name="test">
<echo message="Instrumenting code in ${basedir}" />
<antcall target="emma.instrument" />
<echo message="Running tests in ${basedir}" />
<mkdir dir="${emma.metadata.dir}" />
<mkdir dir="${junit.reports.dir}" />
<junit printsummary="yes" haltonerror="no" showoutput="true" fork="true">
<classpath>
<path refid="build.classpath" />
<pathelement location="${build.dir}" />
</classpath>
<!-- Plug in emma code coverage -->
<jvmarg value="-Demma.coverage.out.file=${emma.metadata.dir}/coverage.emma" />
<jvmarg value="-Demma.coverage.out.merge=true" />
<jvmarg value="-Dosgi.bundlefile.limit=100"/>
<formatter type="xml" />
<batchtest todir="${junit.reports.dir}">
<fileset dir="${build.dir}" includes="**/*Test.class" />
</batchtest>
</junit>
<!-- Create pretty report(s) -->
<antcall target="junit.report"/>
<antcall target="findbugs" />
</target>
<!--
Emma. Instrument the code for coverage analysis
Test files are not instrumented. This is truned off by setting the do.not.instrument
property in the test projects
-->
<target name="emma.instrument" unless="do.not.instrument">
<emma enabled="true">
<!-- Modifies the class files in place -->
<instr metadatafile="${emma.metadata.dir}/metadata.emma"
merge="true" mode="overwrite">
<instrpath>
<pathelement location="${build.dir}" />
</instrpath>
<!-- exclude UI classes -->
<filter includes="org.eclipse.nebula.widgets.*" excludes="**/*Dialog.class" />
</instr>
</emma>
</target>
<!--
Find Bugs
Assumes that the jar has been built and is available in the ${dist.dir}
-->
<target name="findbugs" unless="do.not.findbugs">
<echo message="Findbugs home: ${FINDBUGS_HOME}"/>
<mkdir dir="${findbugs.report.dir}"/>
<findbugs home="${FINDBUGS_HOME}/lib" output="xml" outputFile="${findbugs.report.dir}/findbugs-output.xml"
jvmargs="-Xmx256m">
<class location="${dist.dir}" />
<auxClasspath refid="build.classpath"/>
<sourcePath path="${src.dir}" />
</findbugs>
</target>
<!-- JUnit report -->
<target name="junit.report">
<junitreport todir="${junit.reports.dir}">
<fileset dir="${junit.reports.dir}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${junit.reports.dir}/html" />
</junitreport>
</target>
</project>