[154] | 1 | <project name="josm" default="dist" basedir=".">
|
---|
[109] | 2 |
|
---|
[151] | 3 | <!-- All jar files necessary to run only JOSM (no tests) -->
|
---|
| 4 | <fileset id="josm_required_libs" dir="lib">
|
---|
[1584] | 5 | <include name="gettext-commons-0.9.6.jar"/>
|
---|
[392] | 6 | <include name="metadata-extractor-2.3.1-nosun.jar"/>
|
---|
[151] | 7 | </fileset>
|
---|
| 8 |
|
---|
| 9 | <!-- Java classpath addition (all jar files to compile tests with this) -->
|
---|
[111] | 10 | <path id="classpath">
|
---|
[151] | 11 | <fileset dir="lib">
|
---|
[111] | 12 | <include name="**/*.jar"/>
|
---|
| 13 | </fileset>
|
---|
| 14 | </path>
|
---|
[109] | 15 |
|
---|
[135] | 16 | <target name="dist" depends="compile">
|
---|
[111] | 17 | <!-- jars -->
|
---|
[151] | 18 | <unjar dest="build">
|
---|
| 19 | <fileset refid="josm_required_libs" />
|
---|
| 20 | </unjar>
|
---|
[109] | 21 |
|
---|
[1079] | 22 | <!-- translation -->
|
---|
| 23 | <unjar dest="build">
|
---|
| 24 | <fileset dir="lib">
|
---|
| 25 | <include name="josm-translation.jar" />
|
---|
| 26 | </fileset>
|
---|
| 27 | </unjar>
|
---|
| 28 |
|
---|
| 29 | <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
|
---|
| 30 | <env key="LANG" value="C"/>
|
---|
| 31 | <arg value="info"/>
|
---|
| 32 | <arg value="--xml"/>
|
---|
| 33 | <arg value="."/>
|
---|
| 34 | </exec>
|
---|
| 35 | <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
|
---|
| 36 | <delete file="REVISION"/>
|
---|
[1141] | 37 | <property name="version.entry.commit.revision" value="UNKNOWN"/>
|
---|
| 38 | <property name="version.entry.commit.date" value="UNKNOWN"/>
|
---|
[1079] | 39 |
|
---|
[111] | 40 | <!-- images -->
|
---|
[151] | 41 | <copy todir="build/images">
|
---|
[111] | 42 | <fileset dir="images" />
|
---|
| 43 | </copy>
|
---|
[154] | 44 |
|
---|
[397] | 45 | <!-- presets -->
|
---|
| 46 | <copy todir="build/presets">
|
---|
| 47 | <fileset dir="presets" />
|
---|
| 48 | </copy>
|
---|
| 49 |
|
---|
[1079] | 50 | <copy file="CONTRIBUTION" todir="build"/>
|
---|
| 51 | <copy file="README" todir="build"/>
|
---|
| 52 | <copy file="LICENSE" todir="build"/>
|
---|
| 53 |
|
---|
| 54 | <!-- styles -->
|
---|
[790] | 55 | <copy file="styles/standard/elemstyles.xml" todir="build/styles/standard"/>
|
---|
| 56 |
|
---|
[151] | 57 | <!-- create josm-custom.jar -->
|
---|
[407] | 58 | <delete file="dist/josm-custom.jar"/>
|
---|
[151] | 59 | <jar destfile="dist/josm-custom.jar" basedir="build">
|
---|
[111] | 60 | <manifest>
|
---|
[1023] | 61 | <attribute name="Main-class" value="JOSM" />
|
---|
[1079] | 62 | <attribute name="Main-Version" value="${version.entry.commit.revision} SVN"/>
|
---|
| 63 | <attribute name="Main-Date" value="${version.entry.commit.date}"/>
|
---|
[111] | 64 | </manifest>
|
---|
| 65 | </jar>
|
---|
| 66 | </target>
|
---|
[109] | 67 |
|
---|
[1492] | 68 | <target name="distmac" depends="dist">
|
---|
| 69 | <!-- modify MacOS X Info.plist file to hold the SVN version number -->
|
---|
| 70 | <copy file="macosx/JOSM.app/Contents/Info.plist" todir="build"/>
|
---|
| 71 | <replace file="build/Info.plist" token="@SVNVersion@" value="${version.entry.commit.revision}"/>
|
---|
| 72 | <!-- create ZIP file with MacOS X application bundle -->
|
---|
| 73 | <zip destfile="dist/josm-custom-macosx.zip" update="true">
|
---|
| 74 | <zipfileset dir="build" includes="CONTRIBUTION README LICENSE"/>
|
---|
| 75 | <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"/>
|
---|
| 76 | <zipfileset dir="build" includes="Info.plist" prefix="JOSM.app/Contents"/>
|
---|
| 77 | <zipfileset dir="dist" includes="josm-custom.jar" prefix="JOSM.app/Contents/Resources/Java"/>
|
---|
| 78 | <zipfileset dir="macosx" includes="JOSM.app/Contents/MacOS/JOSM" filemode="755"/>
|
---|
| 79 | </zip>
|
---|
| 80 | </target>
|
---|
| 81 |
|
---|
[151] | 82 | <target name="compile" depends="init">
|
---|
[639] | 83 | <javac srcdir="src" classpathref="classpath" destdir="build"
|
---|
[793] | 84 | target="1.5" source="1.5" debug="on" encoding="UTF-8">
|
---|
[529] | 85 | <compilerarg value="-Xlint:deprecation"/>
|
---|
| 86 | </javac>
|
---|
[151] | 87 | </target>
|
---|
| 88 |
|
---|
| 89 | <target name="init">
|
---|
| 90 | <mkdir dir="build" />
|
---|
| 91 | <mkdir dir="dist" />
|
---|
| 92 | </target>
|
---|
| 93 |
|
---|
| 94 | <target name="clean">
|
---|
| 95 | <delete dir="build" />
|
---|
| 96 | <delete dir="dist" />
|
---|
| 97 | </target>
|
---|
| 98 |
|
---|
[109] | 99 | </project>
|
---|