Index: /trunk/build.xml
===================================================================
--- /trunk/build.xml	(revision 13208)
+++ /trunk/build.xml	(revision 13209)
@@ -21,11 +21,15 @@
         <property name="build.dir" location="${base.dir}/build"/>
         <property name="dist.dir" location="${base.dir}/dist"/>
-        <property name="javacc.home" location="${base.dir}/tools"/>
+        <property name="tools.dir" location="${base.dir}/tools"/>
+        <property name="pmd.dir" location="${tools.dir}/pmd"/>
+        <property name="checkstyle.dir" location="${tools.dir}/checkstyle"/>
+        <property name="spotbugs.dir" location="${tools.dir}/spotbugs"/>
+        <property name="javacc.home" location="${tools.dir}"/>
         <property name="mapcss.dir" location="${src.dir}/org/openstreetmap/josm/gui/mappaint/mapcss"/>
         <property name="proj-build.dir" location="${base.dir}/build2"/>
         <property name="checkstyle-build.dir" location="${base.dir}/build2"/>
         <property name="epsg.output" location="${base.dir}/data/projection/custom-epsg"/>
-        <property name="groovy.jar" location="${base.dir}/tools/groovy-all.jar"/>
-        <property name="error_prone_ant.jar" location="${base.dir}/tools/error_prone_ant.jar"/>
+        <property name="groovy.jar" location="${tools.dir}/groovy-all.jar"/>
+        <property name="error_prone_ant.jar" location="${tools.dir}/error_prone_ant.jar"/>
         <property name="dist.jar" location="${dist.dir}/josm-custom.jar"/>
         <property name="dist-optimized.jar" location="${dist.dir}/josm-custom-optimized.jar"/>
@@ -51,8 +55,8 @@
             <pathelement path="${dist.jar}"/>
             <pathelement path="${groovy.jar}"/>
-            <pathelement path="tools/spotbugs/spotbugs-annotations.jar"/>
+            <pathelement path="${spotbugs.dir}/spotbugs-annotations.jar"/>
         </path>
         <path id="pmd.classpath">
-            <fileset dir="${base.dir}/tools/pmd/">
+            <fileset dir="${pmd.dir}">
                 <include name="*.jar"/>
             </fileset>
@@ -166,5 +170,5 @@
     <target name="mac" depends="init-properties">
         <!-- Using https://bitbucket.org/infinitekind/appbundler to create mac application bundle -->
-        <taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask" classpath="tools/appbundler-1.0ea.jar"/>
+        <taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask" classpath="${tools.dir}/appbundler-1.0ea.jar"/>
         <!-- create MacOS X application bundle -->
         <bundleapp outputdirectory="${bundle.outdir}" name="JOSM" displayname="JOSM" executablename="JOSM" identifier="org.openstreetmap.josm"
@@ -196,5 +200,5 @@
 
         <!-- appbundler lacks the possibility of defining our own keys or using a template, so update the .plist manually -->
-        <taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask" classpath="tools/xmltask.jar"/>
+        <taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask" classpath="${tools.dir}/xmltask.jar"/>
 
         <xmltask source="${bundle.outdir}/JOSM.app/Contents/Info.plist" dest="${bundle.outdir}/JOSM.app/Contents/Info.plist" indent="false">
@@ -388,4 +392,5 @@
         <delete dir="${src.dir}/org/openstreetmap/josm/data/imagery/types"/>
         <delete file="${epsg.output}"/>
+        <delete file="${pmd.dir}/cache"/>
     </target>
     <macrodef name="init-test-preferences">
@@ -406,5 +411,5 @@
         <init-test-preferences testfamily="functional"/>
         <init-test-preferences testfamily="performance"/>
-        <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="tools/jacocoant.jar" />
+        <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="${tools.dir}/jacocoant.jar" />
     </target>
     <target name="test-clean" depends="init-properties">
@@ -544,5 +549,5 @@
     </target>
     <target name="dist-optimized" depends="dist">
-        <taskdef resource="proguard/ant/task.properties" classpath="tools/proguard.jar"/>
+        <taskdef resource="proguard/ant/task.properties" classpath="${tools.dir}/proguard.jar"/>
         <proguard>
         -injars ${dist.jar}
@@ -599,5 +604,5 @@
         <!-- generate difference report between optimized jar and normal one -->
         <exec executable="perl" dir="${basedir}">
-            <arg value="tools/japicc/japi-compliance-checker.pl"/>
+            <arg value="${tools.dir}/japicc/japi-compliance-checker.pl"/>
             <arg value="--lib=JOSM"/>
             <arg value="--keep-internal"/>
@@ -614,5 +619,5 @@
         <property name="dir" value="plugin-check"/>
         <typedef uri="antlib:org.codehaus.mojo.animal_sniffer">
-            <classpath path="tools/animal-sniffer-ant-tasks.jar"/>
+            <classpath path="${tools.dir}/animal-sniffer-ant-tasks.jar"/>
         </typedef>
         <mkdir dir="${dir}"/>
@@ -745,5 +750,5 @@
         <sequential>
             <echo message="Generating Taginfo for type @{type} to @{output}"/>
-            <groovy src="${taginfoextract}" classpath="${dist.jar}:tools/spotbugs/spotbugs-annotations.jar">
+            <groovy src="${taginfoextract}" classpath="${dist.jar}:${spotbugs.dir}/spotbugs-annotations.jar">
                 <arg value="-t"/>
                 <arg value="@{type}"/>
@@ -759,5 +764,5 @@
 
     <target name="taginfo" depends="dist">
-        <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpath="${groovy.jar};tools/commons-cli-1.3.1.jar"/>
+        <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpath="${groovy.jar};${tools.dir}/commons-cli-1.3.1.jar"/>
         <property name="taginfoextract" value="scripts/TagInfoExtract.groovy"/>
         <property name="imgurlprefix" value="http://josm.openstreetmap.de/download/taginfo/taginfo-img"/>
@@ -768,5 +773,5 @@
 
     <target name="imageryindex" depends="init-properties">
-        <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpath="${groovy.jar};tools/commons-cli-1.3.1.jar"/>
+        <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpath="${groovy.jar};${tools.dir}/commons-cli-1.3.1.jar"/>
         <echo message="Checking editor imagery difference"/>
         <groovy src="scripts/SyncEditorLayerIndex.groovy" classpath="${dist.jar}">
@@ -803,14 +808,14 @@
     <target name="checkstyle-compile" depends="init-properties">
         <mkdir dir="${checkstyle-build.dir}"/>
-        <javac sourcepath="" srcdir="${base.dir}/tools/checkstyle/src" failonerror="true"
+        <javac sourcepath="" srcdir="${checkstyle.dir}/src" failonerror="true"
             destdir="${checkstyle-build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on"
             includeantruntime="false" createMissingPackageInfoClass="false"
-            encoding="UTF-8" classpath="tools/checkstyle/checkstyle-all.jar">
+            encoding="UTF-8" classpath="${checkstyle.dir}/checkstyle-all.jar">
         </javac>
     </target>
     <target name="checkstyle" depends="checkstyle-compile">
         <taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties"
-             classpath="tools/checkstyle/checkstyle-all.jar:${checkstyle-build.dir}"/>
-        <checkstyle config="tools/checkstyle/josm_checks.xml">
+             classpath="${checkstyle.dir}/checkstyle-all.jar:${checkstyle-build.dir}"/>
+        <checkstyle config="${checkstyle.dir}/josm_checks.xml">
             <fileset dir="${base.dir}/src/org/openstreetmap/josm" includes="**/*.java"
                 excludes="gui/mappaint/mapcss/parsergen/*.java"/>
@@ -822,7 +827,7 @@
 
     <target name="spotbugs" depends="dist">
-        <taskdef name="spotbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpath="tools/spotbugs/spotbugs-ant.jar"/>
+        <taskdef name="spotbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpath="${spotbugs.dir}/spotbugs-ant.jar"/>
         <path id="spotbugs-classpath">
-            <fileset dir="${base.dir}/tools/spotbugs/">
+            <fileset dir="${spotbugs.dir}">
                 <include name="*.jar"/>
             </fileset>
@@ -833,5 +838,5 @@
                 classpath="${spotbugs-classpath}"
                 pluginList=""
-                excludeFilter="tools/spotbugs/josm-filter.xml"
+                excludeFilter="${spotbugs.dir}/josm-filter.xml"
                 effort="max"
                 reportLevel="low"
@@ -844,7 +849,7 @@
     <target name="pmd" depends="init-properties">
         <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpath="${toString:pmd.classpath}"/>
-        <pmd shortFilenames="true" cacheLocation="tools/pmd/cache" encoding="UTF-8">
+        <pmd shortFilenames="true" cacheLocation="${pmd.dir}/cache" encoding="UTF-8">
             <sourceLanguage name="java" version="${java.lang.version}" />
-            <ruleset>${base.dir}/tools/pmd/josm-ruleset.xml</ruleset>
+            <ruleset>${pmd.dir}/josm-ruleset.xml</ruleset>
             <formatter type="text" toConsole="true" />
             <formatter type="xml" toFile="pmd-josm.xml">
