Ignore:
Timestamp:
2018-10-29T14:52:21+01:00 (6 years ago)
Author:
donvip
Message:

see #josm16682 - build 3 smaller native jar files instead of a giant one - speed up generation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/build-common.xml

    r34682 r34703  
    3333    <property name="plugin.dist.dir"        location="../../dist"/>
    3434    <property name="java.lang.version"      value="1.8" />
     35    <property name="manifest"               value="MANIFEST"/>
     36    <property name="manifest.unixoid"       value="MANIFEST-unixoid"/>
     37    <property name="manifest.windows"       value="MANIFEST-windows"/>
     38    <property name="manifest.osx"           value="MANIFEST-osx"/>
    3539    <property name="plugin.jar"             location="${plugin.dist.dir}/${ant.project.name}.jar"/>
     40    <property name="plugin.unixoid.jar"     location="${plugin.dist.dir}/${ant.project.name}-unixoid.jar"/>
     41    <property name="plugin.windows.jar"     location="${plugin.dist.dir}/${ant.project.name}-windows.jar"/>
     42    <property name="plugin.osx.jar"         location="${plugin.dist.dir}/${ant.project.name}-osx.jar"/>
    3643    <property name="plugin.sources.jar"     location="${plugin.dist.dir}/${ant.project.name}-sources.jar"/>
    3744    <property name="plugin.javadoc.jar"     location="${plugin.dist.dir}/${ant.project.name}-javadoc.jar"/>
     
    4148    <property name="ivy.version"            value="2.5.0-rc1"/>
    4249
    43     <!-- For Windows-specific stuff -->
    44     <condition property="isWindows">
    45         <os family="Windows"/>
    46     </condition>
     50    <!-- For platform-specific stuff -->
     51    <condition property="isWindows"><os family="Windows"/></condition>
     52    <condition property="isUnix"><os family="Unix"/></condition>
     53    <condition property="isMac"><os family="Mac"/></condition>
    4754    <!-- For Java specific stuff by version -->
    4855    <condition property="isJava9"><matches string="${ant.java.version}" pattern="(1.)?(9|1[0-9])" /></condition>
     
    7582            <exclude name="**/*-sources.jar"/>
    7683            <exclude name="**/*-javadoc.jar"/>
     84            <exclude name="**/*-unixoid.jar" unless="isUnix"/>
     85            <exclude name="**/*-windows.jar" unless="isWindows"/>
     86            <exclude name="**/*-osx.jar" unless="isMac"/>
    7787        </fileset>
    7888        <fileset refid="plugin.requires.jars"/>
     
    150160        <echo message="creating ${ant.project.name}.jar ... "/>
    151161        <antcall target="setup-dist" />
    152         <delete file="MANIFEST" failonerror="no"/>
    153         <manifest file="MANIFEST" mode="update">
     162        <delete failonerror="no">
     163            <fileset dir="." includes="${manifest}*" />
     164        </delete>
     165        <manifest file="${manifest}" mode="update">
    154166            <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
    155167            <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
     
    198210        <jar destfile="${plugin.sources.jar}" basedir="${plugin.src.dir}" level="9"/>
    199211        <jar destfile="${plugin.javadoc.jar}" basedir="${plugin.doc.dir}" level="9"/>
    200         <delete file="MANIFEST" failonerror="no"/>
     212        <delete failonerror="no">
     213            <fileset dir="." includes="${manifest}*" />
     214        </delete>
    201215        <antcall target="post-dist" />
    202216    </target>
    203217    <target name="build-jar">
    204         <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}" manifest="MANIFEST" manifestencoding="UTF-8" duplicate="preserve" level="9">
     218        <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}" manifest="${manifest}" manifestencoding="UTF-8" duplicate="preserve" level="9">
    205219            <restrict>
    206220                <not><or>
     
    225239    </target>
    226240    <target name="add-manifest-attribute" depends="check-manifest-attribute" if="have-${property.name}">
    227         <manifest file="MANIFEST" mode="update">
     241        <manifest file="${manifest}" mode="update">
    228242            <attribute name="${manifest.attribute}" value="${property.value}" />
    229243        </manifest>
     
    549563                    <path refid="test.classpath"/>
    550564                </classpath>
    551                                 <compilerarg value="-Xlint:all"/>
    552                                 <compilerarg value="-Xlint:-serial"/>
     565                <compilerarg value="-Xlint:all"/>
     566                <compilerarg value="-Xlint:-serial"/>
    553567            </javac>
    554568        </sequential>
     
    611625                                                                         org/marvinproject/**/*.java,
    612626                                                                         org/netbeans/**/*.java,
    613                                                                                                                                                 org/openstreetmap/josm/plugins/dataimport/io/tcx/**/*.java,
    614                                                                                                                                                 org/openstreetmap/josm/plugins/ohe/parser/**/*.java,
    615                                                                                                                                                 org/openstreetmap/josm/plugins/pdfimport/pdfbox/operators/**/*.java
    616                                                                                                                                                 org/openstreetmap/josm/plugins/roadsigns/javacc/**/*.java,
     627                                                                        org/openstreetmap/josm/plugins/dataimport/io/tcx/**/*.java,
     628                                                                        org/openstreetmap/josm/plugins/ohe/parser/**/*.java,
     629                                                                        org/openstreetmap/josm/plugins/pdfimport/pdfbox/operators/**/*.java
     630                                                                        org/openstreetmap/josm/plugins/roadsigns/javacc/**/*.java,
    617631                                                                         org/osgeo/**/*.java,
    618                                                                                                                                                 "/>
     632                                                                        "/>
    619633            <fileset dir="${basedir}/test" includes="**/*.java" erroronmissingdir="false"/>
    620634            <formatter type="xml" toFile="checkstyle-josm-${ant.project.name}.xml"/>
     
    688702        <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
    689703    </target>
    690         <target name="clean_ivy">
    691                 <delete failonerror="false">
    692                         <fileset dir="${plugin.lib.dir}">
    693                                 <include name="**/*.jar"/>
    694                                 <exclude name="**/*-custom.jar" />
    695                         </fileset>
    696                 </delete>
    697         </target>
    698         <target name="fetch_dependencies" depends="clean_ivy, init-ivy">
    699                 <echo>fetching dependencies with ivy</echo>
    700                 <ivy:settings file="ivy_settings.xml" />
    701                 <ivy:retrieve pattern="${plugin.lib.dir}/[artifact]-[revision](-[classifier]).[ext]" conf="default" />
    702         </target>
     704    <target name="clean_ivy">
     705        <delete failonerror="false">
     706            <fileset dir="${plugin.lib.dir}">
     707                <include name="**/*.jar"/>
     708                <exclude name="**/*-custom.jar" />
     709            </fileset>
     710        </delete>
     711    </target>
     712    <target name="fetch_dependencies" depends="clean_ivy, init-ivy">
     713        <echo>fetching dependencies with ivy</echo>
     714        <ivy:settings file="ivy_settings.xml" />
     715        <ivy:retrieve pattern="${plugin.lib.dir}/[artifact]-[revision](-[classifier]).[ext]" conf="default" />
     716    </target>
    703717</project>
Note: See TracChangeset for help on using the changeset viewer.