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