Ticket #16860: ivy-jmapviewer-v2.patch

File ivy-jmapviewer-v2.patch, 12.3 KB (added by simon04, 6 years ago)
  • .classpath

    commit 9d0282d149eb1357013856132f68360670843856
    Author: Simon Legner <Simon.Legner@gmail.com>
    Date:   Sat Jan 5 21:42:34 2019 +0100
    
        fix #16860 - Remove svn:external for jmapviewer and use Apache Ivy to download jar (wiktorn)
    
    diff --git a/.classpath b/.classpath
    index 91faffce1..66a229b8c 100644
    a b  
    3232                        <attribute name="test" value="true"/>
    3333                </attributes>
    3434        </classpathentry>
     35        <classpathentry kind="con" path="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?project=JOSM&amp;ivyXmlPath=ivy.xml&amp;confs=*"/>
    3536        <classpathentry kind="lib" path="test/lib/jfcunit.jar">
    3637                <attributes>
    3738                        <attribute name="test" value="true"/>
  • .project

    diff --git a/.project b/.project
    index 572b2b3c1..f8629a548 100644
    a b  
    4343                <nature>org.sonar.ide.eclipse.core.sonarNature</nature>
    4444                <nature>sf.eclipse.javacc.javaccnature</nature>
    4545                <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
     46                <nature>org.apache.ivyde.eclipse.ivynature</nature>
    4647        </natures>
    4748</projectDescription>
  • build.xml

    diff --git a/build.xml b/build.xml
    index 920e5ed72..0e091ca89 100644
    a b  
    88**   https://josm.openstreetmap.de/wiki/DevelopersGuide/CreateBuild
    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
    1527        imported from an IDE ant file (Netbeans) without messing up IDE properties.
    1628        When imported from another file, ${basedir} will point to the parent directory
    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"/>
    2233        <condition property="noJavaFX">
     
    3041        <property name="build.dir" location="${base.dir}/build"/>
    3142        <property name="dist.dir" location="${base.dir}/dist"/>
    3243        <property name="modules.dir" location="${dist.dir}/modules"/>
    33         <property name="tools.dir" location="${base.dir}/tools"/>
    3444        <property name="pmd.dir" location="${tools.dir}/pmd"/>
    3545        <property name="checkstyle.dir" location="${tools.dir}/checkstyle"/>
    3646        <property name="spotbugs.dir" location="${tools.dir}/spotbugs"/>
    Build-Date: ${build.tstamp}  
    179189        <copy file="LICENSE" todir="${build.dir}"/>
    180190        <!-- create josm-custom.jar -->
    181191        <delete file="${dist.jar}"/>
     192        <!-- extract libraries to build dir to create uber-jar -->
     193        <unzip dest="${build.dir}">
     194            <fileset refid="runtime.fileset" />
     195            <patternset>
     196                <exclude name="META-INF/**" />
     197                <exclude name="*" />
     198            </patternset>
     199        </unzip>
     200
    182201        <jar destfile="${dist.jar}" basedir="${build.dir}" level="${clevel}">
    183202            <!-- add attribute excludes="**/*BZip2*,**/*Bzip2*" to create a non-bzip2 supporting jar -->
    184203            <manifest>
    Build-Date: ${build.tstamp}  
    196215            <zipfileset dir="images" prefix="images"/>
    197216            <zipfileset dir="data" prefix="data"/>
    198217            <zipfileset dir="styles" prefix="styles"/>
    199             <zipfileset dir="${src.dir}/org/openstreetmap/gui/jmapviewer/images" prefix="org/openstreetmap/gui/jmapviewer/images"/>
    200218        </jar>
    201219    </target>
    202220    <!-- Mac OS X target -->
    Build-Date: ${build.tstamp}  
    326344            <exclude name="org/apache/commons/logging/impl/ServletContextCleaner.java"/>
    327345        </javac>
    328346    </target>
    329     <target name="compile-jmapviewer" depends="init">
    330         <!-- JMapViewer -->
    331         <javac sourcepath="" srcdir="${src.dir}" fork="yes"
    332             excludes="com/**,javax/**,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/**,org/tukaani/**"
    333             destdir="${build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="UTF-8">
    334             <compilerarg value="-J-Xbootclasspath/p:${error_prone_javac.jar}" unless:set="isJava9"/>
    335             <compilerarg line="-XDcompilePolicy=simple"/>
    336             <compilerarg value="-processorpath"/>
    337             <compilerarg pathref="processor.path"/>
    338             <compilerarg value="-Xlint:cast"/>
    339             <compilerarg value="-Xlint:deprecation"/>
    340             <compilerarg value="-Xlint:dep-ann"/>
    341             <compilerarg value="-Xlint:divzero"/>
    342             <compilerarg value="-Xlint:empty"/>
    343             <compilerarg value="-Xlint:finally"/>
    344             <compilerarg value="-Xlint:overrides"/>
    345             <!--<compilerarg value="-Xlint:rawtypes"/>-->
    346             <compilerarg value="-Xlint:static"/>
    347             <compilerarg value="-Xlint:try"/>
    348             <compilerarg value="-Xlint:unchecked"/>
    349             <!-- Undocumented argument to ignore "Sun internal proprietary API" warning, see http://stackoverflow.com/a/13862308/2257172 -->
    350             <compilerarg value="-XDignore.symbol.file"/>
    351             <compilerarg value="-Xplugin:ErrorProne -Xep:CatchAndPrintStackTrace:OFF -Xep:ReferenceEquality:OFF -Xep:StringSplitter:OFF"/>
    352             <compilerarg line="-Xmaxwarns 1000"/>
    353         </javac>
    354     </target>
    355     <target name="compile" depends="init,javacc,compile-cots,compile-jmapviewer">
     347    <target name="compile" depends="init,javacc,compile-cots">
    356348        <!-- JOSM -->
    357349        <javac sourcepath="" srcdir="${src.dir}" fork="yes"
    358350            excludes="com/**,javax/**,oauth/**,org/apache/commons/**,org/glassfish/**,org/openstreetmap/gui/jmapviewer/**,org/tukaani/**"
    Build-Date: ${build.tstamp}  
    377369            <compilerarg value="-Xplugin:ErrorProne -Xep:ReferenceEquality:OFF -Xep:ImmutableEnumChecker:OFF -Xep:FutureReturnValueIgnored:OFF -Xep:FloatingPointLiteralPrecision:OFF -Xep:ShortCircuitBoolean:OFF -Xep:StringSplitter:OFF -Xep:JdkObsolete:OFF -Xep:UnnecessaryParentheses:OFF -Xep:EqualsGetClass:OFF -Xep:ThreadPriorityCheck:OFF -Xep:UndefinedEquals:OFF"/>
    378370            <compilerarg line="-Xmaxwarns 1000"/>
    379371            <exclude name="org/openstreetmap/josm/io/audio/fx/*.java" if:set="noJavaFX"/>
     372            <classpath>
     373                <path refid="runtime.path" />
     374            </classpath>
    380375        </javac>
    381376
    382377        <copy todir="build" failonerror="no" includeemptydirs="no">
    Build-Date: ${build.tstamp}  
    394389        <javadoc destdir="javadoc"
    395390                sourcepath="${src.dir}"
    396391                encoding="UTF-8"
    397                 packagenames="org.openstreetmap.josm.*,org.openstreetmap.gui.jmapviewer.*"
     392                packagenames="org.openstreetmap.josm.*"
    398393                excludepackagenames="org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.*"
    399394                windowtitle="JOSM"
    400395                use="true"
    Build-Date: ${build.tstamp}  
    929924
    930925    <target name="spotbugs" depends="dist">
    931926        <taskdef name="spotbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpath="${spotbugs.dir}/spotbugs-ant.jar"/>
    932         <path id="spotbugs-classpath">
     927        <path id="spotbugs.classpath">
    933928            <fileset dir="${spotbugs.dir}">
    934929                <include name="*.jar"/>
    935930            </fileset>
    936931        </path>
    937         <property name="spotbugs-classpath" refid="spotbugs-classpath"/>
    938932        <spotbugs output="xml"
    939933                outputFile="spotbugs-josm.xml"
    940                 classpath="${spotbugs-classpath}"
    941934                pluginList=""
    942935                excludeFilter="${spotbugs.dir}/josm-filter.xml"
    943936                effort="max"
    944937                reportLevel="low"
    945938                >
     939            <classpath>
     940                <path refid="spotbugs.classpath" />
     941                <path refid="compile.path" />
     942            </classpath>
    946943            <sourcePath path="${base.dir}/src" />
    947944            <class location="${dist.jar}" />
    948945        </spotbugs>
    Build-Date: ${build.tstamp}  
    10711068        </exec>
    10721069        <move file="${modules.dir}/dots/summary.dot.png" tofile="${modules.dir}/josm-with-all-dependencies.png"/>
    10731070    </target>
     1071    <target name="resolve" depends="init-ivy">
     1072        <ivy:resolve keep="true"/>
     1073        <ivy:report todir="${tools.dir}/ivy-report" graph="false"/>
     1074        <ivy:cachepath pathid="compile.path" conf="compile"/>
     1075        <ivy:cachepath pathid="runtime.path" conf="runtime"/>
     1076        <ivy:cachefileset setid="runtime.fileset" conf="runtime"/>
     1077        <ivy:cachepath pathid="test.path" conf="test"/>
     1078        <ivy:cachepath pathid="groovy-ant.path" conf="groovy-ant-task"/>
     1079        <ivy:cachepath pathid="groovy-scripts.path" conf="groovy-scripts"/>
     1080        <ivy:retrieve pattern="${tools.dir}/ivy/[artifact].[ext]" conf="ivy"/>
     1081    </target>
     1082    <target name="bootstrap-workspace" description="Copy libraries from ivy cache to workspace folders for IDE" depends="resolve">
     1083        <delete dir="${lib.dir}"/>
     1084        <ivy:retrieve pattern="${lib.dir}/compile/[artifact].[ext]" conf="compile"/>
     1085        <ivy:retrieve pattern="${lib.dir}/runtime/[artifact].[ext]" conf="runtime"/>
     1086    </target>
    10741087</project>
  • new file ivy.xml

    diff --git a/ivy.xml b/ivy.xml
    new file mode 100644
    index 000000000..a395cf2f2
    - +  
     1<?xml version="1.0" encoding="utf-8"?>
     2
     3<ivy-module version="2.0">
     4    <info organisation="org.openstreetmap" module="josm"/>
     5    <configurations>
     6        <conf name="groovy-scripts" description="Dependencies for Groovy scripts" />
     7        <conf name="groovy-ant-task" description="Dependencies for Groovy scripts" />
     8        <conf name="ivy" description="Apache Ivy configration for self-update" />
     9        <!--  configuration that should be used when specifying dependencies -->
     10        <conf name="implementation" description="All libs JOSM uses that plugins should not use" />
     11        <conf name="api" description="All libs that JOSM uses and are available for plugins" />
     12        <conf name="runtimeOnly" description="The libs shipped with JOSM that we do not need during compilation" />
     13        <conf name="provided" description="The libs we need during compilation but not on application start" />
     14        <conf name="epsg" description="Everything epsg needs- which is currently all of JOSM." />
     15        <!--  Meta configuration used in build scripts -->
     16        <conf name="runtime" description="Libraries only needed at runtime" extends="implementation,api,runtimeOnly"/>
     17        <conf name="compile" description="Libraries needed only for compilation" extends="implementation,api,provided" />
     18        <conf name="test" description="Libraries only needed for testing" extends="compile,runtime" />
     19    </configurations>
     20    <dependencies>
     21        <!--  api -->
     22        <!-- https://mvnrepository.com/artifact/org.openstreetmap.jmapviewer/jmapviewer -->
     23        <dependency org="org.openstreetmap.jmapviewer" name="jmapviewer" rev="2.8" conf="api->default"/>
     24    </dependencies>
     25</ivy-module>
  • new file ivysettings.xml

    diff --git a/ivysettings.xml b/ivysettings.xml
    new file mode 100644
    index 000000000..586663f66
    - +  
     1<ivysettings>
     2  <settings defaultResolver="chain"/>
     3  <resolvers>
     4    <chain name="chain">
     5      <ibiblio name="josm-nexus" m2compatible="true" root="https://josm.openstreetmap.de/nexus/content/repositories/public/" />
     6    </chain>
     7  </resolvers>
     8</ivysettings>