Ticket #16860: ivy-jmapviewer.patch

File ivy-jmapviewer.patch, 13.8 KB (added by wiktorn, 7 years ago)
  • .classpath

     
    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

     
    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

     
    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 xmlns:as="antlib:org.codehaus.mojo.animal_sniffer" name="josm" default="dist"
     12    xmlns:jacoco="antlib:org.jacoco.ant"
     13    xmlns:if="ant:if"
     14    xmlns:unless="ant:unless"
     15    xmlns:ivy="antlib:org.apache.ivy.ant"
     16>
     17    <target name="init-ivy">
     18        <dirname property="base.dir" file="${ant.file.josm}"/>
     19        <property name="lib.dir"   location="${base.dir}/lib"/>
     20        <property name="tools.dir" location="${base.dir}/tools"/>
     21        <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpath="${tools.dir}/ivy/ivy.jar"/>
     22    </target>
     23    <target name="init-properties" depends="resolve">
    1324        <property environment="env"/>
    1425        <!-- Load properties in a target and not at top level, so this build file can be
    1526        imported from an IDE ant file (Netbeans) without messing up IDE properties.
     
    1627        When imported from another file, ${basedir} will point to the parent directory
    1728        of the importing ant file. Use ${base.dir} instead, which is always the parent
    1829        directory of this file. -->
    19         <dirname property="base.dir" file="${ant.file.josm}"/>
    2030        <property name="test.dir" location="${base.dir}/test"/>
    2131        <property name="src.dir" location="${base.dir}/src"/>
    2232        <condition property="noJavaFX">
     
    3040        <property name="build.dir" location="${base.dir}/build"/>
    3141        <property name="dist.dir" location="${base.dir}/dist"/>
    3242        <property name="modules.dir" location="${dist.dir}/modules"/>
    33         <property name="tools.dir" location="${base.dir}/tools"/>
    3443        <property name="pmd.dir" location="${tools.dir}/pmd"/>
    3544        <property name="checkstyle.dir" location="${tools.dir}/checkstyle"/>
    3645        <property name="spotbugs.dir" location="${tools.dir}/spotbugs"/>
     
    178187        <copy file="LICENSE" todir="${build.dir}"/>
    179188        <!-- create josm-custom.jar -->
    180189        <delete file="${dist.jar}"/>
     190        <!-- extract libraries to build dir to create uber-jar -->
     191        <unzip dest="${build.dir}">
     192            <fileset refid="runtime.fileset" />
     193            <patternset>
     194                <exclude name="META-INF/**" />
     195                <exclude name="*" />
     196            </patternset>
     197        </unzip>
     198
    181199        <jar destfile="${dist.jar}" basedir="${build.dir}" level="${clevel}">
    182200            <!-- add attribute excludes="**/*BZip2*,**/*Bzip2*" to create a non-bzip2 supporting jar -->
    183201            <manifest>
     
    195213            <zipfileset dir="images" prefix="images"/>
    196214            <zipfileset dir="data" prefix="data"/>
    197215            <zipfileset dir="styles" prefix="styles"/>
    198             <zipfileset dir="${src.dir}/org/openstreetmap/gui/jmapviewer/images" prefix="org/openstreetmap/gui/jmapviewer/images"/>
    199216        </jar>
    200217    </target>
    201218    <!-- Mac OS X target -->
     
    325342            <exclude name="org/apache/commons/logging/impl/ServletContextCleaner.java"/>
    326343        </javac>
    327344    </target>
    328     <target name="compile-jmapviewer" depends="init">
    329         <!-- JMapViewer -->
    330         <javac sourcepath="" srcdir="${src.dir}" fork="yes"
    331             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/**,gnu/**"
    332             destdir="${build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="UTF-8">
    333             <compilerarg value="-J-Xbootclasspath/p:${error_prone_javac.jar}" unless:set="isJava9"/>
    334             <compilerarg line="-XDcompilePolicy=simple"/>
    335             <compilerarg value="-processorpath"/>
    336             <compilerarg pathref="processor.path"/>
    337             <compilerarg value="-Xlint:cast"/>
    338             <compilerarg value="-Xlint:deprecation"/>
    339             <compilerarg value="-Xlint:dep-ann"/>
    340             <compilerarg value="-Xlint:divzero"/>
    341             <compilerarg value="-Xlint:empty"/>
    342             <compilerarg value="-Xlint:finally"/>
    343             <compilerarg value="-Xlint:overrides"/>
    344             <!--<compilerarg value="-Xlint:rawtypes"/>-->
    345             <compilerarg value="-Xlint:static"/>
    346             <compilerarg value="-Xlint:try"/>
    347             <compilerarg value="-Xlint:unchecked"/>
    348             <!-- Undocumented argument to ignore "Sun internal proprietary API" warning, see http://stackoverflow.com/a/13862308/2257172 -->
    349             <compilerarg value="-XDignore.symbol.file"/>
    350             <compilerarg value="-Xplugin:ErrorProne -Xep:CatchAndPrintStackTrace:OFF -Xep:ReferenceEquality:OFF -Xep:StringSplitter:OFF"/>
    351             <compilerarg line="-Xmaxwarns 1000"/>
    352         </javac>
    353     </target>
    354     <target name="compile" depends="init,javacc,compile-cots,compile-jmapviewer">
     345    <target name="compile" depends="init,javacc,compile-cots">
    355346        <!-- JOSM -->
    356347        <javac sourcepath="" srcdir="${src.dir}" fork="yes"
    357348            excludes="com/**,javax/**,gnu/**,oauth/**,org/apache/commons/**,org/glassfish/**,org/openstreetmap/gui/jmapviewer/**,org/tukaani/**"
     
    376367            <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"/>
    377368            <compilerarg line="-Xmaxwarns 1000"/>
    378369            <exclude name="org/openstreetmap/josm/io/audio/fx/*.java" if:set="noJavaFX"/>
     370            <classpath>
     371                <path refid="runtime.path" />
     372            </classpath>
    379373        </javac>
    380374
    381375        <copy todir="build" failonerror="no" includeemptydirs="no">
     
    393387        <javadoc destdir="javadoc"
    394388                sourcepath="${src.dir}"
    395389                encoding="UTF-8"
    396                 packagenames="org.openstreetmap.josm.*,org.openstreetmap.gui.jmapviewer.*"
     390                packagenames="org.openstreetmap.josm.*"
    397391                excludepackagenames="org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.*"
    398392                windowtitle="JOSM"
    399393                use="true"
     
    830824        <attribute name="output"/>
    831825        <sequential>
    832826            <echo message="Generating Taginfo for type @{type} to @{output}"/>
    833             <groovy src="${taginfoextract}" classpath="${dist.jar};${toString:groovy.classpath};${spotbugs.dir}/spotbugs-annotations.jar">
     827            <groovy src="${taginfoextract}">
     828                <classpath>
     829                    <pathelement location="${dist.jar}" />
     830                    <pathelement location="${spotbugs.dir}/spotbugs-annotations.jar" />
     831                    <path refid="groovy.classpath" />
     832                    <path refid="compile.path" />
     833                </classpath>
    834834                <arg value="-t"/>
    835835                <arg value="@{type}"/>
    836836                <arg value="--noexit"/>
     
    919919
    920920    <target name="spotbugs" depends="dist">
    921921        <taskdef name="spotbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpath="${spotbugs.dir}/spotbugs-ant.jar"/>
    922         <path id="spotbugs-classpath">
     922        <path id="spotbugs.classpath">
    923923            <fileset dir="${spotbugs.dir}">
    924924                <include name="*.jar"/>
    925925            </fileset>
    926926        </path>
    927         <property name="spotbugs-classpath" refid="spotbugs-classpath"/>
    928927        <spotbugs output="xml"
    929928                outputFile="spotbugs-josm.xml"
    930                 classpath="${spotbugs-classpath}"
    931929                pluginList=""
    932930                excludeFilter="${spotbugs.dir}/josm-filter.xml"
    933931                effort="max"
    934932                reportLevel="low"
    935933                >
     934            <classpath>
     935                <path refid="spotbugs.classpath" />
     936                <path refid="compile.path" />
     937            </classpath>
    936938            <sourcePath path="${base.dir}/src" />
    937939            <class location="${dist.jar}" />
    938940        </spotbugs>
     
    10441046        </exec>
    10451047        <move file="${modules.dir}/dots/summary.dot.png" tofile="${modules.dir}/josm-with-all-dependencies.png"/>
    10461048    </target>
     1049    <target name="resolve" depends="init-ivy">
     1050        <ivy:resolve keep="true"/>
     1051        <ivy:report todir="${tools.dir}/ivy-report" graph="false"/>
     1052        <ivy:cachepath pathid="compile.path"               conf="compile"/>
     1053        <ivy:cachepath pathid="runtime.path"               conf="runtime"/>
     1054        <ivy:cachefileset setid="runtime.fileset"          conf="runtime"/>
     1055        <ivy:cachepath pathid="test.path"                  conf="test"/>
     1056        <ivy:cachepath pathid="groovy-ant.path"            conf="groovy-ant-task"/>
     1057        <ivy:cachepath pathid="groovy-scripts.path"        conf="groovy-scripts"/>
     1058        <ivy:retrieve pattern="${tools.dir}/ivy/[artifact].[ext]" conf="ivy"/>
     1059    </target>
     1060    <target name="bootstrap-workspace" description="Copy libraries from ivy cache to workspace folders for IDE" depends="resolve">
     1061        <delete dir="${lib.dir}"/>
     1062        <ivy:retrieve pattern="${lib.dir}/compile/[artifact].[ext]" conf="compile"/>
     1063        <ivy:retrieve pattern="${lib.dir}/runtime/[artifact].[ext]" conf="runtime"/>
     1064    </target>
     1065
    10471066</project>
  • ivy.xml

     
     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.7" conf="api->default"/>
     24    </dependencies>
     25</ivy-module>
  • ivysettings.xml

     
     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>
  • src/org/openstreetmap