source: subversion/applications/editors/josm/plugins/colorscheme/build.xml @ 3409

Last change on this file since 3409 was 3409, checked in by christofd, 12 years ago

added site generation for pluginmanagement
most values are put into property values

File size: 3.8 KB
Line 
1<project name="colorscheme" default="dist" basedir=".">
2
3  <!-- compilation properties -->
4  <property name="josm.build.dir" value="../JOSM"/>
5  <property name="josm.home.dir" value="${user.home}/.josm"/>
6  <property name="plugin.build.dir" value="bin"/>
7  <property name="plugin.name" value="${ant.project.name}"/>
8  <property name="plugin.jar" value="${plugin.name}.jar"/>
9 
10  <!-- plugin meta data (enter new version number if anything changed!) -->
11  <property name="plugin.version" value="0.5.1"/>
12  <property name="plugin.description" value="Manage multiple colorschemes (V${plugin.version})."/>
13  <property name="plugin.class" value="at.dallermassl.josm.plugin.colorscheme.ColorSchemePlugin"/>
14
15  <!-- update site meta data -->
16  <property name="plugin.site.file" value="josm-site.xml"/>
17  <property name="plugin.site.description" value="Josm's ColorScheme Plugin Update Site"/>
18  <property name="plugin.site.url" value="http://www.tegmento.org/~cdaller/josm/colorscheme/"/>
19  <property name="plugin.site.upload.target" value="cdaller@www.tegmento.org:public_html/josm/colorscheme/"/>
20 
21  <target name="dist" depends="compile, site">
22    <!-- images -->
23    <!--
24    <copy todir="${plugin.build.dir}/images">
25      <fileset dir="src/images" />
26    </copy>
27    -->
28      <!-- copy configuration xml files -->
29    <copy todir="${plugin.build.dir}">
30      <fileset dir="src"> 
31        <include name="*.xml"/>
32      </fileset>
33    </copy>
34   
35    <!-- create jar file -->
36    <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
37      <manifest>
38        <attribute name="Plugin-Class" value="${plugin.class}" />
39        <attribute name="Plugin-Description" value="${plugin.description}" />
40        <attribute name="Plugin-Version" value="${plugin.version}" />
41        <!--attribute name="Plugin-Dependencies" value="org.eigenheimstrasse.josm" /-->
42      </manifest>
43    </jar>
44  </target>
45
46  <target name="compile" depends="init">
47    <mkdir dir="${plugin.build.dir}"/>
48    <javac srcdir="src" destdir="${plugin.build.dir}" debug="true" source="1.5" target="1.5">
49      <classpath>
50        <pathelement path="${josm.build.dir}/build"/>
51        <fileset dir="${josm.build.dir}/lib">
52          <include name="**/*.jar"/>
53        </fileset>
54      </classpath>
55    </javac>
56  </target>
57
58  <target name="install" depends="dist">
59    <copy file="${plugin.jar}" todir="${josm.home.dir}/plugins" />
60  </target>
61
62  <target name="init">
63     <echo>java version: ${java.version}</echo>
64   </target>
65
66  <target name="clean">
67    <delete dir="${plugin.build.dir}" />
68    <delete dir="${plugin.site.file}" />
69    <delete dir="${plugin.jar}" />
70  </target>
71
72  <!-- write site description for the given plugin -->
73  <target name="site">
74    <echo message="creating site description in ${plugin.site.file}"/>
75    <echo file="${plugin.site.file}">&lt;?xml version="1.0"?>
76&lt;site version="1.0">
77  &lt;!-- meta data of site -->
78  &lt;site-info>
79    &lt;site-name>${plugin.site.description}&lt;/site-name>
80    &lt;site-url>${plugin.site.url}&lt;/site-url>
81  &lt;/site-info>
82
83  &lt;!-- plugins available on this site -->
84  &lt;plugins>
85    &lt;plugin id="${ant.project.name}" version="${plugin.version}">
86      &lt;name>${ant.project.name}&lt;/name>
87      &lt;description>${plugin.description}&lt;/description>
88      &lt;resources>
89        &lt;resource src="${plugin.site.url}/${plugin.jar}"
90                  target="$${josm.user.dir}/plugins/${plugin.jar}"/>
91      &lt;/resources>
92    &lt;/plugin>
93  &lt;/plugins>
94&lt;/site>
95    </echo>
96  </target>
97
98  <!-- upload the site description and the jar file via ssh -->
99  <target name="upload" depends="dist,site">
100    <echo message="uploading jar and site description to ${plugin.site.upload.target}"/>
101    <exec executable="scp">
102      <arg value="${plugin.jar}"/>
103      <arg value="${plugin.site.file}"/>
104      <arg value="${plugin.site.upload.target}"/>
105    </exec>
106  </target>
107
108</project>
Note: See TracBrowser for help on using the repository browser.