1 | <project name="josm" default="dist" basedir=".">
|
---|
2 | <property name="test.dir" value="test" />
|
---|
3 | <property name="src.dir" value="src" />
|
---|
4 | <property name="build.dir" value="build"/>
|
---|
5 |
|
---|
6 | <!-- Java classpath addition (all jar files to compile tests with this) -->
|
---|
7 | <path id="classpath">
|
---|
8 | <fileset dir="lib">
|
---|
9 | <include name="**/*.jar"/>
|
---|
10 | </fileset>
|
---|
11 | </path>
|
---|
12 |
|
---|
13 | <target name="dist" depends="compile">
|
---|
14 |
|
---|
15 | <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
|
---|
16 | <env key="LANG" value="C"/>
|
---|
17 | <arg value="info"/>
|
---|
18 | <arg value="--xml"/>
|
---|
19 | <arg value="."/>
|
---|
20 | </exec>
|
---|
21 | <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
|
---|
22 | <delete file="REVISION"/>
|
---|
23 | <property name="version.entry.commit.revision" value="UNKNOWN"/>
|
---|
24 | <property name="version.entry.commit.date" value="UNKNOWN"/>
|
---|
25 |
|
---|
26 | <copy file="CONTRIBUTION" todir="build"/>
|
---|
27 | <copy file="README" todir="build"/>
|
---|
28 | <copy file="LICENSE" todir="build"/>
|
---|
29 |
|
---|
30 | <!-- styles -->
|
---|
31 | <copy file="styles/standard/elemstyles.xml" todir="build/styles/standard"/>
|
---|
32 |
|
---|
33 | <!-- create josm-custom.jar -->
|
---|
34 | <delete file="dist/josm-custom.jar"/>
|
---|
35 | <jar destfile="dist/josm-custom.jar" basedir="build">
|
---|
36 | <manifest>
|
---|
37 | <attribute name="Main-class" value="JOSM" />
|
---|
38 | <attribute name="Main-Version" value="${version.entry.commit.revision} SVN"/>
|
---|
39 | <attribute name="Main-Date" value="${version.entry.commit.date}"/>
|
---|
40 | </manifest>
|
---|
41 | <zipfileset dir="presets" prefix="presets" />
|
---|
42 | <zipfileset dir="images" prefix="images" />
|
---|
43 | <zipfileset src="lib/josm-translation.jar" />
|
---|
44 |
|
---|
45 | <!-- All jar files necessary to run only JOSM (no tests) -->
|
---|
46 | <zipfileset src="lib/gettext-commons-0.9.6.jar" />
|
---|
47 | <zipfileset src="lib/metadata-extractor-2.3.1-nosun.jar" />
|
---|
48 | </jar>
|
---|
49 | </target>
|
---|
50 |
|
---|
51 | <target name="distmac" depends="dist">
|
---|
52 | <!-- modify MacOS X Info.plist file to hold the SVN version number -->
|
---|
53 | <copy file="macosx/JOSM.app/Contents/Info.plist" todir="build"/>
|
---|
54 | <replace file="build/Info.plist" token="@SVNVersion@" value="${version.entry.commit.revision}"/>
|
---|
55 | <!-- create ZIP file with MacOS X application bundle -->
|
---|
56 | <zip destfile="dist/josm-custom-macosx.zip" update="true">
|
---|
57 | <zipfileset dir="build" includes="CONTRIBUTION README LICENSE"/>
|
---|
58 | <zipfileset dir="macosx" includes="JOSM.app/Contents JOSM.app/Contents/MacOS JOSM.app/Contents/Resources JOSM.app/Contents/Resources/Java JOSM.app/Contents/PkgInfo JOSM.app/Contents/Resources/JOSM.icns"/>
|
---|
59 | <zipfileset dir="build" includes="Info.plist" prefix="JOSM.app/Contents"/>
|
---|
60 | <zipfileset dir="dist" includes="josm-custom.jar" prefix="JOSM.app/Contents/Resources/Java"/>
|
---|
61 | <zipfileset dir="macosx" includes="JOSM.app/Contents/MacOS/JOSM" filemode="755"/>
|
---|
62 | </zip>
|
---|
63 | </target>
|
---|
64 |
|
---|
65 | <target name="compile" depends="init">
|
---|
66 | <javac srcdir="src" classpathref="classpath" destdir="build"
|
---|
67 | target="1.5" source="1.5" debug="on" encoding="UTF-8">
|
---|
68 | <compilerarg value="-Xlint:deprecation"/>
|
---|
69 | <compilerarg value="-Xlint:unchecked"/>
|
---|
70 | </javac>
|
---|
71 | </target>
|
---|
72 |
|
---|
73 | <target name="init">
|
---|
74 | <mkdir dir="build" />
|
---|
75 | <mkdir dir="dist" />
|
---|
76 | </target>
|
---|
77 |
|
---|
78 | <target name="clean">
|
---|
79 | <delete dir="build" />
|
---|
80 | <delete dir="dist" />
|
---|
81 | </target>
|
---|
82 |
|
---|
83 | <path id="test.classpath">
|
---|
84 | <fileset dir="${test.dir}/lib">
|
---|
85 | <include name="**/*.jar"/>
|
---|
86 | </fileset>
|
---|
87 | <fileset dir="lib">
|
---|
88 | <include name="**/*.jar"/>
|
---|
89 | </fileset>
|
---|
90 | </path>
|
---|
91 |
|
---|
92 | <target name="test-init">
|
---|
93 | <mkdir dir="${test.dir}/${build.dir}" />
|
---|
94 | <mkdir dir="${test.dir}/report" />
|
---|
95 | </target>
|
---|
96 |
|
---|
97 | <target name="test-clean">
|
---|
98 | <delete dir="${test.dir}/${build.dir}"/>
|
---|
99 | <delete dir="${test.dir}/report"/>
|
---|
100 | </target>
|
---|
101 |
|
---|
102 | <target name="test-compile" depends="test-init">
|
---|
103 | <javac srcdir="${src.dir}:${test.dir}/unit" classpathref="test.classpath" destdir="${test.dir}/${build.dir}"
|
---|
104 | target="1.5" source="1.5" debug="on" encoding="UTF-8">
|
---|
105 | <compilerarg value="-Xlint:deprecation"/>
|
---|
106 | <compilerarg value="-Xlint:unchecked"/>
|
---|
107 | </javac>
|
---|
108 | </target>
|
---|
109 |
|
---|
110 | <target name="test" depends="test-compile">
|
---|
111 | <junit printsummary="yes">
|
---|
112 | <sysproperty key="josm.home" value="${test.dir}/config/unit-josm.home"/>
|
---|
113 | <classpath>
|
---|
114 | <path refid="test.classpath"/>
|
---|
115 | <pathelement path="${test.dir}/${build.dir}"/>
|
---|
116 | <pathelement path="${test.dir}/config"/>
|
---|
117 | </classpath>
|
---|
118 | <formatter type="plain"/>
|
---|
119 | <batchtest fork="no" todir="${test.dir}/report">
|
---|
120 | <fileset dir="${test.dir}/unit" includes="**/*.java"/>
|
---|
121 | </batchtest>
|
---|
122 | </junit>
|
---|
123 | </target>
|
---|
124 |
|
---|
125 | </project>
|
---|