source: subversion/applications/editors/josm/plugins/surveyor/build.xml @ 7287

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

josm/plugins/*/build.xml: add echo to identify which compile failes

File size: 5.0 KB
Line 
1<project name="surveyor" 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.4"/>
24  <property name="plugin.description" value="Allow adding markers/nodes on current gps positions (V${plugin.version})."/>
25  <property name="plugin.stage" value="60"/>
26  <property name="plugin.class" value="at.dallermassl.josm.plugin.surveyor.SurveyorPlugin"/>
27 
28  <!-- update site meta data -->
29  <property name="plugin.site.file" value="josm-site.xml"/>
30  <property name="plugin.site.description" value="Josm's Surveyor Update Site"/>
31  <property name="plugin.site.url" value="http://www.tegmento.org/~cdaller/josm/surveyor/"/>
32  <property name="plugin.site.upload.target" value="cdaller@www.tegmento.org:public_html/josm/surveyor/"/>
33
34  <property name="ant.build.javac.target" value="1.5"/>
35 
36 
37  <target name="dist" depends="compile,site">
38    <!-- images -->
39    <copy todir="${plugin.build.dir}/">
40      <fileset dir="resources">
41        <include name="*.xml"/>
42        <include name="audio/*"/>
43      </fileset>
44    </copy>
45   
46    <!-- create jar file -->
47    <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
48      <manifest>
49        <attribute name="Plugin-Class" value="${plugin.class}" />
50        <attribute name="Plugin-Description" value="${plugin.description}" />
51        <attribute name="Plugin-Version" value="${plugin.version}" />
52        <!--attribute name="Plugin-Dependencies" value="org.eigenheimstrasse.josm" /-->
53        <attribute name="Plugin-Stage" value="${plugin.stage}" />
54      </manifest>
55    </jar>
56  </target>
57
58  <target name="compile" depends="init">
59    <echo message="creating ${plugin.jar}"/>
60    <mkdir dir="${plugin.build.dir}"/>
61    <copy todir="build/images" >
62      <fileset dir="images" />
63    </copy>
64    <javac srcdir="src" destdir="${plugin.build.dir}" debug="true" source="1.5" target="1.5">
65      <classpath>
66        <pathelement path="${josm.build.dir}/build"/>
67        <fileset dir="${josm.build.dir}/lib">
68          <include name="**/*.jar"/>
69        </fileset>
70        <pathelement location="${livegpsplugin.jar}"/>
71      </classpath>
72    </javac>
73  </target>
74 
75  <target name="install" depends="dist">
76    <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
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 file="${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}">&lt;!-- plugins available on this site -->
93  &lt;plugins>
94  &lt;plugin id="${ant.project.name}" version="${plugin.version}">
95  &lt;name>${ant.project.name}&lt;/name>
96  &lt;description>${plugin.description}&lt;/description>
97  &lt;resource>${plugin.site.url}${plugin.jar}&lt;/resource>
98  &lt;/plugin>
99  &lt;/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}">&lt;?xml version="1.0"?>
107    &lt;site version="1.0">
108    &lt;!-- meta data of site -->
109&lt;site-info>
110&lt;site-name>${plugin.site.description}&lt;/site-name>
111&lt;site-url>${plugin.site.url}&lt;/site-url>
112&lt;/site-info>
113
114&lt;!-- plugins available on this site -->
115&lt;plugins>
116&lt;plugin id="${ant.project.name}" version="${plugin.version}">
117&lt;name>${ant.project.name}&lt;/name>
118&lt;description>${plugin.description}&lt;/description>
119&lt;resources>
120&lt;resource src="${plugin.site.url}${plugin.jar}"
121target="${josm.home.dir}/plugins/${plugin.jar}"/>
122&lt;/resources>
123&lt;/plugin>
124&lt;/plugins>
125&lt;/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.jar}"/>
135    <arg value="${plugin.site.file}"/>
136    <arg value="${plugin.site.upload.target}"/>
137  </exec>
138</target>
139
140</project>
Note: See TracBrowser for help on using the repository browser.