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

Last change on this file since 5326 was 5326, checked in by frederik, 12 years ago

re-build 0.2.1

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