Changeset 15977 in josm


Ignore:
Timestamp:
2020-03-01T20:47:38+01:00 (16 months ago)
Author:
simon04
Message:

see #16860, see #18140 - Setup Apache Ivy (patch by wiktorn, modified)

Location:
trunk
Files:
6 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/.classpath

    r15620 r15977  
    3434                </attributes>
    3535        </classpathentry>
     36        <classpathentry kind="con" path="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?project=JOSM&amp;ivyXmlPath=ivy.xml&amp;confs=*"/>
    3637        <classpathentry kind="lib" path="test/lib/jfcunit.jar">
    3738                <attributes>
  • trunk/.project

    r15033 r15977  
    4343                <nature>sf.eclipse.javacc.javaccnature</nature>
    4444                <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
     45                <nature>org.apache.ivyde.eclipse.ivynature</nature>
    4546        </natures>
    4647</projectDescription>
  • trunk/build.xml

    r15974 r15977  
    99**
    1010-->
    11 <project xmlns:as="antlib:org.codehaus.mojo.animal_sniffer" name="josm" default="dist" xmlns:jacoco="antlib:org.jacoco.ant" xmlns:if="ant:if" xmlns:unless="ant:unless">
    12     <target name="init-properties">
     11<project name="josm" default="dist"
     12         xmlns:as="antlib:org.codehaus.mojo.animal_sniffer"
     13         xmlns:if="ant:if"
     14         xmlns:ivy="antlib:org.apache.ivy.ant"
     15         xmlns:jacoco="antlib:org.jacoco.ant"
     16         xmlns:unless="ant:unless"
     17>
     18    <target name="init-ivy">
     19        <dirname property="base.dir" file="${ant.file.josm}"/>
     20        <property name="lib.dir"   location="${base.dir}/lib"/>
     21        <property name="tools.dir" location="${base.dir}/tools"/>
     22        <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpath="${tools.dir}/ivy/ivy.jar"/>
     23    </target>
     24    <target name="init-properties" depends="resolve">
    1325        <property environment="env"/>
    1426        <!-- Load properties in a target and not at top level, so this build file can be
     
    1729        of the importing ant file. Use ${base.dir} instead, which is always the parent
    1830        directory of this file. -->
    19         <dirname property="base.dir" file="${ant.file.josm}"/>
    2031        <property name="test.dir" location="${base.dir}/test"/>
    2132        <property name="src.dir" location="${base.dir}/src"/>
     
    190201        <!-- create josm-custom.jar -->
    191202        <delete file="${dist.jar}"/>
     203        <!-- extract libraries to build dir to create uber-jar -->
     204        <unzip dest="${build.dir}">
     205            <fileset refid="runtime.fileset"/>
     206            <patternset>
     207                <exclude name="META-INF/**"/>
     208                <exclude name="*"/>
     209            </patternset>
     210        </unzip>
    192211        <jar destfile="${dist.jar}" basedir="${build.dir}" level="${clevel}">
    193212            <!-- add attribute excludes="**/*BZip2*,**/*Bzip2*" to create a non-bzip2 supporting jar -->
     
    388407            <compilerarg line="-Xmaxwarns 1000"/>
    389408            <exclude name="org/openstreetmap/josm/io/audio/fx/*.java" if:set="noJavaFX"/>
     409            <classpath>
     410                <path refid="runtime.path"/>
     411            </classpath>
    390412        </javac>
    391413
     
    9811003                reportLevel="low"
    9821004                >
     1005            <classpath>
     1006                <path refid="spotbugs-classpath"/>
     1007                <path refid="compile.path"/>
     1008            </classpath>
    9831009            <sourcePath path="${base.dir}/src" />
    9841010            <class location="${dist.jar}" />
     
    11081134        <move file="${modules.dir}/dots/summary.dot.png" tofile="${modules.dir}/josm-with-all-dependencies.png"/>
    11091135    </target>
     1136    <target name="resolve" depends="init-ivy">
     1137        <ivy:resolve keep="true"/>
     1138        <ivy:report todir="${tools.dir}/ivy-report" graph="false"/>
     1139        <ivy:cachepath pathid="compile.path" conf="compile"/>
     1140        <ivy:cachepath pathid="runtime.path" conf="runtime"/>
     1141        <ivy:cachefileset setid="runtime.fileset" conf="runtime"/>
     1142        <ivy:cachepath pathid="test.path" conf="test"/>
     1143        <ivy:retrieve pattern="${tools.dir}/ivy/[artifact]-[type].[ext]" conf="ivy"/>
     1144    </target>
     1145    <target name="bootstrap-workspace" description="Copy libraries from ivy cache to workspace folders for IDE" depends="resolve">
     1146        <delete dir="${lib.dir}"/>
     1147        <ivy:retrieve pattern="${lib.dir}/compile/[artifact]-[type].[ext]" conf="compile"/>
     1148        <ivy:retrieve pattern="${lib.dir}/runtime/[artifact]-[type].[ext]" conf="runtime"/>
     1149    </target>
    11101150</project>
Note: See TracChangeset for help on using the changeset viewer.