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

Last change on this file since 10310 was 7287, checked in by joerg, 12 years ago

josm/plugins/*/build.xml: add echo to identify which compile failes

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    <echo message="creating ${plugin.jar}"/>
27    <!-- images -->
28    <!--
29         <copy todir="${plugin.build.dir}/images">
30           <fileset dir="src/images" />
31         </copy>
32         -->
33    <!-- copy configuration xml files -->
34    <copy todir="${plugin.build.dir}">
35      <fileset dir="src"> 
36        <include name="*.xml"/>
37      </fileset>
38    </copy>
39   
40    <!-- create jar file -->
41    <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
42      <manifest>
43        <attribute name="Plugin-Class" value="${plugin.class}" />
44        <attribute name="Plugin-Description" value="${plugin.description}" />
45        <attribute name="Plugin-Version" value="${plugin.version}" />
46        <!--attribute name="Plugin-Dependencies" value="org.eigenheimstrasse.josm" /-->
47      </manifest>
48    </jar>
49  </target>
50
51  <target name="compile" depends="init">
52    <mkdir dir="${plugin.build.dir}"/>
53    <javac srcdir="src" destdir="${plugin.build.dir}" debug="true" source="1.5" target="1.5">
54      <classpath>
55        <pathelement path="${josm.build.dir}/build"/>
56        <fileset dir="${josm.build.dir}/lib">
57          <include name="**/*.jar"/>
58        </fileset>
59      </classpath>
60    </javac>
61  </target>
62
63  <target name="install" depends="dist">
64    <copy file="${plugin.jar}" todir="${josm.home.dir}/plugins" />
65  </target>
66
67  <target name="init">
68    <echo>java version: ${java.version}</echo>
69  </target>
70
71  <target name="clean">
72    <delete dir="${plugin.site.file}" />
73    <delete dir="${plugin.build.dir}" />
74    <delete file="${plugin.jar}" />
75  </target>
76
77  <!-- write site description for the given plugin so josm will accept it -->
78  <target name="site">
79    <echo message="creating site description in ${plugin.site.file}"/>
80    <echo file="${plugin.site.file}">&lt;!-- plugins available on this site -->
81  &lt;plugins>
82  &lt;plugin id="${ant.project.name}" version="${plugin.version}">
83  &lt;name>${ant.project.name}&lt;/name>
84  &lt;description>${plugin.description}&lt;/description>
85  &lt;resource>${plugin.site.url}${plugin.jar}&lt;/resource>
86  &lt;/plugin>
87  &lt;/plugins>
88</echo>
89</target>
90
91<!-- write site description for the given plugin (not implemented in JOSM as full version yet!) -->
92<target name="site-full-donotuse">
93  <echo message="creating site description in ${plugin.site.file}"/>
94  <echo file="${plugin.site.file}">&lt;?xml version="1.0"?>
95    &lt;site version="1.0">
96    &lt;!-- meta data of site -->
97&lt;site-info>
98&lt;site-name>${plugin.site.description}&lt;/site-name>
99&lt;site-url>${plugin.site.url}&lt;/site-url>
100&lt;/site-info>
101
102&lt;!-- plugins available on this site -->
103&lt;plugins>
104&lt;plugin id="${ant.project.name}" version="${plugin.version}">
105&lt;name>${ant.project.name}&lt;/name>
106&lt;description>${plugin.description}&lt;/description>
107&lt;resources>
108&lt;resource src="${plugin.site.url}${plugin.jar}"
109target="${josm.home.dir}/plugins/${plugin.jar}"/>
110&lt;/resources>
111&lt;/plugin>
112&lt;/plugins>
113&lt;/site>
114</echo>
115</target>
116
117<!-- upload the site description and the jar file via ssh -->
118<target name="upload" depends="dist,site">
119  <echo message="uploading jar and site description to ${plugin.site.upload.target}"/>
120  <exec executable="scp">
121    <arg value="${plugin.jar}"/>
122    <arg value="${plugin.site.file}"/>
123    <arg value="${plugin.site.upload.target}"/>
124  </exec>
125</target>
126
127</project>
Note: See TracBrowser for help on using the repository browser.