[9095] | 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
---|
[34124] | 2 | <project default="all" name="jmapviewer" xmlns:if="ant:if" xmlns:unless="ant:unless">
|
---|
[9095] | 3 |
|
---|
[34124] | 4 | <property name="java.lang.version" value="1.8" />
|
---|
| 5 | <!-- For Java9-specific stuff -->
|
---|
| 6 | <condition property="isJava9">
|
---|
| 7 | <matches string="${ant.java.version}" pattern="(1.)?(9|1[0-9])" />
|
---|
| 8 | </condition>
|
---|
| 9 |
|
---|
[33805] | 10 | <target name="all" depends="clean,build,svn_info,pack,create_run_jar,spotbugs,checkstyle,javadoc,create_release_zip,create_source_release_zip" />
|
---|
[9095] | 11 |
|
---|
| 12 | <target name="clean">
|
---|
[29985] | 13 | <mkdir dir="bin" />
|
---|
[9095] | 14 | <delete>
|
---|
| 15 | <fileset dir="bin">
|
---|
| 16 | <include name="**" />
|
---|
| 17 | </fileset>
|
---|
[29985] | 18 | <fileset dir="." includes="*.jar"/>
|
---|
[9095] | 19 | </delete>
|
---|
| 20 | </target>
|
---|
| 21 |
|
---|
| 22 | <target name="build">
|
---|
[34124] | 23 | <javac srcdir="src" destdir="bin" source="${java.lang.version}" target="${java.lang.version}" debug="true" includeantruntime="false" encoding="UTF-8">
|
---|
[25370] | 24 | <include name="org/openstreetmap/gui/jmapviewer/**" />
|
---|
[11783] | 25 | </javac>
|
---|
| 26 |
|
---|
[9095] | 27 | <copy todir="bin">
|
---|
| 28 | <fileset dir="src">
|
---|
| 29 | <include name="**/*.png" />
|
---|
| 30 | </fileset>
|
---|
| 31 | </copy>
|
---|
| 32 | </target>
|
---|
[34124] | 33 |
|
---|
[29618] | 34 | <target name="svn_info" description="Get SVN info for use in JAR/ZIP filenames.">
|
---|
[29985] | 35 | <!-- Get the svn ReleaseVersion property -->
|
---|
| 36 | <exec executable="svn" outputproperty="svnReleaseVersion">
|
---|
| 37 | <arg line="propget ReleaseVersion" />
|
---|
[29618] | 38 | <env key="LANG" value="en_US"/>
|
---|
| 39 | </exec>
|
---|
| 40 | </target>
|
---|
| 41 |
|
---|
[31428] | 42 | <target name="pack" depends="build">
|
---|
[25370] | 43 | <!-- Create the JAR file containing the compiled class files -->
|
---|
[29991] | 44 | <jar destfile="JMapViewer.jar" filesetmanifest="mergewithoutmain">
|
---|
[25370] | 45 | <fileset dir="bin" includes="**/jmapviewer/**" />
|
---|
[9095] | 46 | </jar>
|
---|
[25370] | 47 | <!-- Create the JAR file containing the source java files -->
|
---|
[29991] | 48 | <jar destfile="JMapViewer_src.jar" filesetmanifest="mergewithoutmain">
|
---|
[9095] | 49 | <fileset dir="src" includes="**/jmapviewer/**" />
|
---|
| 50 | </jar>
|
---|
| 51 | </target>
|
---|
[29618] | 52 |
|
---|
[29991] | 53 | <!-- if you want to build outside of svn, use "ant clean build [pack]" -->
|
---|
| 54 |
|
---|
[29618] | 55 | <target name="create_run_jar" description="Create a JAR file that can be used to execute the JMapViewer demo app. Requires JMapViewer.jar to be present.">
|
---|
[29991] | 56 | <jar destfile="JMapViewer_Demo.jar" filesetmanifest="mergewithoutmain">
|
---|
[9095] | 57 | <manifest>
|
---|
| 58 | <attribute name="Main-Class" value="org.openstreetmap.gui.jmapviewer.Demo" />
|
---|
[29993] | 59 | <attribute name="Class-Path" value="JMapViewer.jar" />
|
---|
[9095] | 60 | </manifest>
|
---|
| 61 | </jar>
|
---|
| 62 | </target>
|
---|
[25370] | 63 |
|
---|
| 64 | <target name="create_release_zip" description="Create a release zip file containing the binary and source jar files as well as the demo starter">
|
---|
[29985] | 65 | <zip basedir="." destfile="releases/${svnReleaseVersion}/JMapViewer-${svnReleaseVersion}.zip">
|
---|
[25370] | 66 | <include name="JMapViewer*.jar" />
|
---|
| 67 | <include name="Readme.txt" />
|
---|
| 68 | <include name="Gpl.txt" />
|
---|
| 69 | </zip>
|
---|
[29618] | 70 | <delete>
|
---|
| 71 | <fileset dir="." includes="JMapViewer*.jar"/>
|
---|
| 72 | </delete>
|
---|
[25370] | 73 | </target>
|
---|
[29618] | 74 |
|
---|
| 75 | <target name="create_source_release_zip" description="Create a release zip file containing the source files">
|
---|
[29985] | 76 | <zip destfile="releases/${svnReleaseVersion}/JMapViewer-${svnReleaseVersion}-Source.zip">
|
---|
| 77 | <zipfileset file="Readme.txt" prefix="jmapviewer-${svnReleaseVersion}"/>
|
---|
| 78 | <zipfileset file="build.xml" prefix="jmapviewer-${svnReleaseVersion}"/>
|
---|
| 79 | <zipfileset file="Gpl.txt" prefix="jmapviewer-${svnReleaseVersion}"/>
|
---|
[29986] | 80 | <zipfileset dir="src" includes="**/jmapviewer/**" prefix="jmapviewer-${svnReleaseVersion}/src"/>
|
---|
[29618] | 81 | </zip>
|
---|
| 82 | </target>
|
---|
[25370] | 83 |
|
---|
[31428] | 84 | <target name="checkstyle">
|
---|
| 85 | <taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties"
|
---|
[33482] | 86 | classpath="tools/checkstyle/checkstyle-all.jar"/>
|
---|
[31428] | 87 | <checkstyle config="tools/checkstyle/jmapviewer_checks.xml">
|
---|
| 88 | <fileset dir="${basedir}/src" includes="**/*.java" />
|
---|
| 89 | <formatter type="xml" toFile="checkstyle-jmapviewer.xml"/>
|
---|
| 90 | </checkstyle>
|
---|
| 91 | </target>
|
---|
| 92 |
|
---|
[33805] | 93 | <target name="spotbugs" depends="pack">
|
---|
| 94 | <taskdef name="spotbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"
|
---|
| 95 | classpath="tools/spotbugs/spotbugs-ant.jar"/>
|
---|
| 96 | <path id="spotbugs-classpath">
|
---|
| 97 | <fileset dir="tools/spotbugs/">
|
---|
[31428] | 98 | <include name="*.jar"/>
|
---|
| 99 | </fileset>
|
---|
| 100 | </path>
|
---|
[33805] | 101 | <property name="spotbugs-classpath" refid="spotbugs-classpath"/>
|
---|
| 102 | <spotbugs output="xml"
|
---|
| 103 | outputFile="spotbugs-jmapviewer.xml"
|
---|
| 104 | classpath="${spotbugs-classpath}"
|
---|
[31428] | 105 | effort="max"
|
---|
| 106 | >
|
---|
| 107 | <sourcePath path="${basedir}/src" />
|
---|
| 108 | <class location="JMapViewer.jar" />
|
---|
[33805] | 109 | </spotbugs>
|
---|
[31428] | 110 | </target>
|
---|
| 111 |
|
---|
[31436] | 112 | <target name="javadoc">
|
---|
| 113 | <javadoc destdir="javadoc"
|
---|
| 114 | sourcepath="src"
|
---|
| 115 | encoding="UTF-8"
|
---|
| 116 | packagenames="org.openstreetmap.gui.jmapviewer.*"
|
---|
| 117 | windowtitle="JMapViewer"
|
---|
| 118 | use="true"
|
---|
| 119 | private="true"
|
---|
| 120 | linksource="true"
|
---|
| 121 | author="false">
|
---|
[32677] | 122 | <link href="http://docs.oracle.com/javase/8/docs/api"/>
|
---|
[31436] | 123 | <doctitle><![CDATA[<h2>JMapViewer - Javadoc</h2>]]></doctitle>
|
---|
| 124 | <bottom><![CDATA[<a href="https://josm.openstreetmap.de/">JMapViewer</a>]]></bottom>
|
---|
[34124] | 125 | <arg value="-html5" if:set="isJava9" />
|
---|
[31436] | 126 | </javadoc>
|
---|
| 127 | </target>
|
---|
| 128 |
|
---|
[9095] | 129 | </project>
|
---|