Package: josm / 0.0.svn19369+dfsg-2

00-build.patch Patch series | download
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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
Description: Adjustments to the ant build.xml file.
 Mainly to use system-provided JARs and not depend on Internet connection.
 Also adds support to build the translations in the i18n directory.
 The Debian package build is identified using the Build-Name in the REVISION
 file and is not considered local build.
Author: Giovanni Mascellani <gio@debian.org>
Author: Bas Couwenberg <sebastic@debian.org>
Forwarded: not-needed

--- a/build.xml
+++ b/build.xml
@@ -23,12 +23,14 @@
         <property name="tools.ivy" location="${tools.dir}/ivy.xml"/>
         <property name="ivy.jar.dir" location="${tools.dir}/ivy"/>
         <property name="ivy.jar.file" location="${ivy.jar.dir}/ivy-${ivy.version}.jar"/>
+<!--
         <mkdir dir="${ivy.jar.dir}"/>
         <get src="https://josm.openstreetmap.de/repository/public/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar"
              dest="${ivy.jar.file}"
              skipexisting="true"
         />
         <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpath="${ivy.jar.file}"/>
+-->
     </target>
     <target name="init-properties" description="Initialize properties for the build">
         <property environment="env"/>
@@ -72,6 +74,7 @@
         <property name="proj-build.dir" location="${base.dir}/build2"/>
         <property name="script-build.dir" location="${base.dir}/build2"/>
         <property name="epsg.output" location="${resources.dir}/data/projection/custom-epsg"/>
+        <property name="antcontrib.jar" value="/usr/share/java/ant-contrib.jar"/>
         <property name="commons-lang3.jar" location="${tools.dir}/commons-lang3.jar"/>
         <property name="dist.jar" location="${dist.dir}/josm-custom.jar"/>
         <property name="dist-optimized.jar" location="${dist.dir}/josm-custom-optimized.jar"/>
@@ -111,6 +114,14 @@
             </not>
         </condition>
         <property name="java.library.dir" value="jmods" />
+        <!-- Java classpath addition (all jar files to compile tests with this) -->
+        <path id="classpath">
+            <fileset dir="/usr/share/java">
+                <include name="gettext-commons.jar"/>
+                <include name="jmapviewer.jar"/>
+            </fileset>
+        </path>
+        <property name="classpathprop-colon" refid="classpath"/>
     </target>
     <target name="init-svn-revision-xml" if="svn.present" depends="init-properties"
             description="Initialize the REVISION.XML file from SVN information">
@@ -139,10 +150,9 @@
                        match=".*git-svn-id: [^@]*@([0-9]+).*(\d{4}-\d{2}-\d{2}.\d{2}\:\d{2}\:\d{2}\s*[+-]\d{2}:?\d{2})\s*$"
                        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;"/>
     </target>
-    <target name="create-revision" depends="init-properties,init-svn-revision-xml,init-git-revision-xml"
+    <target name="create-revision"
             description="Create the REVISION file to be included in the distribution based on the latest SVN/Git commit">
-        <xmlproperty file="${base.dir}/REVISION.XML" prefix="version" keepRoot="false" collapseAttributes="true"/>
-        <delete file="${base.dir}/REVISION.XML"/>
+        <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
         <tstamp>
             <format property="build.tstamp" pattern="yyyy-MM-dd HH:mm:ss"/>
         </tstamp>
@@ -153,9 +163,9 @@
 # automatically generated by JOSM build.xml - do not edit
 Revision: ${version.entry.commit.revision}
 Build-Date: ${build.tstamp}
-</echo>
-        <echo unless:set="releasebuild" file="${resources.dir}/REVISION" append="true">
-        Is-Local-Build: true
+Is-Local-Build: false
+Build-Name: Debian
+Debian-Release: ${debian.version}
 </echo>
     </target>
     <target name="check-schemas" unless="check-schemas.notRequired" depends="init-properties"
@@ -164,7 +174,7 @@ Build-Date: ${build.tstamp}
             <schema namespace="http://josm.openstreetmap.de/tagging-preset-1.0" file="${resources.dir}/data/tagging-preset.xsd" />
         </schemavalidate>
     </target>
-    <target name="dist" depends="compile,extract-libraries,epsg,copy-resources,check-schemas"
+    <target name="dist" depends="compile,epsg,copy-resources,check-schemas"
             description="Main target that builds JOSM and checks XML against schemas">
         <echo>Revision ${version.entry.commit.revision}</echo>
         <copy file="CONTRIBUTION" todir="${build.dir}"/>
@@ -173,7 +183,7 @@ Build-Date: ${build.tstamp}
         <copy file="gpl-2.0.txt" todir="${build.dir}"/>
         <copy file="gpl-3.0.txt" todir="${build.dir}"/>
         <!-- create josm-custom.jar -->
-        <delete file="${dist.jar}"/>
+        <propertyregex property="classpathprop" input="${classpathprop-colon}" global="true" regexp=":" replace=" "/>
         <jar destfile="${dist.jar}" basedir="${build.dir}" level="${clevel}">
             <!-- add attribute excludes="**/*BZip2*,**/*Bzip2*" to create a non-bzip2 supporting jar -->
             <manifest>
@@ -183,30 +193,134 @@ Build-Date: ${build.tstamp}
                 <attribute name="Permissions" value="all-permissions"/>
                 <attribute name="Codebase" value="josm.openstreetmap.de"/>
                 <attribute name="Application-Name" value="JOSM - Java OpenStreetMap Editor"/>
+                <attribute name="Debian-Release" value="${debian.version}"/>
+                <attribute name="Class-Path" value="${classpathprop}"/>
                 <!-- Java 9 stuff. Entries are safely ignored by Java 8 -->
                 <attribute name="Add-Exports" value="java.base/sun.security.action java.desktop/com.apple.eawt java.desktop/com.sun.imageio.spi java.desktop/com.sun.imageio.plugins.jpeg javafx.graphics/com.sun.javafx.application jdk.deploy/com.sun.deploy.config" />
                 <attribute name="Add-Opens" value="java.base/java.lang java.base/java.nio java.base/jdk.internal.loader java.base/jdk.internal.ref java.desktop/javax.imageio.spi java.desktop/javax.swing.text.html java.prefs/java.util.prefs" />
                 <!-- Indicate that this jar may have version specific classes. Only used in Java9+. -->
                 <attribute name="Multi-Release" value="true"/>
             </manifest>
+            <service type="jakarta.json.spi.JsonProvider">
+                <provider classname="org.eclipse.parsson.JsonProviderImpl"/>
+            </service>
+            <service type="org.apache.commons.jcs3.log.LogFactory">
+                <provider classname="org.apache.commons.jcs3.log.JulLogFactory"/>
+                <provider classname="org.apache.commons.jcs3.log.Log4j2Factory"/>
+            </service>
         </jar>
         <!-- Sign jar if all environment variables are set -->
         <signjar jar="${dist.jar}" alias="${env.SIGN_ALIAS}" tsaurl="${env.SIGN_TSA}"
             keystore="${env.SIGN_KEYSTORE}" storepass="${env.SIGN_STOREPASS}" keypass="${env.SIGN_KEYPASS}" if:set="sign.jar" />
     </target>
     <target name="javacc" depends="init" unless="javacc.notRequired" description="Compile the MapCSS compiler">
-        <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="javacc.classpath" conf="javacc"/>
         <mkdir dir="${mapcss.dir}/parsergen"/>
-        <java classname="javacc" fork="true" dir="${mapcss.dir}" failonerror="true">
-            <classpath path="${tools.dir}/javacc"/>
-            <classpath refid="javacc.classpath"/>
+        <exec append="false" executable="javacc" failifexecutionfails="true">
             <arg value="-DEBUG_PARSER=false"/>
             <arg value="-DEBUG_TOKEN_MANAGER=false"/>
             <arg value="-JDK_VERSION=1.${java.lang.version}"/>
             <arg value="-GRAMMAR_ENCODING=UTF-8"/>
             <arg value="-UNICODE_INPUT=true"/>
+            <arg value="-OUTPUT_DIRECTORY=${mapcss.dir}/parsergen"/>
             <arg value="${mapcss.dir}/MapCSSParser.jj"/>
-        </java>
+        </exec>
+    </target>
+    <target name="javacc-openinghoursparser" depends="init" unless="javacc.notRequired">
+        <mkdir dir="${src.dir}/ch/poole/openinghoursparser/parsergen"/>
+        <exec append="false" executable="javacc" failifexecutionfails="true">
+            <arg value="-DEBUG_PARSER=false"/>
+            <arg value="-DEBUG_TOKEN_MANAGER=false"/>
+            <arg value="-JDK_VERSION=1.${java.lang.version}"/>
+            <arg value="-GRAMMAR_ENCODING=UTF-8"/>
+            <arg value="-UNICODE_INPUT=true"/>
+            <arg value="-OUTPUT_DIRECTORY=${src.dir}/ch/poole/openinghoursparser"/>
+            <arg value="${src.dir}/ch/poole/openinghoursparser/OpeningHoursParser.jj"/>
+        </exec>
+    </target>
+    <target name="compile-cots" depends="init,javacc-openinghoursparser" description="Compile third-party dependencies not retrieved with Ivy">
+        <!-- COTS -->
+        <javac srcdir="${src.dir}" classpathref="classpath"
+            includes="ch/**,com/**,jakarta/**,org/apache/commons/**,org/eclipse/**,org/jetbrains/annotations/**,org/tukaani/**"
+            excludes="**/package-info.java" nowarn="on" encoding="iso-8859-1"
+            destdir="${build.dir}" release="${java.lang.version}" debug="on" includeAntRuntime="false">
+            <!-- get rid of "internal proprietary API" warning -->
+            <compilerarg value="-XDignore.symbol.file"/>
+            <exclude name="ch/poole/openinghoursparser/DataTest.java"/>
+            <exclude name="ch/poole/openinghoursparser/UnitTest.java"/>
+            <exclude name="com/drew/imaging/FileTypeDetector*"/>
+            <exclude name="com/drew/imaging/ImageMetadataReader*"/>
+            <exclude name="com/drew/imaging/avi/**"/>
+            <exclude name="com/drew/imaging/bmp/**"/>
+            <exclude name="com/drew/imaging/eps/**"/>
+            <exclude name="com/drew/imaging/gif/**"/>
+            <exclude name="com/drew/imaging/heif/**"/>
+            <exclude name="com/drew/imaging/ico/**"/>
+            <exclude name="com/drew/imaging/mp3/**"/>
+            <exclude name="com/drew/imaging/mp4/**"/>
+            <exclude name="com/drew/imaging/pcx/**"/>
+            <exclude name="com/drew/imaging/psd/**"/>
+            <exclude name="com/drew/imaging/quicktime/**"/>
+            <exclude name="com/drew/imaging/raf/**"/>
+            <exclude name="com/drew/imaging/riff/**"/>
+            <exclude name="com/drew/imaging/wav/**"/>
+            <exclude name="com/drew/imaging/webp/**"/>
+            <exclude name="com/drew/metadata/avi/**"/>
+            <exclude name="com/drew/metadata/bmp/**"/>
+            <exclude name="com/drew/metadata/eps/**"/>
+            <exclude name="com/drew/metadata/gif/**"/>
+            <exclude name="com/drew/metadata/heif/**"/>
+            <exclude name="com/drew/metadata/ico/**"/>
+            <exclude name="com/drew/metadata/mov/**"/>
+            <exclude name="com/drew/metadata/mp3/**"/>
+            <exclude name="com/drew/metadata/mp4/**"/>
+            <exclude name="com/drew/metadata/pcx/**"/>
+            <exclude name="com/drew/metadata/wav/**"/>
+            <exclude name="com/drew/metadata/webp/**"/>
+            <exclude name="com/drew/tools/**"/>
+            <exclude name="com/kitfox/svg/app/ant/**"/>
+            <exclude name="com/kitfox/svg/app/*Dialog*"/>
+            <exclude name="com/kitfox/svg/app/*Frame*"/>
+            <exclude name="com/kitfox/svg/app/*Player*"/>
+            <exclude name="com/kitfox/svg/app/*Viewer*"/>
+            <exclude name="org/apache/commons/compress/PasswordRequiredException*"/>
+            <exclude name="org/apache/commons/compress/archivers/**"/>
+            <exclude name="org/apache/commons/compress/changes/**"/>
+            <exclude name="org/apache/commons/compress/compressors/bzip2/BZip2Utils*"/>
+            <exclude name="org/apache/commons/compress/compressors/brotli/**"/>
+            <exclude name="org/apache/commons/compress/compressors/CompressorStreamFactory*"/>
+            <exclude name="org/apache/commons/compress/compressors/CompressorStreamProvider*"/>
+            <exclude name="org/apache/commons/compress/compressors/CompressorException*"/>
+            <exclude name="org/apache/commons/compress/compressors/FileNameUtil*"/>
+            <exclude name="org/apache/commons/compress/compressors/deflate/**"/>
+            <exclude name="org/apache/commons/compress/compressors/gzip/**"/>
+            <exclude name="org/apache/commons/compress/compressors/lz4/**"/>
+            <exclude name="org/apache/commons/compress/compressors/lzma/**"/>
+            <exclude name="org/apache/commons/compress/compressors/lz77support/**"/>
+            <exclude name="org/apache/commons/compress/compressors/pack200/**"/>
+            <exclude name="org/apache/commons/compress/compressors/snappy/**"/>
+            <exclude name="org/apache/commons/compress/compressors/xz/XZUtils*"/>
+            <exclude name="org/apache/commons/compress/compressors/z/**"/>
+            <exclude name="org/apache/commons/compress/compressors/zstandard/**"/>
+            <exclude name="org/apache/commons/compress/java/util/jar/Pack200*"/>
+            <exclude name="org/apache/commons/compress/harmony/pack200/**"/>
+            <exclude name="org/apache/commons/compress/harmony/unpack200/**"/>
+            <exclude name="org/apache/commons/compress/parallel/**"/>
+            <exclude name="org/apache/commons/compress/utils/ArchiveUtils*"/>
+            <exclude name="org/apache/commons/jcs3/auxiliary/disk/jdbc/**"/>
+            <exclude name="org/apache/commons/jcs3/auxiliary/remote/http/client/**"/>
+            <exclude name="org/apache/commons/jcs3/auxiliary/remote/http/server/RemoteHttpCacheServlet*"/>
+            <exclude name="org/apache/commons/jcs3/auxiliary/remote/server/RemoteCacheStartupServlet*"/>
+            <exclude name="org/apache/commons/jcs3/log/Log4j2Factory*"/>
+            <exclude name="org/apache/commons/jcs3/log/Log4j2LogAdapter*"/>
+            <exclude name="org/apache/commons/jcs3/utils/servlet/**"/>
+            <exclude name="org/jetbrains/annotations/Debug.java"/>
+            <exclude name="org/openstreetmap/gui/jmapviewer/Demo*"/>
+        </javac>
+        <copy todir="${build.dir}">
+            <fileset dir="${src.dir}" includes="ch/poole/**/*.properties" excludes="**/*.java"/>
+        </copy>
+        <!-- I18N -->
+        <ant dir="i18n" />
     </target>
     <macrodef name="call-javac-compile">
         <attribute name="sourcepath" default=""/>
@@ -294,17 +408,44 @@ Build-Date: ${build.tstamp}
         </call-javac-compile>
       </sequential>
     </macrodef>
-    <target name="compile" depends="init,javacc" unless="compile.notRequired" description="Compile JOSM">
+    <target name="compile" depends="init,javacc,compile-cots" unless="compile.notRequired" description="Compile JOSM">
+<!--
         <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="errorprone.classpath" conf="errorprone"/>
         <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="errorprone_javac.classpath" conf="errorprone_javac"/>
+-->
         <!-- JOSM -->
+<!--
         <call-javac-compile excludes="**/package-info.java,**/module-info.java,main/**" release="${java.lang.version}"/>
+-->
         <!-- Java 11 specific files (2018-09 LTS) -->
+<!--
         <call-javac-compile-mrjar release="11"/>
+-->
         <!-- Java 17 specific files (2021-09 LTS) -->
+<!--
         <call-javac-compile-mrjar release="17"/>
+-->
         <!-- Java 21 specific files (2023-09 LTS) -->
+<!--
         <call-javac-compile-mrjar release="21"/>
+-->
+        <javac sourcepath="" srcdir="${src.dir}" fork="yes" classpathref="classpath"
+            excludes="ch/**,com/**,jakarta/**,org/apache/commons/**,org/eclipse/**,org/jetbrains/annotations/**,org/openstreetmap/gui/jmapviewer/**,org/tukaani/**,**/package-info.java"
+            destdir="${build.dir}" release="${java.lang.version}" debug="on" includeantruntime="false" encoding="UTF-8">
+            <compilerarg value="-Xlint:cast"/>
+            <compilerarg value="-Xlint:deprecation"/>
+            <compilerarg value="-Xlint:dep-ann"/>
+            <compilerarg value="-Xlint:divzero"/>
+            <compilerarg value="-Xlint:empty"/>
+            <compilerarg value="-Xlint:finally"/>
+            <compilerarg value="-Xlint:overrides"/>
+            <!--<compilerarg value="-Xlint:rawtypes"/>-->
+            <compilerarg value="-Xlint:static"/>
+            <compilerarg value="-Xlint:try"/>
+            <compilerarg value="-Xlint:unchecked"/>
+            <!-- Undocumented argument to ignore "Sun internal proprietary API" warning, see http://stackoverflow.com/a/13862308/2257172 -->
+            <compilerarg value="-XDignore.symbol.file"/>
+        </javac>
     </target>
     <target name="create-resources" depends="create-revision" description="Create generated resource files">
         <copy todir="${resources.dir}">
@@ -328,6 +469,7 @@ Build-Date: ${build.tstamp}
         </uptodate>
         <mkdir dir="${build.dir}"/>
         <mkdir dir="${dist.dir}"/>
+        <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${antcontrib.jar}"/>
     </target>
     <target name="javadoc" depends="init" description="Generate API documentation from JOSM source files">
         <javadoc destdir="javadoc"
@@ -364,6 +506,7 @@ Build-Date: ${build.tstamp}
         <delete dir="${src.dir}/org/openstreetmap/josm/data/imagery/types"/>
         <delete file="${epsg.output}"/>
         <delete file="${pmd.dir}/cache"/>
+        <ant target="clean" dir="i18n"/>
     </target>
     <macrodef name="init-test-preferences">
         <attribute name="testfamily"/>
@@ -973,6 +1116,7 @@ Build-Date: ${build.tstamp}
                 <pathelement path="${resources.dir}"/>
                 <pathelement path="${proj-classpath}"/>
                 <pathelement path="${proj-build.dir}"/>
+                <path refid="classpath"/>
             </classpath>
             <arg value="${base.dir}"/>
         </java>
@@ -1054,12 +1198,14 @@ Build-Date: ${build.tstamp}
         <move file="${modules.dir}/dots/summary.dot.png" tofile="${modules.dir}/josm-with-all-dependencies.png"/>
     </target>
     <target name="resolve" depends="init-ivy" unless="resolve.notRequired" description="Resolve Ivy dependencies">
+<!--
         <ivy:settings file="${base.dir}/ivysettings.xml"/>
         <ivy:resolve log="download-only" file="${base.dir}/ivy.xml" keep="true"/>
         <ivy:cachepath log="download-only" pathid="compile.path" conf="compile"/>
         <ivy:cachepath log="download-only" pathid="runtime.path" conf="runtime"/>
         <ivy:cachefileset log="download-only" setid="runtime.fileset" conf="runtime"/>
         <ivy:cachepath log="download-only" pathid="test.path" conf="test"/>
+-->
     </target>
     <target name="extract-libraries" depends="resolve" description="Extract libraries to build dir">
         <unzip dest="${build.dir}">
--- a/i18n/build.xml
+++ b/i18n/build.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <project name="JOSM i18n" default="build" basedir=".">
     <!-- compilation properties -->
-    <property name="josm.build.dir" value="../core"/>
+    <property name="josm.build.dir" value=".."/>
     <property name="josm.resources.dir" value="${josm.build.dir}/resources"/>
     <property name="josm.presets" value="${josm.resources.dir}/data/defaultpresets.xml"/>
     <property name="plugin.dir" value="../plugins"/>
@@ -14,8 +14,8 @@
     <property name="po.build.dir" value="${i18n.build.dir}"/>
     <property name="ant.build.javac.target" value="1.5"/>
     <property name="gettext.keywords" value="-k -ktrc:1c,2 -kmarktrc:1c,2 -ktr -kmarktr -ktrn:1,2 -ktrnc:1c,2,3"/>
-    <property name="gettexttasks.jar" value="lib/gettext-ant-tasks-0.9.7.jar"/>
-    <property name="antcontrib.jar" value="lib/ant-contrib-1.0b3.jar"/>
+    <property name="gettexttasks.jar" value="/usr/share/java/gettext-ant-tasks.jar"/>
+    <property name="antcontrib.jar" value="/usr/share/java/ant-contrib.jar"/>
     <property name="grand.jar" value="lib/grand-1.9.5.jar"/>
     <target name="init" description="Loads the Ant gettext and contrib tasks">
         <taskdef name="gettext-extract" classname="org.xnap.commons.ant.gettext.GettextExtractKeysTask" classpath="${gettexttasks.jar}"/>
@@ -68,7 +68,7 @@
     <target name="po/josm.pot" description="Extracts message keys from the source code" depends="trans_.java,init,filterpluginsources">
         <gettext-extract keysFile="josm.pot" poDirectory="po" keywords="${gettext.keywords} --exclude-file=excludes.pot">
             <!-- core.pot -->
-            <fileset dir="${josm.build.dir}/src" includes="**/*.java"/>
+            <fileset dir="${josm.build.dir}/src/org/openstreetmap/josm" includes="**/*.java"/>
             <fileset dir="${i18n.build.dir}" includes="specialmessages.java"/>
             <fileset dir="${i18n.build.dir}" includes="trans_presets.java"/>
             <fileset dir="${josm.resources.dir}/data/validator" includes="*.mapcss"/>
@@ -87,9 +87,9 @@
             <arg line="po/core.pot po/maplist.pot po/presets.pot"/>
         </exec>
     </target>
-    <target name="po/core.pot" description="Extracts message keys from the JOSM core source code" depends="init">
+    <target name="po/core.pot" description="Extracts message keys from the JOSM core source code" depends="builddir,init">
         <gettext-extract keysFile="core.pot" poDirectory="po" keywords="${gettext.keywords} --exclude-file=excludes.pot">
-            <fileset dir="${josm.build.dir}/src" includes="**/*.java"/>
+            <fileset dir="${josm.build.dir}/src/org/openstreetmap/josm" includes="**/*.java"/>
             <fileset dir="${i18n.build.dir}" includes="specialmessages.java"/>
             <fileset dir="${josm.resources.dir}/data/validator" includes="*.mapcss"/>
             <fileset dir="${josm.resources.dir}/styles/standard" includes="*.mapcss"/>
@@ -117,9 +117,14 @@
             <fileset dir="${i18n.build.dir}" includes="trans_surveyor.java"/>
         </gettext-extract>
     </target>
-    <target name="build">
+    <target name="build.check">
+        <condition property="build.run">
+            <not><available file="build-timestamp"/></not>
+        </condition>
+    </target>
+    <target name="build" depends="build.check" if="build.run">
         <antcall target="buildcore"/>
-        <antcall target="buildplugins"/>
+        <touch file="build-timestamp"/>
     </target>
     <target name="buildplugins" depends="init">
         <foreach param="path" target="plugintrans" parallel="true" maxThreads="8">
@@ -138,13 +143,12 @@
             <param name="path" value="${plugin}"/>
         </antcall>
     </target>
-    <target name="buildcore" depends="pot">
+    <target name="buildcore">
         <antcall target="coretrans"/>
-        <antcall target="pluginlisttrans"/>
     </target>
-    <target name="coretrans" depends="po/core+maplist+presets.pot">
+    <target name="coretrans" depends="po/core.pot">
         <exec executable="perl" failonerror="true">
-            <arg line="i18n.pl --potfile=po/core+maplist+presets.pot --basedir=${i18n.install.dir}/ po/*.po"/>
+            <arg line="i18n.pl --potfile=po/core.pot --basedir=${i18n.install.dir}/ po/*.po"/>
         </exec>
     </target>
     <target name="pluginlisttrans" depends="po/pluginlist.pot">
@@ -182,15 +186,14 @@
         </if>
         <delete dir="${po.build.dir}/plugin_${dir}"/>
     </target>
+    <target name="dist" depends="build">
+        <copy todir="../build">
+            <fileset dir="build"/>
+        </copy>
+    </target>
     <target name="clean">
         <delete dir="${i18n.build.dir}"/>
-        <delete file="build.dot"/>
-        <delete file="build.png"/>
-        <delete>
-            <fileset dir="po" includes="*.*~" defaultexcludes="false"/>
-            <fileset dir="po" includes="*.po" defaultexcludes="false"/>
-            <fileset dir="po" includes="*.pot" defaultexcludes="false"/>
-        </delete>
+        <delete file="build-timestamp"/>
     </target>
     <target name="test" depends="pot">
         <mkdir dir="${i18n.build.dir}/test"/>