source: osm/applications/viewer/jmapviewer/build.xml@ 31439

Last change on this file since 31439 was 31437, checked in by donvip, 9 years ago

[jmapviewer] add javadoc target to "all"

File size: 4.9 KB
Line 
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<project default="all" name="Compile and build java classes plus jar archives">
3
4 <target name="all" depends="clean,build,svn_info,pack,create_run_jar,create_release_zip,create_source_release_zip,findbugs,checkstyle,javadoc" />
5
6 <target name="clean">
7 <mkdir dir="bin" />
8 <delete>
9 <fileset dir="bin">
10 <include name="**" />
11 </fileset>
12 <fileset dir="." includes="*.jar"/>
13 </delete>
14 </target>
15
16 <target name="build">
17 <javac srcdir="src" destdir="bin" source="1.7" target="1.7" debug="true" includeantruntime="false" encoding="UTF-8">
18 <include name="org/openstreetmap/gui/jmapviewer/**" />
19 </javac>
20
21 <copy todir="bin">
22 <fileset dir="src">
23 <include name="**/*.png" />
24 </fileset>
25 </copy>
26 </target>
27
28 <target name="svn_info" description="Get SVN info for use in JAR/ZIP filenames.">
29 <!-- Get the svn ReleaseVersion property -->
30 <exec executable="svn" outputproperty="svnReleaseVersion">
31 <arg line="propget ReleaseVersion" />
32 <env key="LANG" value="en_US"/>
33 </exec>
34 </target>
35
36 <target name="pack" depends="build">
37 <!-- Create the JAR file containing the compiled class files -->
38 <jar destfile="JMapViewer.jar" filesetmanifest="mergewithoutmain">
39 <fileset dir="bin" includes="**/jmapviewer/**" />
40 </jar>
41 <!-- Create the JAR file containing the source java files -->
42 <jar destfile="JMapViewer_src.jar" filesetmanifest="mergewithoutmain">
43 <fileset dir="src" includes="**/jmapviewer/**" />
44 </jar>
45 </target>
46
47 <!-- if you want to build outside of svn, use "ant clean build [pack]" -->
48
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.">
50 <jar destfile="JMapViewer_Demo.jar" filesetmanifest="mergewithoutmain">
51 <manifest>
52 <attribute name="Main-Class" value="org.openstreetmap.gui.jmapviewer.Demo" />
53 <attribute name="Class-Path" value="JMapViewer.jar" />
54 </manifest>
55 </jar>
56 </target>
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">
59 <zip basedir="." destfile="releases/${svnReleaseVersion}/JMapViewer-${svnReleaseVersion}.zip">
60 <include name="JMapViewer*.jar" />
61 <include name="Readme.txt" />
62 <include name="Gpl.txt" />
63 </zip>
64 <delete>
65 <fileset dir="." includes="JMapViewer*.jar"/>
66 </delete>
67 </target>
68
69 <target name="create_source_release_zip" description="Create a release zip file containing the source files">
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}"/>
74 <zipfileset dir="src" includes="**/jmapviewer/**" prefix="jmapviewer-${svnReleaseVersion}/src"/>
75 </zip>
76 </target>
77
78 <target name="checkstyle">
79 <taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties"
80 classpath="tools/checkstyle/checkstyle-6.8.1-all.jar"/>
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
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
122</project>
Note: See TracBrowser for help on using the repository browser.