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