Changeset 36139 in osm


Ignore:
Timestamp:
2023-09-15T17:07:20+02:00 (16 months ago)
Author:
taylor.smock
Message:

Fix #23114: Add module-info to JMapViewer

Location:
applications/viewer/jmapviewer
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • applications/viewer/jmapviewer/build.xml

    r35919 r36139  
    22<project default="all" name="jmapviewer" xmlns:jacoco="antlib:org.jacoco.ant" xmlns:if="ant:if" xmlns:unless="ant:unless">
    33
    4     <property name="java.lang.version" value="1.8" />
     4    <property name="java.lang.version" value="8" />
    55    <dirname property="base.dir" file="${ant.file.jmapviewer}"/>
    66    <property name="tools.dir" location="${base.dir}/tools"/>
     
    5858
    5959    <target name="build" depends="clean">
    60         <javac srcdir="src" destdir="bin" source="${java.lang.version}" target="${java.lang.version}" debug="true" includeantruntime="false" encoding="UTF-8">
     60        <!-- compile module info - we need to compile everything to ensure that all requires are there -->
     61        <javac srcdir="src" destdir="bin" release="9" debug="true" includeantruntime="false" encoding="UTF-8" if:set="isJava9">
     62            <include name="module-info.java" />
     63            <include name="org/openstreetmap/gui/jmapviewer/**" />
     64        </javac>
     65
     66        <!-- Remove the files compiled with Java 9 so that the next compile stage will compile to the appropriate version -->
     67        <delete>
     68            <fileset dir="bin">
     69                <include name="org/openstreetmap/gui/jmapviewer/**" />
     70            </fileset>
     71        </delete>
     72
     73        <javac srcdir="src" destdir="bin" release="${java.lang.version}" debug="true" includeantruntime="false" encoding="UTF-8">
    6174            <include name="org/openstreetmap/gui/jmapviewer/**" />
    6275        </javac>
     
    8093        <!-- Create the JAR file containing the compiled class files -->
    8194        <jar destfile="JMapViewer.jar" filesetmanifest="mergewithoutmain">
    82             <fileset dir="bin" includes="**/jmapviewer/**" />
     95            <fileset dir="bin" includes="module-info.class,**/jmapviewer/**" />
    8396        </jar>
    8497        <!-- Create the JAR file containing the source java files -->
    8598        <jar destfile="JMapViewer_src.jar" filesetmanifest="mergewithoutmain">
    86             <fileset dir="src" includes="**/jmapviewer/**" />
     99            <fileset dir="src" includes="module-info.java,**/jmapviewer/**" />
    87100        </jar>
    88101    </target>
     
    123136            classpath="tools/checkstyle/checkstyle-all.jar"/>
    124137        <checkstyle config="tools/checkstyle/jmapviewer_checks.xml">
    125             <fileset dir="${basedir}/src" includes="**/*.java" />
     138            <!-- Exclude the module-info since checkstyle currently cannot parse it -->
     139            <fileset dir="${basedir}/src" includes="**/*.java" excludes="module-info.java" />
    126140            <formatter type="xml" toFile="checkstyle-jmapviewer.xml"/>
    127141        </checkstyle>
Note: See TracChangeset for help on using the changeset viewer.