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

Last change on this file since 12588 was 12588, checked in by Dirk Stoecker, 11 years ago

updated a lot

File size: 5.6 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  <property name="plugin.description" value="Allows opening gpx/osm files that intersect the currently visible screen area (V${plugin.version})."/>
20  <property name="plugin.stage" value="50"/>
21  <property name="plugin.class" value="at.dallermassl.josm.plugin.openvisible.OpenVisiblePlugin"/>
22 
23  <!-- update site meta data -->
24  <property name="plugin.site.file" value="josm-site.xml"/>
25  <property name="plugin.site.description" value="Josm's OpenVisible Update Site"/>
26  <property name="plugin.site.url" value="http://www.tegmento.org/~cdaller/josm/${ant.project.name}/"/>
27  <property name="plugin.site.upload.target" value="cdaller@www.tegmento.org:public_html/josm/${ant.project.name}/"/>
28
29  <property name="ant.build.javac.target" value="1.5"/>
30 
31
32  <target name="dist" depends="compile,site">
33    <!-- images -->
34    <copy todir="${plugin.build.dir}/images">
35      <fileset dir="images" />
36    </copy>
37    <!-- copy configuration xml files
38         <copy todir="${plugin.build.dir}">
39           <fileset dir="src">
40             <include name="*.xml"/>
41           </fileset>
42         </copy>
43         -->
44   
45    <mkdir dir="${plugin.dist.dir}"/>
46   
47    <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
48      <env key="LANG" value="C"/>
49      <arg value="info"/>
50      <arg value="--xml"/>
51      <arg value="."/>
52    </exec>
53    <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
54    <delete file="REVISION"/>
55    <!-- create jar file -->
56    <jar destfile="${plugin.dist.dir}/${plugin.jar}" basedir="${plugin.build.dir}">
57      <manifest>
58        <attribute name="Plugin-Class" value="${plugin.class}" />
59        <attribute name="Plugin-Description" value="${plugin.description}" />
60        <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
61        <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
62        <attribute name="Plugin-Mainversion" value="1180" />
63        <attribute name="Plugin-Dependencies" value="jgrapht-jdk1.5" />
64        <attribute name="Plugin-Stage" value="${plugin.stage}" />
65      </manifest>
66    </jar>
67  </target>
68
69  <target name="compile" depends="init">
70    <echo message="creating ${plugin.jar}"/>
71    <mkdir dir="${plugin.build.dir}"/>
72    <javac srcdir="src" destdir="${plugin.build.dir}" debug="true" source="1.5" target="1.5">
73      <classpath>
74        <pathelement path="${josm.build.dir}/build"/>
75        <fileset dir="${josm.build.dir}/lib">
76          <include name="**/*.jar"/>
77        </fileset>
78        <!--
79            <fileset dir="lib">
80              <include name="**/*.jar"/>
81            </fileset>
82            -->
83      </classpath>
84    </javac>
85  </target>
86
87  <target name="install" depends="dist">
88    <copy file="${plugin.dist.dir}/${plugin.jar}" todir="${josm.plugins.dir}"/>
89    <!--
90        <copy todir="${josm.home.dir}/plugins">
91          <fileset dir="lib">
92            <include name="**/*.jar"/>
93          </fileset>
94        </copy>
95        -->
96  </target>
97
98  <target name="init">
99    <echo>java version: ${java.version}</echo>
100  </target>
101
102  <!-- write site description for the given plugin so josm will accept it -->
103  <target name="site">
104    <echo message="creating site description in ${plugin.site.file}"/>
105    <echo file="${plugin.site.file}">&lt;!-- plugins available on this site -->
106  &lt;plugins>
107  &lt;plugin id="${ant.project.name}" version="${plugin.version}">
108  &lt;name>${ant.project.name}&lt;/name>
109  &lt;description>${plugin.description}&lt;/description>
110  &lt;resource>${plugin.site.url}${plugin.jar}&lt;/resource>
111  &lt;/plugin>
112  &lt;/plugins>
113</echo>
114</target>
115
116<!-- write site description for the given plugin (not implemented in JOSM as full version yet!) -->
117<target name="site-full-donotuse">
118  <echo message="creating site description in ${plugin.site.file}"/>
119  <echo file="${plugin.site.file}">&lt;?xml version="1.0"?>
120    &lt;site version="1.0">
121    &lt;!-- meta data of site -->
122&lt;site-info>
123&lt;site-name>${plugin.site.description}&lt;/site-name>
124&lt;site-url>${plugin.site.url}&lt;/site-url>
125&lt;/site-info>
126
127&lt;!-- plugins available on this site -->
128&lt;plugins>
129&lt;plugin id="${ant.project.name}" version="${plugin.version}">
130&lt;name>${ant.project.name}&lt;/name>
131&lt;description>${plugin.description}&lt;/description>
132&lt;resources>
133&lt;resource src="${plugin.site.url}${plugin.jar}"
134target="${josm.home.dir}/plugins/${plugin.jar}"/>
135&lt;/resources>
136&lt;/plugin>
137&lt;/plugins>
138&lt;/site>
139</echo>
140</target>
141
142
143<!-- upload the site description and the jar file via ssh -->
144<target name="upload" depends="dist,site">
145  <echo message="uploading jar and site description to ${plugin.site.upload.target}"/>
146  <exec executable="scp">
147    <arg value="${plugin.dist.dir}/${plugin.jar}"/>
148    <arg value="${plugin.site.file}"/>
149    <arg value="${plugin.site.upload.target}"/>
150  </exec>
151</target>
152
153<target name="clean">
154  <delete dir="${plugin.build.dir}" />
155  <delete dir="${plugin.site.file}" />
156  <delete file="${plugin.dist.dir}/${plugin.jar}" />
157</target>
158
159</project>
Note: See TracBrowser for help on using the repository browser.