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
|
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
@@ -24,7 +24,8 @@
<property name="mapcss.dir" location="${src.dir}/org/openstreetmap/josm/gui/mappaint/mapcss"/>
<property name="proj-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-2.4.7.jar"/>
+ <property name="groovy.jar" location="/usr/share/java/groovy-all.jar"/>
+ <property name="antcontrib.jar" value="/usr/share/java/ant-contrib.jar"/>
<property name="error_prone_ant.jar" location="${base.dir}/tools/error_prone_ant-2.0.14.jar"/>
<property name="javac.compiler" value="com.google.errorprone.ErrorProneAntCompilerAdapter" />
<!-- build parameter: compression level (ant -Dclevel=N)
@@ -37,6 +38,19 @@
<condition property="isJava9">
<equals arg1="${ant.java.version}" arg2="1.9" />
</condition>
+ <!-- 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="svgSalamander.jar"/>
+ <include name="signpost-core.jar"/>
+ <include name="commons-codec.jar"/>
+ <include name="commons-compress.jar"/>
+ <include name="commons-logging.jar"/>
+ <include name="jmapviewer.jar"/>
+ </fileset>
+ </path>
+ <property name="classpathprop-colon" refid="classpath"/>
<path id="test.classpath">
<fileset dir="${test.dir}/lib">
<include name="**/*.jar"/>
@@ -92,10 +106,9 @@
<!--
** Creates the REVISION file to be included in the distribution
-->
- <target name="create-revision" depends="init-properties,init-svn-revision-xml,init-git-revision-xml">
+ <target name="create-revision">
<property name="revision.dir" value="${build.dir}"/>
- <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>
@@ -106,8 +119,10 @@
<echo file="${revision.dir}/REVISION">
# automatically generated by JOSM build.xml - do not edit
Revision: ${version.entry.commit.revision}
-Is-Local-Build: true
+Is-Local-Build: false
Build-Date: ${build.tstamp}
+Build-Name: Debian
+Debian-Release: ${debian.version}
</echo>
</target>
<!--
@@ -127,7 +142,7 @@ Build-Date: ${build.tstamp}
<copy file="README" todir="build"/>
<copy file="LICENSE" todir="build"/>
<!-- create josm-custom.jar -->
- <delete file="${dist.dir}/josm-custom.jar"/>
+ <propertyregex property="classpathprop" input="${classpathprop-colon}" global="true" regexp=":" replace=" "/>
<jar destfile="${dist.dir}/josm-custom.jar" basedir="${build.dir}" level="${clevel}">
<!-- add attribute excludes="**/*BZip2*,**/*Bzip2*" to create a non-bzip2 supporting jar -->
<manifest>
@@ -137,6 +152,8 @@ 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}"/>
</manifest>
<zipfileset dir="images" prefix="images"/>
<zipfileset dir="data" prefix="data"/>
@@ -207,10 +224,7 @@ Build-Date: ${build.tstamp}
</target>
<target name="javacc" depends="init" unless="javacc.notRequired">
<mkdir dir="${mapcss.dir}/parsergen"/>
- <exec append="false" executable="java" failifexecutionfails="true">
- <arg value="-cp"/>
- <arg value="${javacc.home}/javacc.jar"/>
- <arg value="javacc"/>
+ <exec append="false" executable="javacc" failifexecutionfails="true">
<arg value="-DEBUG_PARSER=false"/>
<arg value="-DEBUG_TOKEN_MANAGER=false"/>
<arg value="-JDK_VERSION=1.8"/>
@@ -221,22 +235,10 @@ Build-Date: ${build.tstamp}
</target>
<target name="compile" depends="init,javacc">
<!-- COTS -->
- <javac srcdir="${src.dir}" includes="com/**,oauth/**,org/apache/commons/**,org/glassfish/**" nowarn="on" encoding="iso-8859-1"
+ <javac srcdir="${src.dir}" classpathref="classpath" includes="com/**,oauth/**,org/apache/commons/**,org/glassfish/**" nowarn="on" encoding="iso-8859-1"
destdir="build" target="1.8" source="1.8" debug="on" includeAntRuntime="false" createMissingPackageInfoClass="false">
<!-- get rid of "internal proprietary API" warning -->
<compilerarg value="-XDignore.symbol.file"/>
- <exclude name="org/apache/commons/compress/compressors/bzip2/BZip2Utils.java"/>
- <exclude name="org/apache/commons/compress/compressors/lzma/**"/>
- <exclude name="org/apache/commons/compress/compressors/xz/**"/>
- <exclude name="org/apache/commons/compress/compressors/CompressorStreamFactory.java"/>
- <exclude name="org/apache/commons/compress/compressors/CompressorStreamProvider.java"/>
- <exclude name="org/apache/commons/compress/compressors/CompressorException.java"/>
- <exclude name="org/apache/commons/compress/compressors/FileNameUtil.java"/>
- <exclude name="org/apache/commons/compress/compressors/deflate/**"/>
- <exclude name="org/apache/commons/compress/compressors/gzip/**"/>
- <exclude name="org/apache/commons/compress/compressors/lzw/**"/>
- <exclude name="org/apache/commons/compress/compressors/pack200/**"/>
- <exclude name="org/apache/commons/compress/compressors/snappy/**"/>
<exclude name="org/apache/commons/compress/compressors/z/**"/>
<exclude name="org/apache/commons/jcs/JCS.java"/>
<exclude name="org/apache/commons/jcs/access/GroupCacheAccess.java"/>
@@ -258,19 +260,13 @@ Build-Date: ${build.tstamp}
<exclude name="org/apache/commons/jcs/utils/net/**"/>
<exclude name="org/apache/commons/jcs/utils/props/**"/>
<exclude name="org/apache/commons/jcs/utils/servlet/**"/>
- <exclude name="org/apache/commons/logging/impl/AvalonLogger.java"/>
- <exclude name="org/apache/commons/logging/impl/Jdk13LumberjackLogger.java"/>
- <exclude name="org/apache/commons/logging/impl/Log4JLogger.java"/>
- <exclude name="org/apache/commons/logging/impl/LogKitLogger.java"/>
- <exclude name="org/apache/commons/logging/impl/ServletContextCleaner.java"/>
</javac>
+ <!-- I18N -->
+ <ant dir="i18n" />
<!-- JMapViewer -->
- <javac compiler="${javac.compiler}" sourcepath="" srcdir="${src.dir}"
+ <javac sourcepath="" srcdir="${src.dir}" classpathref="classpath"
excludes="com/**,oauth/**,org/apache/commons/**,org/glassfish/**,org/openstreetmap/gui/jmapviewer/Demo.java,org/openstreetmap/gui/jmapviewer/JMapViewerTree.java,org/openstreetmap/gui/jmapviewer/checkBoxTree/**,org/openstreetmap/josm/**,JOSM.java,gnu/**"
destdir="build" target="1.8" source="1.8" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="UTF-8">
- <compilerclasspath>
- <pathelement location="${error_prone_ant.jar}"/>
- </compilerclasspath>
<compilerarg value="-Xlint:cast"/>
<compilerarg value="-Xlint:deprecation"/>
<compilerarg value="-Xlint:dep-ann"/>
@@ -284,16 +280,12 @@ Build-Date: ${build.tstamp}
<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"/>
- <compilerarg value="-Xep:ReferenceEquality:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
<compilerarg line="-Xmaxwarns 1000"/>
</javac>
<!-- JOSM -->
- <javac compiler="${javac.compiler}" sourcepath="" srcdir="${src.dir}"
+ <javac sourcepath="" srcdir="${src.dir}" classpathref="classpath"
excludes="com/**,oauth/**,org/apache/commons/**,org/glassfish/**,org/openstreetmap/gui/jmapviewer/**"
destdir="build" target="1.8" source="1.8" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="UTF-8">
- <compilerclasspath>
- <pathelement location="${error_prone_ant.jar}"/>
- </compilerclasspath>
<compilerarg value="-Xlint:cast"/>
<compilerarg value="-Xlint:deprecation"/>
<compilerarg value="-Xlint:dep-ann"/>
@@ -307,7 +299,6 @@ Build-Date: ${build.tstamp}
<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"/>
- <compilerarg value="-Xep:ReferenceEquality:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
<compilerarg line="-Xmaxwarns 1000"/>
</javac>
@@ -321,6 +312,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-properties">
<javadoc destdir="javadoc"
@@ -346,6 +338,7 @@ Build-Date: ${build.tstamp}
<delete file="${src.dir}/org/w3/_2001/xmlschema/Adapter1.java"/>
<delete dir="${src.dir}/org/openstreetmap/josm/data/imagery/types"/>
<delete file="${epsg.output}"/>
+ <ant target="clean" dir="i18n"/>
</target>
<macrodef name="init-test-preferences">
<attribute name="testfamily"/>
@@ -776,6 +769,7 @@ Build-Date: ${build.tstamp}
<pathelement path="${base.dir}"/>
<pathelement path="${proj-classpath}"/>
<pathelement path="${proj-build.dir}"/>
+ <path refid="classpath"/>
</classpath>
<arg value="${base.dir}"/>
</java>
--- 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.presets" value="${josm.build.dir}/data/defaultpresets.xml"/>
<property name="plugin.dir" value="../plugins"/>
<property name="maps.srcfile" value="http://josm.openstreetmap.de/maps"/>
@@ -12,8 +12,8 @@
<property name="i18n_data.install.dir" value="${josm.build.dir}/data_nodist/trans"/>
<property name="po.build.dir" value="${i18n.build.dir}"/>
<property name="ant.build.javac.target" value="1.5"/>
- <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"/>
<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}"/>
<!-- for the <foreach> possibility -->
@@ -55,7 +55,7 @@
</exec>
<delete file="po/josm.raw.pot"/>
</target>
- <target name="po/core.pot" description="Extracts message keys from the JOSM core source code" depends="trans_.java,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="-k -ktrc:1c,2 -kmarktrc:1c,2 -ktr -kmarktr -ktrn:1,2 -ktrnc:1c,2,3">
<fileset dir="${josm.build.dir}/src" includes="**/*.java"/>
<fileset dir="${i18n.build.dir}" includes="specialmessages.java"/>
@@ -96,9 +96,14 @@
<delete file="${po.build.dir}/data.pot"/>
<delete file="${po.build.dir}/plugins.raw.pot"/>
</target>
- <target name="build" depends="pot,allpot">
- <antcall target="buildcore"/>
- <antcall target="buildplugins"/>
+ <target name="build.check">
+ <condition property="build.run">
+ <not><available file="build-timestamp"/></not>
+ </condition>
+ </target>
+ <target name="build" depends="build.check,po/core.pot" if="build.run">
+ <antcall target="coretrans"/>
+ <touch file="build-timestamp"/>
</target>
<target name="buildplugins" depends="init">
<foreach param="path" target="plugintrans" parallel="true" maxThreads="8">
@@ -147,15 +152,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="po/josm.pot"/>
- <delete>
- <fileset dir="po" includes="*.*~" defaultexcludes="false"/>
- </delete>
- <delete>
- <fileset dir="po" includes="*.po" defaultexcludes="false"/>
- </delete>
+ <delete file="build-timestamp"/>
</target>
<target name="test" depends="pot">
<mkdir dir="${i18n.build.dir}/test"/>
|