source: subversion/applications/viewer/jmapviewer/build.xml @ 29944

Last change on this file since 29944 was 29618, checked in by the111, 7 years ago

Fix #josm8640 and #josm8747 - JMapViewer versioned releases and enhanced release system.

File size: 3.0 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" />
5
6        <target name="clean">
7                <delete>
8                        <fileset dir="bin">
9                                <include name="**" />
10                        </fileset>
11                </delete>
12        </target>
13
14        <target name="build">
15                <javac srcdir="src" destdir="bin" source="1.6" target="1.6" debug="true" includeantruntime="false">
16                        <include name="org/openstreetmap/gui/jmapviewer/**" />
17                </javac>
18
19                <copy todir="bin">
20                        <fileset dir="src">
21                                <include name="**/*.png" />
22                        </fileset>
23                </copy>
24        </target>
25       
26    <target name="svn_info" description="Get SVN info for use in JAR/ZIP filenames.">
27        <!-- Create temporary SVN info file -->
28        <exec executable="svn" output="svn-info.properties">
29            <arg line="info" />
30            <env key="LANG" value="en_US"/>
31        </exec>
32        <property prefix="svn" file="svn-info.properties" />
33        <!-- Delete temporary SVN info file -->
34        <delete file="svn-info.properties" />
35    </target>
36       
37        <target name="pack">
38                <!-- Create the JAR file containing the compiled class files -->
39                <jar destfile="JMapViewer_${svn.Revision}.jar" filesetmanifest="mergewithoutmain">
40                        <fileset dir="bin" includes="**/jmapviewer/**" />
41                </jar>
42                <!-- Create the JAR file containing the source java files -->
43                <jar destfile="JMapViewer_${svn.Revision}_src.jar" filesetmanifest="mergewithoutmain">
44                        <fileset dir="src" includes="**/jmapviewer/**" />
45                </jar>
46        </target>
47       
48        <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.">
49                <jar destfile="JMapViewer_${svn.Revision}_Demo.jar" filesetmanifest="mergewithoutmain">
50                        <manifest>
51                                <attribute name="Main-Class" value="org.openstreetmap.gui.jmapviewer.Demo" />
52                                <attribute name="Class-Path" value="JMapViewer_${svn.Revision}.jar" />
53                        </manifest>
54                </jar>
55        </target>
56
57        <target name="create_release_zip" description="Create a release zip file containing the binary and source jar files as well as the demo starter">
58                <zip basedir="." destfile="releases/${svn.Revision}/JMapViewer-${svn.Revision}.zip">
59                        <include name="JMapViewer*.jar" />
60                        <include name="Readme.txt" />
61                        <include name="Gpl.txt" />
62                </zip>
63                <delete>
64                        <fileset dir="." includes="JMapViewer*.jar"/>
65                </delete> 
66        </target>
67       
68        <target name="create_source_release_zip" description="Create a release zip file containing the source files">
69                <zip destfile="releases/${svn.Revision}/JMapViewer-${svn.Revision}-Source.zip">
70                        <zipfileset file="Readme.txt" prefix="jmapviewer-${svn.Revision}"/>
71                        <zipfileset file="build.xml" prefix="jmapviewer-${svn.Revision}"/>
72                        <zipfileset file="Gpl.txt" prefix="jmapviewer-${svn.Revision}"/>
73                        <zipfileset dir="src" includes="**/jmapviewer/**" prefix="jmapviewer-${svn.Revision}"/>
74                </zip>
75        </target>
76
77</project>
Note: See TracBrowser for help on using the repository browser.