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" />
|
---|
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">
|
---|
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 | </project>
|
---|