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