source: subversion/applications/editors/josm/plugins/navigator/build.xml @ 10525

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

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

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