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

Last change on this file since 34022 was 34010, checked in by donvip, 7 years ago

disable StringSplitter warning

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