Index: applications/editors/josm/plugins/openlayers/build.xml
===================================================================
--- applications/editors/josm/plugins/openlayers/build.xml	(revision 13582)
+++ applications/editors/josm/plugins/openlayers/build.xml	(revision 14125)
@@ -1,71 +1,62 @@
 <project name="openlayers" default="dist" basedir=".">
-<!-- josm "user home" directory depends on the platform used (windows has a different place than unix/linux) -->
-    <property environment="env"/>
-    <condition property="josm.home.dir" value="${env.APPDATA}/JOSM" else="${user.home}/.josm">
-        <and>
-            <os family="windows"/>
-        </and>
-    </condition>
-<!-- compilation properties -->
-    <property name="josm.build.dir"   value="../../core"/>
-    <property name="josm.plugins.dir" value="${josm.home.dir}/plugins"/>
-    <property name="josm"             location="../../core/dist/josm-custom.jar" />
-    <property name="plugin.build.dir" value="build"/>
-    <property name="plugin.dist.dir"  value="../../dist"/>
-    <property name="plugin.name"      value="${ant.project.name}"/>
-    <property name="plugin.jar"       value="../../dist/${plugin.name}.jar"/>
+    <property name="josm"                   location="../../core/dist/josm-custom.jar"/>
+    <property name="plugin.dist.dir"        value="../../dist"/>
+    <property name="plugin.build.dir"       value="build"/>
+    <property name="plugin.jar"             value="${plugin.dist.dir}/${ant.project.name}.jar"/>
     <property name="ant.build.javac.target" value="1.5"/>
-<!-- All jar files needed -->
-    <fileset id="required_libs" dir="lib">
-        <include name="cobra.jar"/>
-        <include name="js.jar"/>
-        <include name="ehcache-1.4.1.jar"/>
-        <include name="backport-util-concurrent-3.0.jar"/>
-<!-- needed by ehcache -->
-        <include name="commons-logging-1.0.4.jar"/>
-<!--needed by ehcache -->
-    </fileset>
     <target name="init">
-        <mkdir dir="build"></mkdir>
-        <mkdir dir="dist"></mkdir>
+        <mkdir dir="${plugin.build.dir}"/>
     </target>
     <target name="compile" depends="init">
         <echo message="creating ${plugin.jar}"/>
-        <javac srcdir="src" debug="true" destdir="build">
+        <javac srcdir="src" debug="true" destdir="${plugin.build.dir}">
+            <compilerarg value="-Xlint:deprecation"/>
+            <compilerarg value="-Xlint:unchecked"/>
             <classpath>
-                <path path="../../core/dist/josm-custom.jar"/>
-                <fileset refid="required_libs"/>
+                <pathelement location="${josm}"/>
+                <fileset dir="lib">
+                    <include name="**/*.jar"/>
+                </fileset>
             </classpath>
         </javac>
     </target>
-    <target name="dist" depends="compile">
-<!-- jars -->
-<!-- TODO: instead of adding library code to the plugin jar, JOSM should
-         have some kind of library dir loaded in the classpath -->
-        <unjar dest="build">
-            <fileset refid="required_libs" />
+    <target name="dist" depends="compile,revision">
+        <unjar dest="${plugin.build.dir}">
+            <fileset dir="lib"/>
         </unjar>
-<!-- images -->
-        <copy todir="build/images">
-            <fileset dir="images" />
+        <copy todir="${plugin.build.dir}/resources">
+            <fileset dir="resources"/>
         </copy>
-<!--resources -->
-        <copy todir="build/resources">
-            <fileset dir="resources" />
+        <copy todir="${plugin.build.dir}/images">
+            <fileset dir="images"/>
         </copy>
-<!-- create josm-custom.jar -->
-        <jar destfile="${plugin.jar}" basedir="build">
+        <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
             <manifest>
                 <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.openLayers.OpenLayersPlugin" />
                 <attribute name="Plugin-Description" value="Displays an OpenLayers background image" />
-                <attribute name="Class-Path" value="cobra.jar js.jar ehcache-1.4.1.jar commons-logging-1.0.4.jar backport-util-concurrent-3.0.jar" />
             </manifest>
         </jar>
     </target>
+    <target name="revision">
+        <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
+            <env key="LANG" value="C"/>
+            <arg value="info"/>
+            <arg value="--xml"/>
+            <arg value="."/>
+        </exec>
+        <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
+        <delete file="REVISION"/>
+    </target>
     <target name="clean">
-        <delete dir="${plugin.build.dir}" />
-        <delete file="${plugin.jar}" />
+        <delete dir="${plugin.build.dir}"/>
+        <delete file="${plugin.jar}"/>
     </target>
     <target name="install" depends="dist">
+        <property environment="env"/>
+        <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
+            <and>
+                <os family="windows"/>
+            </and>
+        </condition>
         <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
     </target>
