[5153] | 1 | <project name="mappaint" default="dist" basedir=".">
|
---|
[1436] | 2 |
|
---|
[5207] | 3 | <!-- josm "user home" directory depends on the platform used (windows has a different place than unix/linux) -->
|
---|
| 4 | <property environment="env"/>
|
---|
| 5 | <condition property="josm.home.dir" value="${env.APPDATA}/JOSM" else="${user.home}/.josm">
|
---|
| 6 | <and>
|
---|
| 7 | <os family="windows"/>
|
---|
| 8 | </and>
|
---|
| 9 | </condition>
|
---|
| 10 |
|
---|
[5153] | 11 | <!-- compilation properties -->
|
---|
[5207] | 12 | <property name="josm.build.dir" value="../../core"/>
|
---|
| 13 | <property name="josm.plugins.dir" value="${josm.home.dir}/plugins"/>
|
---|
| 14 | <property name="josm.jar" location="../../core/dist/josm-custom.jar" />
|
---|
| 15 | <property name="plugin.build.dir" value="build"/>
|
---|
| 16 | <property name="plugin.dist.dir" value="../dist"/>
|
---|
| 17 | <property name="plugin.name" value="${ant.project.name}"/>
|
---|
| 18 | <property name="plugin.jar" value="../dist/${plugin.name}.jar"/>
|
---|
[1436] | 19 |
|
---|
[5207] | 20 |
|
---|
[5147] | 21 | <!-- you should not need to modify anything below this! -->
|
---|
[1436] | 22 |
|
---|
[5207] | 23 | <target name="compile">
|
---|
| 24 | <mkdir dir="${plugin.build.dir}"></mkdir>
|
---|
| 25 | <javac srcdir="src" classpath="${josm.jar}" destdir="${plugin.build.dir}" debug="true" source="1.5" target="1.5">
|
---|
[5147] | 26 | <include name="**/*.java" />
|
---|
[5207] | 27 | <!--compilerarg value="-Xlint:deprecation"/-->
|
---|
[5147] | 28 | </javac>
|
---|
| 29 | </target>
|
---|
[1436] | 30 |
|
---|
[5153] | 31 | <target name="dist" depends="compile">
|
---|
[5207] | 32 | <!-- copy the "standard" mappaint style -->
|
---|
| 33 | <copy todir="${plugin.build.dir}/standard">
|
---|
[5147] | 34 | <fileset dir="styles/standard"></fileset>
|
---|
| 35 | </copy>
|
---|
[5207] | 36 | <!-- define the version of the jar file -->
|
---|
[5147] | 37 | <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
|
---|
| 38 | <env key="LANG" value="C"/>
|
---|
| 39 | <arg value="info"/>
|
---|
| 40 | <arg value="--xml"/>
|
---|
| 41 | <arg value="."/>
|
---|
| 42 | </exec>
|
---|
| 43 | <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
|
---|
[5207] | 44 | <!-- delete intermediate file -->
|
---|
[5147] | 45 | <delete file="REVISION"/>
|
---|
[5207] | 46 | <!-- create jar file with manifest -->
|
---|
| 47 | <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
|
---|
[5147] | 48 | <manifest>
|
---|
[5207] | 49 | <attribute name="Plugin-Class" value="mappaint.MapPaintPlugin" />
|
---|
| 50 | <attribute name="Plugin-Description" value="An alternative render for the map with colouring, line thickness and icons.<br>" />
|
---|
| 51 | <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
|
---|
| 52 | <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
|
---|
| 53 | <attribute name="Author" value="Nick Whitelegg / Ulf Lamping"/>
|
---|
[5147] | 54 | </manifest>
|
---|
| 55 | </jar>
|
---|
| 56 | </target>
|
---|
[1436] | 57 |
|
---|
[5147] | 58 | <target name="clean">
|
---|
[5153] | 59 | <delete dir="${plugin.build.dir}" />
|
---|
| 60 | <delete file="${plugin.jar}" />
|
---|
[5147] | 61 | </target>
|
---|
[1436] | 62 |
|
---|
[5147] | 63 | <target name="clean_install">
|
---|
[5207] | 64 | <delete file="${josm.plugins.dir}/${plugin.name}.jar" />
|
---|
[5147] | 65 | </target>
|
---|
[3780] | 66 |
|
---|
[5153] | 67 | <target name="install" depends="dist">
|
---|
[5207] | 68 | <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
|
---|
[5147] | 69 | </target>
|
---|
[1436] | 70 |
|
---|
| 71 | </project>
|
---|