1 | <project name="tcx-support" default="dist" 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="livegpsplugin.jar" value="../../dist/livegps.jar"/>
|
---|
21 |
|
---|
22 | <!-- plugin meta data (enter new version number if anything changed!) -->
|
---|
23 | <property name="plugin.version" value="1.1"/>
|
---|
24 | <property name="plugin.description" value="Adds support for TCX files."/>
|
---|
25 | <property name="plugin.stage" value="100"/>
|
---|
26 | <property name="plugin.class" value="org.openstreetmap.josm.plugins.TcxPlugin"/>
|
---|
27 |
|
---|
28 | <!-- update site meta data -->
|
---|
29 | <property name="plugin.site.file" value="josm-site.xml"/>
|
---|
30 | <property name="plugin.site.description" value=""/>
|
---|
31 | <property name="plugin.site.url" value=""/>
|
---|
32 | <property name="plugin.site.upload.target" value=""/>
|
---|
33 |
|
---|
34 | <property name="ant.build.javac.target" value="1.5"/>
|
---|
35 |
|
---|
36 | <!-- All jar files necessary to run only JOSM (no tests) -->
|
---|
37 | <fileset id="josm_required_libs" dir="lib">
|
---|
38 | </fileset>
|
---|
39 |
|
---|
40 |
|
---|
41 | <target name="dist" depends="compile,site">
|
---|
42 | <!-- jars -->
|
---|
43 | <unjar dest="build">
|
---|
44 | <fileset refid="josm_required_libs" />
|
---|
45 | </unjar>
|
---|
46 | <!-- images -->
|
---|
47 | <copy todir="build/images">
|
---|
48 | <fileset dir="images" />
|
---|
49 | </copy>
|
---|
50 |
|
---|
51 |
|
---|
52 |
|
---|
53 | <!-- create jar file -->
|
---|
54 | <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
|
---|
55 | <manifest>
|
---|
56 | <attribute name="Plugin-Class" value="${plugin.class}" />
|
---|
57 | <attribute name="Plugin-Description" value="${plugin.description}" />
|
---|
58 | <attribute name="Plugin-Version" value="${plugin.version}" />
|
---|
59 | <attribute name="Plugin-Stage" value="${plugin.stage}" />
|
---|
60 | <!-- <attribute name="Class-Path" value="lib/jaxb-api.jar;lib/jaxb-impl.jar" />-->
|
---|
61 | </manifest>
|
---|
62 | </jar>
|
---|
63 | </target>
|
---|
64 |
|
---|
65 | <target name="compile" depends="init">
|
---|
66 | <echo message="creating ${plugin.jar}"/>
|
---|
67 | <mkdir dir="${plugin.build.dir}"/>
|
---|
68 | <javac srcdir="src" destdir="${plugin.build.dir}" debug="true" source="1.5" target="1.5">
|
---|
69 | <classpath>
|
---|
70 | <pathelement path="${josm.build.dir}/build"/>
|
---|
71 | <fileset dir="${josm.build.dir}/lib">
|
---|
72 | <include name="**/*.jar"/>
|
---|
73 | </fileset>
|
---|
74 | <fileset dir="./lib">
|
---|
75 | <include name="**/*.jar"/>
|
---|
76 | </fileset>
|
---|
77 | </classpath>
|
---|
78 | </javac>
|
---|
79 | </target>
|
---|
80 |
|
---|
81 | <target name="install" depends="dist">
|
---|
82 | <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
|
---|
83 | </target>
|
---|
84 |
|
---|
85 | <target name="init">
|
---|
86 | <echo>java version: ${java.version}</echo>
|
---|
87 | </target>
|
---|
88 |
|
---|
89 | <target name="clean">
|
---|
90 | <delete dir="${plugin.build.dir}" />
|
---|
91 | <delete dir="${plugin.site.file}" />
|
---|
92 | <delete file="${plugin.jar}" />
|
---|
93 | </target>
|
---|
94 |
|
---|
95 | <!-- write site description for the given plugin so josm will accept it -->
|
---|
96 | <target name="site">
|
---|
97 | <echo message="creating site description in ${plugin.site.file}"/>
|
---|
98 | <echo file="${plugin.site.file}"><!-- plugins available on this site -->
|
---|
99 | <plugins>
|
---|
100 | <plugin id="${ant.project.name}" version="${plugin.version}">
|
---|
101 | <name>${ant.project.name}</name>
|
---|
102 | <description>${plugin.description}</description>
|
---|
103 | <resource>${plugin.site.url}${plugin.jar}</resource>
|
---|
104 | </plugin>
|
---|
105 | </plugins>
|
---|
106 | </echo>
|
---|
107 | </target>
|
---|
108 |
|
---|
109 | <!-- write site description for the given plugin (not implemented in JOSM as full version yet!) -->
|
---|
110 | <target name="site-full-donotuse">
|
---|
111 | <echo message="creating site description in ${plugin.site.file}"/>
|
---|
112 | <echo file="${plugin.site.file}"><?xml version="1.0"?>
|
---|
113 | <site version="1.0">
|
---|
114 | <!-- meta data of site -->
|
---|
115 | <site-info>
|
---|
116 | <site-name>${plugin.site.description}</site-name>
|
---|
117 | <site-url>${plugin.site.url}</site-url>
|
---|
118 | </site-info>
|
---|
119 |
|
---|
120 | <!-- plugins available on this site -->
|
---|
121 | <plugins>
|
---|
122 | <plugin id="${ant.project.name}" version="${plugin.version}">
|
---|
123 | <name>${ant.project.name}</name>
|
---|
124 | <description>${plugin.description}</description>
|
---|
125 | <resources>
|
---|
126 | <resource src="${plugin.site.url}${plugin.jar}"
|
---|
127 | target="${josm.home.dir}/plugins/${plugin.jar}"/>
|
---|
128 | </resources>
|
---|
129 | </plugin>
|
---|
130 | </plugins>
|
---|
131 | </site>
|
---|
132 | </echo>
|
---|
133 | </target>
|
---|
134 |
|
---|
135 |
|
---|
136 | <!-- upload the site description and the jar file via ssh -->
|
---|
137 | <target name="upload" depends="dist,site">
|
---|
138 | <echo message="uploading jar and site description to ${plugin.site.upload.target}"/>
|
---|
139 | <exec executable="scp">
|
---|
140 | <arg value="${plugin.jar}"/>
|
---|
141 | <arg value="${plugin.site.file}"/>
|
---|
142 | <arg value="${plugin.site.upload.target}"/>
|
---|
143 | </exec>
|
---|
144 | </target>
|
---|
145 |
|
---|
146 | </project>
|
---|