Changeset 12628 in josm


Ignore:
Timestamp:
2017-08-23T19:30:45+02:00 (7 years ago)
Author:
Don-vip
Message:

see #15182 - build.xml - define constants for values repeated multiple times (java version, jar filename)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/build.xml

    r12586 r12628  
    2828        <property name="groovy.jar" location="${base.dir}/tools/groovy-all.jar"/>
    2929        <property name="error_prone_ant.jar" location="${base.dir}/tools/error_prone_ant.jar"/>
     30        <property name="dist.jar" location="${dist.dir}/josm-custom.jar"/>
     31        <property name="dist-optimized.jar" location="${dist.dir}/josm-custom-optimized.jar"/>
    3032        <property name="javac.compiler" value="com.google.errorprone.ErrorProneAntCompilerAdapter" />
     33        <property name="java.lang.version" value="1.8" />
    3134        <!-- build parameter: compression level (ant -Dclevel=N)
    3235                 N ranges from 0 (no compression) to 9 (maximum compression)
     
    4346                <include name="**/*.jar"/>
    4447            </fileset>
    45             <pathelement path="${dist.dir}/josm-custom.jar"/>
     48            <pathelement path="${dist.jar}"/>
    4649            <pathelement path="${groovy.jar}"/>
    4750            <pathelement path="tools/findbugs/annotations.jar"/>
     
    134137        <copy file="LICENSE" todir="build"/>
    135138        <!-- create josm-custom.jar -->
    136         <delete file="${dist.dir}/josm-custom.jar"/>
    137         <jar destfile="${dist.dir}/josm-custom.jar" basedir="${build.dir}" level="${clevel}">
     139        <delete file="${dist.jar}"/>
     140        <jar destfile="${dist.jar}" basedir="${build.dir}" level="${clevel}">
    138141            <!-- add attribute excludes="**/*BZip2*,**/*Bzip2*" to create a non-bzip2 supporting jar -->
    139142            <manifest>
     
    205208        <antcall target="mac">
    206209            <param name="bundle.outdir" value="${dist.dir}"/>
    207             <param name="bundle.jar" value="${dist.dir}/josm-custom.jar"/>
     210            <param name="bundle.jar" value="${dist.jar}"/>
    208211        </antcall>
    209212    </target>
     
    212215        <exec dir="windows" executable="./josm-setup-unix.sh">
    213216            <arg value="${version.entry.commit.revision}"/>
    214             <arg value="../dist/josm-custom.jar"/>
     217            <arg value="${dist.jar}"/>
    215218        </exec>
    216219    </target>
     
    221224            <arg value="-DEBUG_PARSER=false"/>
    222225            <arg value="-DEBUG_TOKEN_MANAGER=false"/>
    223             <arg value="-JDK_VERSION=1.8"/>
     226            <arg value="-JDK_VERSION=${java.lang.version}"/>
    224227            <arg value="-GRAMMAR_ENCODING=UTF-8"/>
    225228            <arg value="-OUTPUT_DIRECTORY=${mapcss.dir}/parsergen"/>
     
    230233        <!-- COTS -->
    231234        <javac srcdir="${src.dir}" includes="com/**,oauth/**,org/apache/commons/**,org/glassfish/**" nowarn="on" encoding="iso-8859-1"
    232             destdir="build" target="1.8" source="1.8" debug="on" includeAntRuntime="false" createMissingPackageInfoClass="false">
     235            destdir="build" target="${java.lang.version}" source="${java.lang.version}" debug="on" includeAntRuntime="false" createMissingPackageInfoClass="false">
    233236            <!-- get rid of "internal proprietary API" warning -->
    234237            <compilerarg value="-XDignore.symbol.file"/>
     
    282285        <javac compiler="${javac.compiler}" sourcepath="" srcdir="${src.dir}"
    283286            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/**,gnu/**"
    284             destdir="build" target="1.8" source="1.8" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="UTF-8">
     287            destdir="build" target="${java.lang.version}" source="${java.lang.version}" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="UTF-8">
    285288            <compilerclasspath>
    286289                <pathelement location="${error_prone_ant.jar}"/>
     
    305308        <javac compiler="${javac.compiler}" sourcepath="" srcdir="${src.dir}"
    306309            excludes="com/**,oauth/**,org/apache/commons/**,org/glassfish/**,org/openstreetmap/gui/jmapviewer/**"
    307             destdir="build" target="1.8" source="1.8" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="UTF-8">
     310            destdir="build" target="${java.lang.version}" source="${java.lang.version}" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="UTF-8">
    308311            <compilerclasspath>
    309312                <pathelement location="${error_prone_ant.jar}"/>
     
    410413                    <cp-elements/>
    411414                </classpath>
    412                 <javac target="1.8" source="1.8" debug="on" encoding="UTF-8">
     415                <javac target="${java.lang.version}" source="${java.lang.version}" debug="on" encoding="UTF-8">
    413416                    <compilerarg value="-Xlint:all"/>
    414417                    <compilerarg value="-Xlint:-serial"/>
     
    529532        <taskdef resource="proguard/ant/task.properties" classpath="tools/proguard.jar"/>
    530533        <proguard>
    531         -injars dist/josm-custom.jar
    532         -outjars dist/josm-custom-optimized.jar
     534        -injars ${dist.jar}
     535        -outjars ${dist-optimized.jar}
    533536
    534537        -libraryjars ${java.home}/lib/rt.jar
     
    586589            <arg value="--v2=${version.entry.commit.revision}-optimized"/>
    587590            <arg value="--report-path=${dist.dir}/compat_report.html"/>
    588             <arg value="${dist.dir}/josm-custom.jar"/>
    589             <arg value="${dist.dir}/josm-custom-optimized.jar"/>
     591            <arg value="${dist.jar}"/>
     592            <arg value="${dist-optimized.jar}"/>
    590593        </exec>
    591594    </target>
     
    659662        <as:build-signatures destfile="${dir}/api.sig">
    660663            <path>
    661                 <fileset file="${dist.dir}/josm-custom-optimized.jar"/>
     664                <fileset file="${dist-optimized.jar}"/>
    662665                <fileset file="${java.home}/lib/rt.jar"/>
    663666                <fileset file="${java.home}/lib/jce.jar"/>
     
    706709        <sequential>
    707710            <echo message="Generating Taginfo for type @{type} to @{output}"/>
    708             <groovy src="${taginfoextract}" classpath="${dist.dir}/josm-custom.jar:tools/findbugs/annotations.jar">
     711            <groovy src="${taginfoextract}" classpath="${dist.jar}:tools/findbugs/annotations.jar">
    709712                <arg value="-t"/>
    710713                <arg value="@{type}"/>
     
    731734        <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpath="${groovy.jar};tools/commons-cli-1.3.1.jar"/>
    732735        <echo message="Checking editor imagery difference"/>
    733         <groovy src="scripts/SyncEditorLayerIndex.groovy" classpath="${dist.dir}/josm-custom.jar">
     736        <groovy src="scripts/SyncEditorLayerIndex.groovy" classpath="${dist.jar}">
    734737                <arg value="-noeli"/>
    735738                <arg value="-p"/>
     
    765768        <mkdir dir="${checkstyle-build.dir}"/>
    766769        <javac sourcepath="" srcdir="${base.dir}/tools/checkstyle/src" failonerror="true"
    767             destdir="${checkstyle-build.dir}" target="1.8" source="1.8" debug="on"
     770            destdir="${checkstyle-build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on"
    768771            includeantruntime="false" createMissingPackageInfoClass="false"
    769772            encoding="UTF-8" classpath="tools/checkstyle/checkstyle-all.jar">
     
    799802                >
    800803            <sourcePath path="${base.dir}/src" />
    801             <class location="${dist.dir}/josm-custom.jar" />
     804            <class location="${dist.jar}" />
    802805        </findbugs>
    803806    </target>
     
    806809        <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpath="${toString:pmd.classpath}"/>
    807810        <pmd shortFilenames="true" encoding="UTF-8">
    808             <sourceLanguage name="java" version="1.8" />
     811            <sourceLanguage name="java" version="${java.lang.version}" />
    809812            <ruleset>${base.dir}/tools/pmd/josm-ruleset.xml</ruleset>
    810813            <formatter type="text" toConsole="true" />
     
    820823
    821824    <target name="run" depends="dist">
    822         <java jar="${dist.dir}/josm-custom.jar" fork="true">
     825        <java jar="${dist.jar}" fork="true">
    823826            <arg value="--set=expert=true"/>
    824827            <arg value="--set=remotecontrol.enabled=true"/>
     
    834837        <mkdir dir="${proj-build.dir}"/>
    835838        <javac sourcepath="" srcdir="${base.dir}/scripts" failonerror="true"
    836             destdir="${proj-build.dir}" target="1.8" source="1.8" debug="on"
     839            destdir="${proj-build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on"
    837840            includeantruntime="false" createMissingPackageInfoClass="false"
    838841            encoding="UTF-8" classpath="${proj-classpath}">
Note: See TracChangeset for help on using the changeset viewer.