source: subversion/applications/editors/josm/plugins/livegps/build.xml @ 6160

Last change on this file since 6160 was 6100, checked in by joerg, 12 years ago

josm: move plugins/dist directory one level up

File size: 4.9 KB
Line 
1<project name="livegps" 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="plugin.jar" value="../../dist/${plugin.name}.jar"/>
21  <property name="livegpsplugin.jar" value="${josm.home.dir}/plugins/livegps.jar"/>
22 
23  <!-- plugin meta data (enter new version number if anything changed!) -->
24  <property name="plugin.version" value="1.2.1"/>
25  <property name="plugin.description" value="Allow live GPS feed from a gpsd server (V${plugin.version})."/>
26  <property name="plugin.stage" value="50"/>
27  <property name="plugin.class" value="livegps.LiveGpsPlugin"/>
28 
29  <!-- update site meta data -->
30  <property name="plugin.site.file" value="josm-site.xml"/>
31  <property name="plugin.site.description" value="Josm's LiveGps Update Site"/>
32  <property name="plugin.site.url" value="http://www.tegmento.org/~cdaller/josm/livegps/"/>
33  <property name="plugin.site.upload.target" value="cdaller@www.tegmento.org:public_html/josm/livegps/"/>
34 
35  <property name="ant.build.javac.target" value="1.5"/>
36
37  <target name="dist" depends="compile,site">
38    <!-- images -->
39    <copy todir="${plugin.build.dir}/images">
40      <fileset dir="images" />
41    </copy>
42   
43    <!-- create jar file -->
44    <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
45      <manifest>
46        <attribute name="Plugin-Class" value="${plugin.class}" />
47        <attribute name="Plugin-Description" value="${plugin.description}" />
48        <attribute name="Plugin-Version" value="${plugin.version}" />
49        <!--attribute name="Plugin-Dependencies" value="org.eigenheimstrasse.josm" /-->
50        <attribute name="Plugin-Stage" value="${plugin.stage}" />
51      </manifest>
52    </jar>
53  </target>
54
55  <target name="compile" depends="init">
56    <mkdir dir="${plugin.build.dir}"/>
57    <javac srcdir="livegps" destdir="${plugin.build.dir}" debug="true" source="1.5" target="1.5">
58      <classpath>
59        <pathelement path="${josm.build.dir}/build"/>
60        <fileset dir="${josm.build.dir}/lib">
61          <include name="**/*.jar"/>
62        </fileset>
63        <pathelement location="${plugin.jar}"/>
64      </classpath>
65    </javac>
66  </target>
67
68  <target name="install" depends="dist">
69    <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
70  </target>
71
72  <target name="init">
73    <echo>java version: ${java.version}</echo>
74  </target>
75
76  <target name="clean">
77    <delete dir="${plugin.build.dir}" />
78    <delete dir="${plugin.site.file}" />
79    <delete file="${plugin.jar}" />
80  </target>
81
82  <!-- write site description for the given plugin so josm will accept it -->
83  <target name="site">
84    <echo message="creating site description in ${plugin.site.file}"/>
85    <echo file="${plugin.site.file}">&lt;!-- plugins available on this site -->
86  &lt;plugins>
87  &lt;plugin id="${ant.project.name}" version="${plugin.version}">
88  &lt;name>${ant.project.name}&lt;/name>
89  &lt;description>${plugin.description}&lt;/description>
90  &lt;resource>${plugin.site.url}${plugin.jar}&lt;/resource>
91  &lt;/plugin>
92  &lt;/plugins>
93</echo>
94</target>
95
96<!-- write site description for the given plugin (not implemented in JOSM as full version yet!) -->
97<target name="site-full-donotuse">
98  <echo message="creating site description in ${plugin.site.file}"/>
99  <echo file="${plugin.site.file}">&lt;?xml version="1.0"?>
100    &lt;site version="1.0">
101    &lt;!-- meta data of site -->
102&lt;site-info>
103&lt;site-name>${plugin.site.description}&lt;/site-name>
104&lt;site-url>${plugin.site.url}&lt;/site-url>
105&lt;/site-info>
106
107&lt;!-- plugins available on this site -->
108&lt;plugins>
109&lt;plugin id="${ant.project.name}" version="${plugin.version}">
110&lt;name>${ant.project.name}&lt;/name>
111&lt;description>${plugin.description}&lt;/description>
112&lt;resources>
113&lt;resource src="${plugin.site.url}${plugin.jar}"
114target="${josm.home.dir}/plugins/${plugin.jar}"/>
115&lt;/resources>
116&lt;/plugin>
117&lt;/plugins>
118&lt;/site>
119</echo>
120</target>
121
122<!-- upload the site description and the jar file via ssh -->
123<target name="upload" depends="dist,site">
124  <echo message="uploading jar and site description to ${plugin.site.upload.target}"/>
125  <exec executable="scp">
126    <arg value="${plugin.jar}"/>
127    <arg value="${plugin.site.file}"/>
128    <arg value="${plugin.site.upload.target}"/>
129  </exec>
130</target>
131
132</project>
Note: See TracBrowser for help on using the repository browser.