1 | <project name="navigator" default="dist" basedir=".">
|
---|
2 |
|
---|
3 | <!-- compilation properties -->
|
---|
4 | <property name="josm.build.dir" value="../JOSM"/>
|
---|
5 | <property name="josm.home.dir" value="${user.home}/.josm"/>
|
---|
6 | <property name="plugin.build.dir" value="bin"/>
|
---|
7 | <property name="plugin.name" value="${ant.project.name}"/>
|
---|
8 | <property name="plugin.jar" value="${plugin.name}.jar"/>
|
---|
9 |
|
---|
10 | <!-- plugin meta data (enter new version number if anything changed!) -->
|
---|
11 | <property name="plugin.version" value="0.1"/>
|
---|
12 | <property name="plugin.description" value="Provides routing functionality (V${plugin.version})."/>
|
---|
13 | <property name="plugin.stage" value="50"/>
|
---|
14 | <property name="plugin.class" value="at.dallermassl.josm.plugin.navigator.NavigatorPlugin"/>
|
---|
15 |
|
---|
16 | <!-- update site meta data -->
|
---|
17 | <property name="plugin.site.file" value="josm-site.xml"/>
|
---|
18 | <property name="plugin.site.description" value="Josm's Surveyor Update Site"/>
|
---|
19 | <property name="plugin.site.url" value="http://www.tegmento.org/~cdaller/josm/${ant.project.name}/"/>
|
---|
20 | <property name="plugin.site.upload.target" value="cdaller@www.tegmento.org:public_html/josm/${ant.project.name}/"/>
|
---|
21 |
|
---|
22 |
|
---|
23 | <target name="dist" depends="compile,site">
|
---|
24 | <!-- images
|
---|
25 | <copy todir="${plugin.build.dir}/images">
|
---|
26 | <fileset dir="src/images" />
|
---|
27 | </copy>
|
---|
28 | -->
|
---|
29 | <!-- copy configuration xml files
|
---|
30 | <copy todir="${plugin.build.dir}">
|
---|
31 | <fileset dir="src">
|
---|
32 | <include name="*.xml"/>
|
---|
33 | </fileset>
|
---|
34 | </copy>
|
---|
35 | -->
|
---|
36 |
|
---|
37 | <!-- create jar file -->
|
---|
38 | <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
|
---|
39 | <manifest>
|
---|
40 | <attribute name="Plugin-Class" value="${plugin.class}" />
|
---|
41 | <attribute name="Plugin-Description" value="${plugin.description}" />
|
---|
42 | <attribute name="Plugin-Version" value="${plugin.version}" />
|
---|
43 | <!--attribute name="Plugin-Dependencies" value="org.eigenheimstrasse.josm" /-->
|
---|
44 | <attribute name="Plugin-Stage" value="${plugin.stage}" />
|
---|
45 | <attribute name="Class-Path" value="navigator/lib/jgrapht-jdk1.5.jar" />
|
---|
46 | </manifest>
|
---|
47 | </jar>
|
---|
48 | </target>
|
---|
49 |
|
---|
50 | <target name="compile" depends="init">
|
---|
51 | <mkdir dir="${plugin.build.dir}"/>
|
---|
52 | <javac srcdir="src" destdir="${plugin.build.dir}" debug="true" source="1.5" target="1.5">
|
---|
53 | <classpath>
|
---|
54 | <pathelement path="${josm.build.dir}/build"/>
|
---|
55 | <fileset dir="${josm.build.dir}/lib">
|
---|
56 | <include name="**/*.jar"/>
|
---|
57 | </fileset>
|
---|
58 | <fileset dir="lib">
|
---|
59 | <include name="**/*.jar"/>
|
---|
60 | </fileset>
|
---|
61 | </classpath>
|
---|
62 | </javac>
|
---|
63 | </target>
|
---|
64 |
|
---|
65 | <target name="install" depends="dist">
|
---|
66 | <copy file="${plugin.jar}" todir="${josm.home.dir}/plugins" />
|
---|
67 | <mkdir dir="${josm.home.dir}/plugins/${ant.project.name}/lib"/>
|
---|
68 | <copy todir="${josm.home.dir}/plugins/${ant.project.name}/lib">
|
---|
69 | <fileset dir="lib">
|
---|
70 | <include name="**/*.jar"/>
|
---|
71 | </fileset>
|
---|
72 | </copy>
|
---|
73 | </target>
|
---|
74 |
|
---|
75 | <target name="init">
|
---|
76 | <echo>java version: ${java.version}</echo>
|
---|
77 | </target>
|
---|
78 |
|
---|
79 | <target name="clean">
|
---|
80 | <delete dir="${plugin.build.dir}" />
|
---|
81 | <delete dir="${plugin.site.file}" />
|
---|
82 | <delete dir="${plugin.jar}" />
|
---|
83 | </target>
|
---|
84 |
|
---|
85 | <!-- write site description for the given plugin so josm will accept it -->
|
---|
86 | <target name="site">
|
---|
87 | <echo message="creating site description in ${plugin.site.file}"/>
|
---|
88 | <echo file="${plugin.site.file}"><!-- plugins available on this site -->
|
---|
89 | <plugins>
|
---|
90 | <plugin id="${ant.project.name}" version="${plugin.version}">
|
---|
91 | <name>${ant.project.name}</name>
|
---|
92 | <description>${plugin.description}</description>
|
---|
93 | <resource>${plugin.site.url}${plugin.jar}</resource>
|
---|
94 | </plugin>
|
---|
95 | </plugins>
|
---|
96 | </echo>
|
---|
97 | </target>
|
---|
98 |
|
---|
99 | <!-- write site description for the given plugin (not implemented in JOSM as full version yet!) -->
|
---|
100 | <target name="site-full-donotuse">
|
---|
101 | <echo message="creating site description in ${plugin.site.file}"/>
|
---|
102 | <echo file="${plugin.site.file}"><?xml version="1.0"?>
|
---|
103 | <site version="1.0">
|
---|
104 | <!-- meta data of site -->
|
---|
105 | <site-info>
|
---|
106 | <site-name>${plugin.site.description}</site-name>
|
---|
107 | <site-url>${plugin.site.url}</site-url>
|
---|
108 | </site-info>
|
---|
109 |
|
---|
110 | <!-- plugins available on this site -->
|
---|
111 | <plugins>
|
---|
112 | <plugin id="${ant.project.name}" version="${plugin.version}">
|
---|
113 | <name>${ant.project.name}</name>
|
---|
114 | <description>${plugin.description}</description>
|
---|
115 | <resources>
|
---|
116 | <resource src="${plugin.site.url}${plugin.jar}"
|
---|
117 | target="${josm.home.dir}/plugins/${plugin.jar}"/>
|
---|
118 | </resources>
|
---|
119 | </plugin>
|
---|
120 | </plugins>
|
---|
121 | </site>
|
---|
122 | </echo>
|
---|
123 | </target>
|
---|
124 |
|
---|
125 |
|
---|
126 | <!-- upload the site description and the jar file via ssh -->
|
---|
127 | <target name="upload" depends="dist,site">
|
---|
128 | <echo message="uploading jar and site description to ${plugin.site.upload.target}"/>
|
---|
129 | <exec executable="scp">
|
---|
130 | <arg value="${plugin.jar}"/>
|
---|
131 | <arg value="${plugin.site.file}"/>
|
---|
132 | <arg value="${plugin.site.upload.target}"/>
|
---|
133 | </exec>
|
---|
134 | </target>
|
---|
135 |
|
---|
136 | </project>
|
---|