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

Last change on this file since 5197 was 5197, checked in by gabriel, 12 years ago

Build all JOSM plugins for 1.5 by default.

File size: 4.8 KB
Line 
1<project name="colorscheme" default="dist" basedir=".">
2
3  <!-- compilation properties -->
4  <property name="josm.build.dir"       value="../../core"/>
5  <property name="josm.home.dir"        value="${user.home}/.josm"/>
6  <property name="josm"                 location="../../core/dist/josm-custom.jar" />
7  <property name="plugin.build.dir"     value="build"/>
8  <property name="plugin.dist.dir"      value="../dist"/>
9  <property name="plugin.name"          value="${ant.project.name}"/>
10  <property name="plugin.jar"           value="../dist/${plugin.name}.jar"/>
11 
12  <!-- plugin meta data (enter new version number if anything changed!) -->
13  <property name="plugin.version" value="0.5.2"/>
14  <property name="plugin.description" value="Allows the user to create different color schemes and to switch between them. Just change the colors and create a new scheme. Used to switch to a white background with matching colors for better visibility in bright sunlight. See dialog in JOSM's preferences and 'Map Settings' (strange but true :-) (V${plugin.version})."/>
15  <property name="plugin.class" value="at.dallermassl.josm.plugin.colorscheme.ColorSchemePlugin"/>
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 ColorScheme Plugin Update Site"/>
20  <property name="plugin.site.url" value="http://www.tegmento.org/~cdaller/josm/colorscheme/"/>
21  <property name="plugin.site.upload.target" value="cdaller@www.tegmento.org:public_html/josm/colorscheme/"/>
22
23  <property name="ant.build.javac.target" value="1.5"/>
24 
25  <target name="dist" depends="compile, site">
26    <!-- images -->
27    <!--
28         <copy todir="${plugin.build.dir}/images">
29           <fileset dir="src/images" />
30         </copy>
31         -->
32    <!-- copy configuration xml files -->
33    <copy todir="${plugin.build.dir}">
34      <fileset dir="src"> 
35        <include name="*.xml"/>
36      </fileset>
37    </copy>
38   
39    <!-- create jar file -->
40    <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
41      <manifest>
42        <attribute name="Plugin-Class" value="${plugin.class}" />
43        <attribute name="Plugin-Description" value="${plugin.description}" />
44        <attribute name="Plugin-Version" value="${plugin.version}" />
45        <!--attribute name="Plugin-Dependencies" value="org.eigenheimstrasse.josm" /-->
46      </manifest>
47    </jar>
48  </target>
49
50  <target name="compile" depends="init">
51    <mkdir dir="${plugin.build.dir}"/>
52    <javac srcdir="src" destdir="${plugin.build.dir}" debug="true" source="1.5" target="1.5">
53      <classpath>
54        <pathelement path="${josm.build.dir}/build"/>
55        <fileset dir="${josm.build.dir}/lib">
56          <include name="**/*.jar"/>
57        </fileset>
58      </classpath>
59    </javac>
60  </target>
61
62  <target name="install" depends="dist">
63    <copy file="${plugin.jar}" todir="${josm.home.dir}/plugins" />
64  </target>
65
66  <target name="init">
67    <echo>java version: ${java.version}</echo>
68  </target>
69
70  <target name="clean">
71    <delete dir="${plugin.site.file}" />
72    <delete dir="${plugin.build.dir}" />
73    <delete file="${plugin.jar}" />
74  </target>
75
76  <!-- write site description for the given plugin so josm will accept it -->
77  <target name="site">
78    <echo message="creating site description in ${plugin.site.file}"/>
79    <echo file="${plugin.site.file}">&lt;!-- plugins available on this site -->
80  &lt;plugins>
81  &lt;plugin id="${ant.project.name}" version="${plugin.version}">
82  &lt;name>${ant.project.name}&lt;/name>
83  &lt;description>${plugin.description}&lt;/description>
84  &lt;resource>${plugin.site.url}${plugin.jar}&lt;/resource>
85  &lt;/plugin>
86  &lt;/plugins>
87</echo>
88</target>
89
90<!-- write site description for the given plugin (not implemented in JOSM as full version yet!) -->
91<target name="site-full-donotuse">
92  <echo message="creating site description in ${plugin.site.file}"/>
93  <echo file="${plugin.site.file}">&lt;?xml version="1.0"?>
94    &lt;site version="1.0">
95    &lt;!-- meta data of site -->
96&lt;site-info>
97&lt;site-name>${plugin.site.description}&lt;/site-name>
98&lt;site-url>${plugin.site.url}&lt;/site-url>
99&lt;/site-info>
100
101&lt;!-- plugins available on this site -->
102&lt;plugins>
103&lt;plugin id="${ant.project.name}" version="${plugin.version}">
104&lt;name>${ant.project.name}&lt;/name>
105&lt;description>${plugin.description}&lt;/description>
106&lt;resources>
107&lt;resource src="${plugin.site.url}${plugin.jar}"
108target="${josm.home.dir}/plugins/${plugin.jar}"/>
109&lt;/resources>
110&lt;/plugin>
111&lt;/plugins>
112&lt;/site>
113</echo>
114</target>
115
116<!-- upload the site description and the jar file via ssh -->
117<target name="upload" depends="dist,site">
118  <echo message="uploading jar and site description to ${plugin.site.upload.target}"/>
119  <exec executable="scp">
120    <arg value="${plugin.jar}"/>
121    <arg value="${plugin.site.file}"/>
122    <arg value="${plugin.site.upload.target}"/>
123  </exec>
124</target>
125
126</project>
Note: See TracBrowser for help on using the repository browser.