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

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

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

File size: 5.3 KB
Line 
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    <echo message="creating ${plugin.jar}"/>
63    <mkdir dir="${plugin.build.dir}"/>
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        <!--
71            <fileset dir="lib">
72              <include name="**/*.jar"/>
73            </fileset>
74            -->
75      </classpath>
76    </javac>
77  </target>
78
79  <target name="install" depends="dist">
80    <copy file="${plugin.dist.dir}/${plugin.jar}" todir="${josm.plugins.dir}"/>
81    <!--
82        <copy todir="${josm.home.dir}/plugins">
83          <fileset dir="lib">
84            <include name="**/*.jar"/>
85          </fileset>
86        </copy>
87        -->
88  </target>
89
90  <target name="init">
91    <echo>java version: ${java.version}</echo>
92  </target>
93
94  <!-- write site description for the given plugin so josm will accept it -->
95  <target name="site">
96    <echo message="creating site description in ${plugin.site.file}"/>
97    <echo file="${plugin.site.file}">&lt;!-- plugins available on this site -->
98  &lt;plugins>
99  &lt;plugin id="${ant.project.name}" version="${plugin.version}">
100  &lt;name>${ant.project.name}&lt;/name>
101  &lt;description>${plugin.description}&lt;/description>
102  &lt;resource>${plugin.site.url}${plugin.jar}&lt;/resource>
103  &lt;/plugin>
104  &lt;/plugins>
105</echo>
106</target>
107
108<!-- write site description for the given plugin (not implemented in JOSM as full version yet!) -->
109<target name="site-full-donotuse">
110  <echo message="creating site description in ${plugin.site.file}"/>
111  <echo file="${plugin.site.file}">&lt;?xml version="1.0"?>
112    &lt;site version="1.0">
113    &lt;!-- meta data of site -->
114&lt;site-info>
115&lt;site-name>${plugin.site.description}&lt;/site-name>
116&lt;site-url>${plugin.site.url}&lt;/site-url>
117&lt;/site-info>
118
119&lt;!-- plugins available on this site -->
120&lt;plugins>
121&lt;plugin id="${ant.project.name}" version="${plugin.version}">
122&lt;name>${ant.project.name}&lt;/name>
123&lt;description>${plugin.description}&lt;/description>
124&lt;resources>
125&lt;resource src="${plugin.site.url}${plugin.jar}"
126target="${josm.home.dir}/plugins/${plugin.jar}"/>
127&lt;/resources>
128&lt;/plugin>
129&lt;/plugins>
130&lt;/site>
131</echo>
132</target>
133
134
135<!-- upload the site description and the jar file via ssh -->
136<target name="upload" depends="dist,site">
137  <echo message="uploading jar and site description to ${plugin.site.upload.target}"/>
138  <exec executable="scp">
139    <arg value="${plugin.dist.dir}/${plugin.jar}"/>
140    <arg value="${plugin.site.file}"/>
141    <arg value="${plugin.site.upload.target}"/>
142  </exec>
143</target>
144
145<target name="clean">
146  <delete dir="${plugin.build.dir}" />
147  <delete dir="${plugin.site.file}" />
148  <delete file="${plugin.dist.dir}/${plugin.jar}" />
149</target>
150
151</project>
Note: See TracBrowser for help on using the repository browser.