1 | <project name="osmarender" default="install" basedir=".">
|
---|
2 |
|
---|
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 |
|
---|
11 | <!-- compilation properties -->
|
---|
12 | <property name="josm.build.dir" value="../../core"/>
|
---|
13 | <property name="josm.plugins.dir" value="${josm.home.dir}/plugins"/>
|
---|
14 | <property name="josm" 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"/>
|
---|
19 |
|
---|
20 | <property name="josm" location="../../core/dist/josm-custom.jar" />
|
---|
21 | <property name="rendering" location="./osmarender" />
|
---|
22 |
|
---|
23 | <property name="ant.build.javac.target" value="1.5"/>
|
---|
24 |
|
---|
25 | <target name="compile">
|
---|
26 | <echo message="creating ${plugin.jar}"/>
|
---|
27 | <mkdir dir="${plugin.build.dir}"></mkdir>
|
---|
28 | <mkdir dir="${plugin.dist.dir}"></mkdir>
|
---|
29 | <javac srcdir="src" debug="true" classpath="${josm}" destdir="${plugin.build.dir}">
|
---|
30 | <include name="**/*.java" />
|
---|
31 | </javac>
|
---|
32 | </target>
|
---|
33 |
|
---|
34 | <target name="dist" depends="compile">
|
---|
35 | <copy todir="${plugin.build.dir}" file="${rendering}/osmarender.xsl"/>
|
---|
36 | <copy tofile="${plugin.build.dir}/osm-map-features.xml"
|
---|
37 | file="${rendering}/osm-map-features-z17.xml"/>
|
---|
38 | <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
|
---|
39 | <env key="LANG" value="C"/>
|
---|
40 | <arg value="info"/>
|
---|
41 | <arg value="--xml"/>
|
---|
42 | <arg value="."/>
|
---|
43 | </exec>
|
---|
44 | <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
|
---|
45 | <delete file="REVISION"/>
|
---|
46 | <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
|
---|
47 | <manifest>
|
---|
48 | <attribute name="Plugin-Class" value="OsmarenderPlugin" />
|
---|
49 | <attribute name="Plugin-Description" value="Launches FireFox to display the current visible screen as a nice SVG image" />
|
---|
50 | <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
|
---|
51 | <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
|
---|
52 | </manifest>
|
---|
53 | </jar>
|
---|
54 | </target>
|
---|
55 |
|
---|
56 | <target name="clean">
|
---|
57 | <delete dir="${plugin.build.dir}" />
|
---|
58 | <delete file="${plugin.jar}" />
|
---|
59 | </target>
|
---|
60 |
|
---|
61 | <target name="install" depends="compile,dist">
|
---|
62 | <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
|
---|
63 | </target>
|
---|
64 |
|
---|
65 | </project>
|
---|