source: osm/applications/editors/josm/plugins/build-common.xml@ 34240

Last change on this file since 34240 was 34225, checked in by holgermappt, 7 years ago

Do not distribute plugin-sources.jar and plugin-javadoc.jar. This reverts some of the changes introduced in r34045.

File size: 29.3 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3** Template for the build targets common to all plugins
4** ====================================================
5**
6** To override a property, add it to the plugin build.xml _before_
7** this template has been imported.
8** To override a target, add it _after_ this template has been imported.
9**
10** Paths are relative to the build.xml that imports this template.
11**
12-->
13<project name="plugin_common" basedir="." xmlns:jacoco="antlib:org.jacoco.ant" xmlns:if="ant:if">
14
15 <property name="josm" location="../../core/dist/josm-custom.jar"/>
16 <property name="josm.test.build.dir" location="../../core/test/build"/>
17 <property name="error_prone_ant.jar" location="../00_core_tools/error_prone_ant.jar"/>
18 <property name="checkstyle.jar" location="../00_core_tools/checkstyle/checkstyle-all.jar"/>
19 <property name="checkstyle-build.dir" location="../00_core_tools/checkstyle/build"/>
20 <property name="spotbugs-ant.jar" location="../00_core_tools/spotbugs/spotbugs-ant.jar"/>
21 <property name="annotations.jar" location="../00_core_tools/spotbugs/spotbugs-annotations.jar"/>
22 <property name="plugin.build.dir" location="build"/>
23 <property name="plugin.test.dir" location="test"/>
24 <property name="plugin.src.dir" location="src"/>
25 <property name="plugin.doc.dir" location="javadoc"/>
26 <property name="plugin.lib.dir" location="lib"/>
27 <!-- this is the directory where the plugin jar is copied to -->
28 <property name="plugin.dist.dir" location="../../dist"/>
29 <property name="ant.build.javac.target" value="1.8"/>
30 <property name="ant.build.javac.source" value="1.8"/>
31 <property name="plugin.jar" location="${plugin.dist.dir}/${ant.project.name}.jar"/>
32 <property name="javac.compiler" value="com.google.errorprone.ErrorProneAntCompilerAdapter" />
33
34 <!-- For Windows-specific stuff -->
35 <condition property="isWindows">
36 <os family="Windows"/>
37 </condition>
38 <!-- For Java9-specific stuff -->
39 <condition property="isJava9">
40 <matches string="${ant.java.version}" pattern="(1.)?9" />
41 </condition>
42 <target name="-jaxb_before9" unless="isJava9">
43 <property name="xjc" value="${java.home}${file.separator}..${file.separator}bin${file.separator}xjc" />
44 </target>
45 <target name="-jaxb_after9" if="isJava9">
46 <property name="xjc" value="${java.home}${file.separator}bin${file.separator}xjc" />
47 </target>
48
49 <!-- To be overriden in plugin build file before inclusion if other plugins are required -->
50 <fileset id="plugin.requires.jars" dir="${plugin.dist.dir}" includes="nothing"/>
51
52 <path id="plugin.classpath">
53 <pathelement location="${josm}"/>
54 <fileset dir="${plugin.lib.dir}" erroronmissingdir="no">
55 <include name="**/*.jar"/>
56 <exclude name="**/*-sources.jar"/>
57 <exclude name="**/*-javadoc.jar"/>
58 </fileset>
59 <fileset refid="plugin.requires.jars"/>
60 </path>
61
62 <!--
63 **********************************************************
64 ** init - initializes the build
65 **********************************************************
66 -->
67 <target name="init">
68 <mkdir dir="${plugin.build.dir}"/>
69 </target>
70 <!--
71 **********************************************************
72 ** compile - compiles the source tree
73 **********************************************************
74 -->
75 <target name="pre-compile">
76 <!-- to be overidden by plugins that need to perform additional tasks before compiling -->
77 </target>
78 <target name="compile" depends="init, pre-compile" unless="skip-compile">
79 <echo message="compiling sources for ${plugin.jar} ..."/>
80 <javac compiler="${javac.compiler}" srcdir="${plugin.src.dir}" debug="true" destdir="${plugin.build.dir}" includeantruntime="false" encoding="UTF-8">
81 <compilerclasspath>
82 <pathelement location="${error_prone_ant.jar}"/>
83 </compilerclasspath>
84 <compilerarg value="-Xlint:deprecation"/>
85 <compilerarg value="-Xlint:unchecked"/>
86 <compilerarg value="-Xep:StringSplitter:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
87 <compilerarg value="-Xep:ReferenceEquality:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
88 <compilerarg value="-Xep:InsecureCryptoUsage:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
89 <compilerarg value="-Xep:FutureReturnValueIgnored:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
90 <compilerarg value="-Xep:JdkObsolete:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
91 <compilerarg line="-Xmaxwarns 1000"/>
92 <classpath refid="plugin.classpath"/>
93 </javac>
94 </target>
95 <!--
96 **********************************************************
97 ** setup-dist - copies files for distribution
98 **********************************************************
99 -->
100 <target name="setup-dist-default">
101 <copy todir="${plugin.build.dir}/resources" failonerror="no" includeemptydirs="no">
102 <fileset dir="resources"/>
103 </copy>
104 <copy todir="${plugin.build.dir}/images" failonerror="no" includeemptydirs="no">
105 <fileset dir="images"/>
106 </copy>
107 <copy todir="${plugin.build.dir}/data" failonerror="no" includeemptydirs="no">
108 <fileset dir="data"/>
109 </copy>
110 <copy todir="${plugin.build.dir}">
111 <fileset dir=".">
112 <include name="README"/>
113 <include name="LICENSE*"/>
114 <include name="*GPL*"/>
115 </fileset>
116 </copy>
117 </target>
118 <target name="setup-dist">
119 <antcall target="setup-dist-default" />
120 </target>
121 <!--
122 **********************************************************
123 ** dist - creates the plugin jar
124 **********************************************************
125 -->
126 <target name="dist" depends="compile,revision" unless="skip-dist">
127 <echo message="creating ${ant.project.name}.jar ... "/>
128 <antcall target="setup-dist" />
129 <delete file="MANIFEST" failonerror="no"/>
130 <manifest file="MANIFEST" mode="update">
131 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
132 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
133 <attribute name="Plugin-Class" value="${plugin.class}" />
134 <attribute name="Plugin-Description" value="${plugin.description}" />
135 <attribute name="Plugin-Date" value="${version.entry.commit.date}" />
136 <attribute name="Author" value="${plugin.author}"/>
137 </manifest>
138 <antcall target="add-manifest-attribute">
139 <param name="manifest.attribute" value="Plugin-Link"/>
140 <param name="property.name" value="plugin.link"/>
141 <param name="property.value" value="${plugin.link}"/>
142 </antcall>
143 <antcall target="add-manifest-attribute">
144 <param name="manifest.attribute" value="Plugin-Icon"/>
145 <param name="property.name" value="plugin.icon"/>
146 <param name="property.value" value="${plugin.icon}"/>
147 </antcall>
148 <antcall target="add-manifest-attribute">
149 <param name="manifest.attribute" value="Plugin-Early"/>
150 <param name="property.name" value="plugin.early"/>
151 <param name="property.value" value="${plugin.early}"/>
152 </antcall>
153 <antcall target="add-manifest-attribute">
154 <param name="manifest.attribute" value="Plugin-Requires"/>
155 <param name="property.name" value="plugin.requires"/>
156 <param name="property.value" value="${plugin.requires}"/>
157 </antcall>
158 <antcall target="add-manifest-attribute">
159 <param name="manifest.attribute" value="Plugin-Stage"/>
160 <param name="property.name" value="plugin.stage"/>
161 <param name="property.value" value="${plugin.stage}"/>
162 </antcall>
163 <antcall target="add-manifest-attribute">
164 <param name="manifest.attribute" value="Plugin-Canloadatruntime"/>
165 <param name="property.name" value="plugin.canloadatruntime"/>
166 <param name="property.value" value="${plugin.canloadatruntime}"/>
167 </antcall>
168 <antcall target="additional-manifest" />
169 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}" manifest="MANIFEST" manifestencoding="UTF-8">
170 <restrict>
171 <not><or>
172 <name name="META-INF/maven/*"/>
173 <name name="META-INF/DEPENDENCIES"/>
174 <name name="META-INF/LICENSE"/>
175 <name name="META-INF/NOTICE"/>
176 <name name="META-INF/*.RSA"/>
177 <name name="META-INF/*.SF"/>
178 </or></not>
179 <archives>
180 <zips>
181 <fileset dir="${plugin.lib.dir}" includes="*.jar" excludes="*-sources.jar, *-javadoc.jar" erroronmissingdir="no"/>
182 </zips>
183 </archives>
184 </restrict>
185 </jar>
186 <delete file="MANIFEST" failonerror="no"/>
187 <antcall target="post-dist" />
188 </target>
189 <target name="post-dist">
190 <!-- to be overidden by plugins that need to perform additional tasks on resulting jar -->
191 </target>
192 <target name="add-manifest-attribute" depends="check-manifest-attribute" if="have-${property.name}">
193 <manifest file="MANIFEST" mode="update">
194 <attribute name="${manifest.attribute}" value="${property.value}" />
195 </manifest>
196 </target>
197 <!-- target to add additional entries, empty in commons -->
198 <target name="additional-manifest">
199 </target>
200 <target name="check-manifest-attribute">
201 <condition property="have-${property.name}">
202 <and>
203 <isset property="${property.name}"/>
204 <not>
205 <equals arg1="${property.value}" arg2=""/>
206 </not>
207 <not>
208 <equals arg1="${property.value}" arg2="..."/>
209 </not>
210 </and>
211 </condition>
212 </target>
213 <target name="javadoc">
214 <javadoc destdir="${plugin.doc.dir}"
215 sourcepath="${plugin.src.dir}"
216 encoding="UTF-8"
217 windowtitle="JOSM-${ant.project.name}"
218 use="true"
219 private="true"
220 linksource="true"
221 author="false">
222 <classpath refid="plugin.classpath"/>
223 <link href="https://docs.oracle.com/javase/8/docs/api"/>
224 <link href="https://josm.openstreetmap.de/doc"/>
225 <doctitle><![CDATA[<h2>JOSM-${ant.project.name} - Javadoc</h2>]]></doctitle>
226 <bottom><![CDATA[<a href="https://josm.openstreetmap.de/wiki/Plugins">JOSM Plugins</a>]]></bottom>
227 <arg value="--add-exports" if:set="isJava9" />
228 <arg value="javafx.graphics/com.sun.javafx.application=ALL-UNNAMED" if:set="isJava9" />
229 </javadoc>
230 </target>
231 <!--
232 **********************************************************
233 ** revision - extracts the current revision number for the
234 ** file build.number and stores it in the XML property
235 ** version.*
236 **********************************************************
237 -->
238 <!--
239 ** Initializes the REVISION.XML file from SVN information
240 -->
241 <target name="init-svn-revision-xml" unless="skip-revision">
242 <exec append="false" output="REVISION.XML" executable="svn" failifexecutionfails="false" resultproperty="svn.info.result">
243 <env key="LANG" value="C"/>
244 <arg value="info"/>
245 <arg value="--xml"/>
246 <arg value="."/>
247 </exec>
248 <condition property="svn.info.fail">
249 <not>
250 <and>
251 <equals arg1="${svn.info.result}" arg2="0" />
252 <length file="REVISION.XML" when="greater" length="1" />
253 </and>
254 </not>
255 </condition>
256 </target>
257 <!--
258 ** Initializes the REVISION.XML file from git-svn information.
259 Obtains the revision from the git-svn-id field.
260 -->
261 <target name="init-git-svn-revision-xml" if="svn.info.fail" unless="skip-revision">
262 <exec append="false" output="REVISION.XML" executable="git" failifexecutionfails="false" resultproperty="git.svn.info.result">
263 <arg value="log"/>
264 <arg value="-1"/>
265 <arg value="--grep=git-svn-id"/>
266 <!--
267 %B: raw body (unwrapped subject and body)
268 %n: new line
269 %ai: author date, ISO 8601 format
270 -->
271 <arg value="--pretty=format:%B%n%ai"/>
272 <arg value="."/>
273 </exec>
274 <replaceregexp file="REVISION.XML" flags="s"
275 match=".*git-svn-id: [^@]*@([0-9]+).*(\d{4}-\d{2}-\d{2}.\d{2}\:\d{2}\:\d{2}\s*[+-]\d{2}:?\d{2})\s*$"
276 replace="&lt;info&gt;&lt;entry&gt;&lt;commit revision=&quot;\1&quot;&gt;&lt;date&gt;\2&lt;/date&gt;&lt;/commit&gt;&lt;/entry&gt;&lt;/info&gt;"/>
277 <condition property="git.svn.fail">
278 <not>
279 <and>
280 <equals arg1="${git.svn.info.result}" arg2="0" />
281 <length file="REVISION.XML" when="greater" length="1" />
282 </and>
283 </not>
284 </condition>
285 </target>
286 <!--
287 ** Initializes the REVISION.XML file from git (w/o svn) information.
288 Uses Unix date as revision number.
289 -->
290 <target name="init-git-revision-xml" if="git.svn.fail" unless="skip-revision">
291 <exec append="false" output="REVISION.XML" executable="git" failifexecutionfails="false" resultproperty="git.info.result">
292 <arg value="log"/>
293 <arg value="-1"/>
294 <arg value="--pretty=format:%at%n%ai"/>
295 <arg value="."/>
296 </exec>
297 <replaceregexp file="REVISION.XML" flags="s"
298 match="\s*(\d*)\s+(\d{4}-\d{2}-\d{2}.\d{2}\:\d{2}\:\d{2}\s*[+-]\d{2}:?\d{2})\s*$"
299 replace="&lt;info&gt;&lt;entry&gt;&lt;commit revision=&quot;\1&quot;&gt;&lt;date&gt;\2&lt;/date&gt;&lt;/commit&gt;&lt;/entry&gt;&lt;/info&gt;"/>
300 <condition property="git.fail">
301 <not>
302 <and>
303 <equals arg1="${git.info.result}" arg2="0" />
304 <length file="REVISION.XML" when="greater" length="1" />
305 </and>
306 </not>
307 </condition>
308 </target>
309 <target name="init-revision-fallback" if="git.fail" unless="skip-revision">
310 <tstamp>
311 <format property="current.time" pattern="yyyy-MM-dd'T'HH:mm:ss.SSS" />
312 </tstamp>
313 <echo file="REVISION.XML"><![CDATA[<info><entry><commit revision="UNKNOWN"><date>${current.time}</date></commit></entry></info>]]></echo>
314 </target>
315 <target name="revision" depends="init-svn-revision-xml, init-git-svn-revision-xml, init-git-revision-xml, init-revision-fallback" unless="skip-revision">
316 <xmlproperty file="REVISION.XML" prefix="version" keepRoot="false" collapseAttributes="true"/>
317 <delete file="REVISION.XML"/>
318 </target>
319 <!--
320 **********************************************************
321 ** clean - clean up the build environment
322 **********************************************************
323 -->
324 <target name="clean">
325 <delete dir="${plugin.build.dir}"/>
326 <delete dir="${plugin.doc.dir}"/>
327 <delete dir="${checkstyle-build.dir}"/>
328 <delete file="${plugin.jar}"/>
329 </target>
330 <!--
331 **********************************************************
332 ** install - install the plugin in your local JOSM installation
333 **********************************************************
334 -->
335 <target name="install" depends="dist">
336 <property environment="env"/>
337 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins">
338 <and>
339 <os family="windows"/>
340 </and>
341 </condition>
342 <condition property="josm.plugins.dir" value="${user.home}/Library/JOSM/plugins">
343 <and>
344 <os family="mac"/>
345 </and>
346 </condition>
347 <condition property="josm.plugins.dir" value="${user.home}/.josm/plugins">
348 <and>
349 <not><os family="windows"/></not>
350 <not><os family="mac"/></not>
351 </and>
352 </condition>
353 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
354 </target>
355 <!--
356 ************************** Publishing the plugin ***********************************
357 -->
358 <!--
359 ** extracts the JOSM release for the JOSM version in ../core and saves it in the
360 ** property ${coreversion.info.entry.revision}
361 **
362 -->
363 <target name="core-info">
364 <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
365 <env key="LANG" value="C"/>
366 <arg value="info"/>
367 <arg value="--xml"/>
368 <arg value="../../core"/>
369 </exec>
370 <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
371 <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
372 <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
373 <delete file="core.info.xml"/>
374 </target>
375 <!--
376 ** commits the source tree for this plugin
377 -->
378 <target name="commit-current">
379 <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
380 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
381 <env key="LANG" value="C"/>
382 <arg value="commit"/>
383 <arg value="-m"/>
384 <arg value="${commit.message}"/>
385 <arg value="."/>
386 </exec>
387 </target>
388 <!--
389 ** updates (svn up) the source tree for this plugin
390 -->
391 <target name="update-current">
392 <echo>Updating plugin source ...</echo>
393 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
394 <env key="LANG" value="C"/>
395 <arg value="up"/>
396 <arg value="."/>
397 </exec>
398 <echo>Updating ${plugin.jar} ...</echo>
399 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
400 <env key="LANG" value="C"/>
401 <arg value="up"/>
402 <arg value="${plugin.jar}"/>
403 </exec>
404 </target>
405 <!--
406 ** commits the plugin.jar
407 -->
408 <target name="commit-dist">
409 <echo>
410 ***** Properties of published ${plugin.jar} *****
411 Commit message : '${commit.message}'
412 Plugin-Mainversion: ${plugin.main.version}
413 JOSM build version: ${coreversion.info.entry.revision}
414 Plugin-Version : ${version.entry.commit.revision}
415 ***** / Properties of published ${plugin.jar} *****
416
417 Now commiting ${plugin.jar} ...
418 </echo>
419 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
420 <env key="LANG" value="C"/>
421 <arg value="-m"/>
422 <arg value="${commit.message}"/>
423 <arg value="commit"/>
424 <arg value="${plugin.jar}"/>
425 </exec>
426 </target>
427 <!-- ** make sure svn is present as a command line tool ** -->
428 <target name="ensure-svn-present">
429 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
430 <env key="LANG" value="C"/>
431 <arg value="--version"/>
432 </exec>
433 <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
434 <!-- return code not set at all? Most likely svn isn't installed -->
435 <condition>
436 <not>
437 <isset property="svn.exit.code"/>
438 </not>
439 </condition>
440 </fail>
441 <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
442 <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
443 <condition>
444 <isfailure code="${svn.exit.code}"/>
445 </condition>
446 </fail>
447 </target>
448
449 <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
450 </target>
451
452 <path id="test.classpath">
453 <fileset dir="../00_core_test_lib">
454 <include name="**/*.jar"/>
455 </fileset>
456 <fileset dir="${plugin.test.dir}/lib" erroronmissingdir="no">
457 <include name="**/*.jar"/>
458 <exclude name="**/*-sources.jar"/>
459 <exclude name="**/*-javadoc.jar"/>
460 </fileset>
461 <fileset dir="lib" erroronmissingdir="no">
462 <include name="**/*.jar"/>
463 <exclude name="**/*-sources.jar"/>
464 <exclude name="**/*-javadoc.jar"/>
465 </fileset>
466 <pathelement path="${plugin.test.dir}/data"/>
467 <pathelement path="${josm.test.build.dir}/unit"/>
468 <pathelement path="${josm}"/>
469 <pathelement path="${plugin.jar}"/>
470 <pathelement path="${annotations.jar}"/>
471 </path>
472 <macrodef name="init-test-preferences">
473 <sequential>
474 <copy file="../00_core_test_config/preferences.template.xml" tofile="../00_core_test_config/unit-josm.home/preferences.xml"/>
475 <replace file="../00_core_test_config/unit-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_USERNAME@" value="${osm.username}"/>
476 <replace file="../00_core_test_config/unit-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_PASSWORD@" value="${osm.password}"/>
477 </sequential>
478 </macrodef>
479 <target name="check-test">
480 <available file="${plugin.test.dir}" type="dir" property="test.present"/>
481 </target>
482 <target name="test-init" depends="check-test" if="test.present">
483 <mkdir dir="${plugin.test.dir}/build"/>
484 <mkdir dir="${plugin.test.dir}/build/unit"/>
485 <mkdir dir="${plugin.test.dir}/report"/>
486 <init-test-preferences/>
487 </target>
488 <target name="test-clean">
489 <delete dir="${plugin.test.dir}/build"/>
490 <delete dir="${plugin.test.dir}/report"/>
491 <delete file="${plugin.test.dir}/jacoco.exec" />
492 <delete file="../00_core_test_config/unit-josm.home/preferences.xml" />
493 <delete dir="../00_core_test_config/unit-josm.home/cache" failonerror="false"/>
494 </target>
495 <target name="test-compile" depends="test-init,dist" if="test.present">
496 <sequential>
497 <javac debug="on" includeantruntime="false" srcdir="${plugin.test.dir}/unit" destdir="${plugin.test.dir}/build/unit" encoding="UTF-8">
498 <classpath>
499 <fileset refid="plugin.requires.jars"/>
500 <path refid="test.classpath"/>
501 </classpath>
502 <compilerarg value="-Xlint:all"/>
503 <compilerarg value="-Xlint:-serial"/>
504 </javac>
505 </sequential>
506 </target>
507 <target name="test" depends="dist, test-clean, test-compile" if="test.present"
508 description="Run unit tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
509 <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="../00_core_tools/jacocoant.jar" />
510 <sequential>
511 <echo message="Running unit tests with JUnit"/>
512 <jacoco:coverage destfile="${plugin.test.dir}/jacoco.exec">
513 <junit printsummary="yes" fork="true" forkmode="once" dir="${basedir}">
514 <jvmarg value="-Dfile.encoding=UTF-8"/>
515 <jvmarg value="--add-opens" if:set="isJava9" />
516 <jvmarg value="java.base/java.lang.reflect=ALL-UNNAMED" if:set="isJava9" />
517 <jvmarg value="--add-opens" if:set="isJava9" />
518 <jvmarg value="java.desktop/javax.imageio.spi=ALL-UNNAMED" if:set="isJava9" />
519 <jvmarg value="--add-exports" if:set="isJava9" />
520 <jvmarg value="java.desktop/com.sun.imageio.spi=ALL-UNNAMED" if:set="isJava9" />
521 <sysproperty key="josm.home" value="../00_core_test_config/unit-josm.home"/>
522 <sysproperty key="josm.test.data" value="${plugin.test.dir}/data"/>
523 <sysproperty key="java.awt.headless" value="true"/>
524 <sysproperty key="suppressPermanentFailure" value="${suppressPermanentFailure}"/>
525 <classpath>
526 <fileset refid="plugin.requires.jars"/>
527 <path refid="test.classpath"/>
528 <pathelement path="${plugin.test.dir}/build/unit"/>
529 </classpath>
530 <formatter type="plain"/>
531 <formatter type="xml"/>
532 <batchtest fork="yes" todir="${plugin.test.dir}/report">
533 <fileset dir="${plugin.test.dir}/build/unit" includes="**/*Test.class"/>
534 </batchtest>
535 </junit>
536 </jacoco:coverage>
537 </sequential>
538 </target>
539
540 <target name="checkstyle-compile">
541 <mkdir dir="${checkstyle-build.dir}"/>
542 <javac sourcepath="" srcdir="../00_core_tools/checkstyle/src" failonerror="true"
543 destdir="${checkstyle-build.dir}" target="${ant.build.javac.target}" source="${ant.build.javac.source}" debug="on"
544 includeantruntime="false" createMissingPackageInfoClass="false"
545 encoding="UTF-8" classpath="${checkstyle.jar}">
546 </javac>
547 </target>
548 <target name="checkstyle" depends="checkstyle-compile">
549 <taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties" classpath="${checkstyle.jar}:${checkstyle-build.dir}"/>
550 <checkstyle config="${basedir}/../00_core_tools/checkstyle/josm_checks.xml">
551 <fileset dir="${basedir}/src" includes="**/*.java" excludes="boofcv/**/*.java,
552 com/google/**/*.java,
553 crosby/**/*.java,
554 edu/princeton/**/*.java,
555 net/boplicity/**/*.java,
556 org/apache/**/*.java,
557 org/dinopolis/**/*.java,
558 org/kaintoch/**/*.java,
559 org/marvinproject/**/*.java,
560 org/netbeans/**/*.java,
561 org/openstreetmap/josm/plugins/dataimport/io/tcx/**/*.java,
562 org/openstreetmap/josm/plugins/ohe/parser/**/*.java,
563 org/openstreetmap/josm/plugins/roadsigns/javacc/**/*.java,
564 org/osgeo/**/*.java,
565 pdfimport/pdfbox/operators/**/*.java
566 "/>
567 <fileset dir="${basedir}/test" includes="**/*.java" erroronmissingdir="false"/>
568 <formatter type="xml" toFile="checkstyle-josm-${ant.project.name}.xml"/>
569 </checkstyle>
570 </target>
571
572 <target name="spotbugs" depends="compile">
573 <taskdef name="spotbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpath="${spotbugs-ant.jar}"/>
574 <path id="spotbugs-classpath">
575 <fileset dir="../00_core_tools/spotbugs/">
576 <include name="*.jar"/>
577 </fileset>
578 </path>
579 <property name="spotbugs-classpath" refid="spotbugs-classpath"/>
580 <spotbugs output="xml"
581 outputFile="spotbugs-josm-${ant.project.name}.xml"
582 classpath="${spotbugs-classpath}"
583 pluginList=""
584 excludeFilter="../spotbugs-filter.xml"
585 effort="less"
586 reportLevel="low"
587 jvmargs="-Xmx3072m"
588 >
589 <auxClasspath refid="plugin.classpath" />
590 <sourcePath path="${basedir}/src" />
591 <class location="${plugin.build.dir}" />
592 </spotbugs>
593 </target>
594
595 <target name="runjosm" depends="install">
596 <java jar="${josm}" fork="true"/>
597 </target>
598
599 <target name="profilejosm" depends="install">
600 <nbprofiledirect>
601 </nbprofiledirect>
602 <java jar="${josm}" fork="true">
603 <jvmarg value="${profiler.info.jvmargs.agent}"/>
604 </java>
605 </target>
606 <!--
607 ** shows a help text
608 -->
609 <target name="help">
610 <echo>
611 You can use following targets:
612 * dist This default target builds the plugin jar file
613 * clean Cleanup automatical created files
614 * test Run unit tests (if any)
615 * publish Checkin source code, build jar and checkin plugin jar
616 (requires proper entry for SVN commit message!)
617 * install Install the plugin in current system
618 * runjosm Install plugin and start josm
619 * profilejosm Install plugin and start josm in profiling mode
620
621 There are other targets, which usually should not be called manually.
622 </echo>
623 </target>
624</project>
Note: See TracBrowser for help on using the repository browser.