source: osm/applications/editors/josm/plugins/openvisible/build.xml@ 12780

Last change on this file since 12780 was 12780, checked in by stoecker, 16 years ago

removed tab stop usage

File size: 6.0 KB
Line 
1<project name="openvisible" default="dist" basedir=".">
2<!-- josm "user home" directory depends on the platform used (windows has a different place than unix/linux) -->
3 <property environment="env"/>
4 <condition property="josm.home.dir" value="${env.APPDATA}/JOSM" else="${user.home}/.josm">
5 <and>
6 <os family="windows"/>
7 </and>
8 </condition>
9<!-- compilation properties -->
10 <property name="josm.build.dir" value="../../core"/>
11 <property name="josm.plugins.dir" value="${josm.home.dir}/plugins"/>
12 <property name="plugin.build.dir" value="build"/>
13 <property name="plugin.dist.dir" value="../../dist"/>
14 <property name="plugin.name" value="${ant.project.name}"/>
15 <property name="plugin.jar" value="${plugin.name}.jar"/>
16 <property name="plugin.description" value="Allows opening gpx/osm files that intersect the currently visible screen area (V${plugin.version})."/>
17 <property name="plugin.stage" value="50"/>
18 <property name="plugin.class" value="at.dallermassl.josm.plugin.openvisible.OpenVisiblePlugin"/>
19<!-- update site meta data -->
20 <property name="plugin.site.file" value="josm-site.xml"/>
21 <property name="plugin.site.description" value="Josm's OpenVisible Update Site"/>
22 <property name="plugin.site.url" value="http://www.tegmento.org/~cdaller/josm/${ant.project.name}/"/>
23 <property name="plugin.site.upload.target" value="cdaller@www.tegmento.org:public_html/josm/${ant.project.name}/"/>
24 <property name="ant.build.javac.target" value="1.5"/>
25 <target name="dist" depends="compile,site">
26<!-- images -->
27 <copy todir="${plugin.build.dir}/images">
28 <fileset dir="images" />
29 </copy>
30<!-- copy configuration xml files
31 <copy todir="${plugin.build.dir}">
32 <fileset dir="src">
33 <include name="*.xml"/>
34 </fileset>
35 </copy>
36 -->
37 <mkdir dir="${plugin.dist.dir}"/>
38 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
39 <env key="LANG" value="C"/>
40 <arg value="info"/>
41 <arg value="--xml"/>
42 <arg value="."/>
43 </exec>
44 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
45 <delete file="REVISION"/>
46<!-- create jar file -->
47 <jar destfile="${plugin.dist.dir}/${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="${version.entry.commit.revision}"/>
52 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
53 <attribute name="Plugin-Mainversion" value="1180" />
54 <attribute name="Plugin-Dependencies" value="jgrapht-jdk1.5" />
55 <attribute name="Plugin-Stage" value="${plugin.stage}" />
56 </manifest>
57 </jar>
58 </target>
59 <target name="compile" depends="init">
60 <echo message="creating ${plugin.jar}"/>
61 <mkdir dir="${plugin.build.dir}"/>
62 <javac srcdir="src" destdir="${plugin.build.dir}" debug="true" source="1.5" target="1.5">
63 <classpath>
64 <pathelement path="${josm.build.dir}/build"/>
65 <fileset dir="${josm.build.dir}/lib">
66 <include name="**/*.jar"/>
67 </fileset>
68<!--
69 <fileset dir="lib">
70 <include name="**/*.jar"/>
71 </fileset>
72 -->
73 </classpath>
74 </javac>
75 </target>
76 <target name="install" depends="dist">
77 <copy file="${plugin.dist.dir}/${plugin.jar}" todir="${josm.plugins.dir}"/>
78<!--
79 <copy todir="${josm.home.dir}/plugins">
80 <fileset dir="lib">
81 <include name="**/*.jar"/>
82 </fileset>
83 </copy>
84 -->
85 </target>
86 <target name="init">
87 <echo>java version: ${java.version}</echo>
88 </target>
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<!-- 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<!-- upload the site description and the jar file via ssh -->
128 <target name="upload" depends="dist,site">
129 <echo message="uploading jar and site description to ${plugin.site.upload.target}"/>
130 <exec executable="scp">
131 <arg value="${plugin.dist.dir}/${plugin.jar}"/>
132 <arg value="${plugin.site.file}"/>
133 <arg value="${plugin.site.upload.target}"/>
134 </exec>
135 </target>
136 <target name="clean">
137 <delete dir="${plugin.build.dir}" />
138 <delete dir="${plugin.site.file}" />
139 <delete file="${plugin.dist.dir}/${plugin.jar}" />
140 </target>
141</project>
Note: See TracBrowser for help on using the repository browser.