[1751] | 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"/>
|
---|
[2274] | 25 | <echo>Revision ${version.entry.commit.revision}</echo>
|
---|
[1751] | 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 |
|
---|
[2274] | 33 | <!-- css-->
|
---|
| 34 | <copy file="src/org/openstreetmap/josm/gui/help/help-browser.css" todir="build/org/openstreetmap/josm/gui/help"/>
|
---|
| 35 |
|
---|
[1751] | 36 | <!-- create josm-custom.jar -->
|
---|
| 37 | <delete file="dist/josm-custom.jar"/>
|
---|
| 38 | <jar destfile="dist/josm-custom.jar" basedir="build">
|
---|
| 39 | <manifest>
|
---|
| 40 | <attribute name="Main-class" value="JOSM" />
|
---|
| 41 | <attribute name="Main-Version" value="${version.entry.commit.revision} SVN"/>
|
---|
| 42 | <attribute name="Main-Date" value="${version.entry.commit.date}"/>
|
---|
| 43 | </manifest>
|
---|
| 44 | <zipfileset dir="presets" prefix="presets" />
|
---|
| 45 | <zipfileset dir="images" prefix="images" />
|
---|
| 46 | <zipfileset src="lib/josm-translation.jar" />
|
---|
| 47 |
|
---|
| 48 | <!-- All jar files necessary to run only JOSM (no tests) -->
|
---|
| 49 | <zipfileset src="lib/gettext-commons-0.9.6.jar" />
|
---|
| 50 | <zipfileset src="lib/metadata-extractor-2.3.1-nosun.jar" />
|
---|
| 51 | </jar>
|
---|
| 52 | </target>
|
---|
| 53 |
|
---|
| 54 | <target name="distmac" depends="dist">
|
---|
| 55 | <!-- modify MacOS X Info.plist file to hold the SVN version number -->
|
---|
| 56 | <copy file="macosx/JOSM.app/Contents/Info.plist" todir="build"/>
|
---|
| 57 | <replace file="build/Info.plist" token="@SVNVersion@" value="${version.entry.commit.revision}"/>
|
---|
| 58 | <!-- create ZIP file with MacOS X application bundle -->
|
---|
| 59 | <zip destfile="dist/josm-custom-macosx.zip" update="true">
|
---|
| 60 | <zipfileset dir="build" includes="CONTRIBUTION README LICENSE"/>
|
---|
| 61 | <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"/>
|
---|
| 62 | <zipfileset dir="build" includes="Info.plist" prefix="JOSM.app/Contents"/>
|
---|
| 63 | <zipfileset dir="dist" includes="josm-custom.jar" prefix="JOSM.app/Contents/Resources/Java"/>
|
---|
| 64 | <zipfileset dir="macosx" includes="JOSM.app/Contents/MacOS/JOSM" filemode="755"/>
|
---|
| 65 | </zip>
|
---|
| 66 | </target>
|
---|
| 67 |
|
---|
| 68 | <target name="compile" depends="init">
|
---|
| 69 | <javac srcdir="src" classpathref="classpath" destdir="build"
|
---|
| 70 | target="1.5" source="1.5" debug="on" encoding="UTF-8">
|
---|
| 71 | <compilerarg value="-Xlint:deprecation"/>
|
---|
[1941] | 72 | <compilerarg value="-Xlint:unchecked"/>
|
---|
[1751] | 73 | </javac>
|
---|
| 74 | </target>
|
---|
| 75 |
|
---|
| 76 | <target name="init">
|
---|
| 77 | <mkdir dir="build" />
|
---|
| 78 | <mkdir dir="dist" />
|
---|
| 79 | </target>
|
---|
| 80 |
|
---|
| 81 | <target name="clean">
|
---|
| 82 | <delete dir="build" />
|
---|
| 83 | <delete dir="dist" />
|
---|
| 84 | </target>
|
---|
| 85 |
|
---|
| 86 | <path id="test.classpath">
|
---|
| 87 | <fileset dir="${test.dir}/lib">
|
---|
| 88 | <include name="**/*.jar"/>
|
---|
| 89 | </fileset>
|
---|
| 90 | <fileset dir="lib">
|
---|
| 91 | <include name="**/*.jar"/>
|
---|
| 92 | </fileset>
|
---|
| 93 | </path>
|
---|
| 94 |
|
---|
| 95 | <target name="test-init">
|
---|
| 96 | <mkdir dir="${test.dir}/${build.dir}" />
|
---|
| 97 | <mkdir dir="${test.dir}/report" />
|
---|
| 98 | </target>
|
---|
| 99 |
|
---|
| 100 | <target name="test-clean">
|
---|
| 101 | <delete dir="${test.dir}/${build.dir}"/>
|
---|
| 102 | <delete dir="${test.dir}/report"/>
|
---|
| 103 | </target>
|
---|
| 104 |
|
---|
| 105 | <target name="test-compile" depends="test-init">
|
---|
| 106 | <javac srcdir="${src.dir}:${test.dir}/unit" classpathref="test.classpath" destdir="${test.dir}/${build.dir}"
|
---|
| 107 | target="1.5" source="1.5" debug="on" encoding="UTF-8">
|
---|
| 108 | <compilerarg value="-Xlint:deprecation"/>
|
---|
[1941] | 109 | <compilerarg value="-Xlint:unchecked"/>
|
---|
[1751] | 110 | </javac>
|
---|
| 111 | </target>
|
---|
| 112 |
|
---|
| 113 | <target name="test" depends="test-compile">
|
---|
| 114 | <junit printsummary="yes">
|
---|
| 115 | <sysproperty key="josm.home" value="${test.dir}/config/unit-josm.home"/>
|
---|
| 116 | <classpath>
|
---|
| 117 | <path refid="test.classpath"/>
|
---|
| 118 | <pathelement path="${test.dir}/${build.dir}"/>
|
---|
| 119 | <pathelement path="${test.dir}/config"/>
|
---|
| 120 | </classpath>
|
---|
| 121 | <formatter type="plain"/>
|
---|
| 122 | <batchtest fork="no" todir="${test.dir}/report">
|
---|
| 123 | <fileset dir="${test.dir}/unit" includes="**/*.java"/>
|
---|
| 124 | </batchtest>
|
---|
| 125 | </junit>
|
---|
| 126 | </target>
|
---|
| 127 |
|
---|
| 128 | </project>
|
---|