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