source: osm/applications/editors/josm/plugins/openstreetbugs/build.xml@ 29854

Last change on this file since 29854 was 29854, checked in by donvip, 11 years ago

[josm_plugins] fix #8987 - bump min JOSM version of nearly all plugins to r6162 + code update/cleanup, fix warnings

  • Property svn:mime-type set to text/xml
File size: 6.9 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<project name="openstreetbugs" default="dist" basedir=".">
3 <property name="commit.message" value="Changed the constructor signature of the plugin main class"/>
4 <property name="plugin.main.version" value="6162"/>
5 <property name="josm" location="../../core/dist/josm-custom.jar"/>
6 <property name="plugin.dist.dir" value="../../dist"/>
7 <property name="plugin.build.dir" value="build"/>
8 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
9 <property name="ant.build.javac.target" value="1.6"/>
10 <target name="init">
11 <mkdir dir="${plugin.build.dir}"/>
12 </target>
13 <target name="compile" depends="init">
14 <echo message="creating ${plugin.jar}"/>
15 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
16 <compilerarg value="-Xlint:deprecation"/>
17 <compilerarg value="-Xlint:unchecked"/>
18 </javac>
19 </target>
20 <target name="dist" depends="compile,revision">
21 <copy todir="${plugin.build.dir}/images">
22 <fileset dir="images"/>
23 </copy>
24 <copy todir="${plugin.build.dir}/data">
25 <fileset dir="data"/>
26 </copy>
27 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
28 <manifest>
29 <attribute name="Author" value="Henrik Niehaus"/>
30 <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.osb.OsbPlugin"/>
31 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
32 <attribute name="Plugin-Description" value="Imports issues from OpenStreetBugs"/>
33 <attribute name="Plugin-Icon" value="images/dialogs/icon_error24.png"/>
34 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/OpenStreetBugs"/>
35 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
36 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
37 </manifest>
38 </jar>
39 </target>
40 <target name="revision">
41 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
42 <env key="LANG" value="C"/>
43 <arg value="info"/>
44 <arg value="--xml"/>
45 <arg value="."/>
46 </exec>
47 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
48 <delete file="REVISION"/>
49 </target>
50 <target name="clean">
51 <delete dir="${plugin.build.dir}"/>
52 <delete file="${plugin.jar}"/>
53 </target>
54 <target name="install" depends="dist">
55 <property environment="env"/>
56 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
57 <and>
58 <os family="windows"/>
59 </and>
60 </condition>
61 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
62 </target>
63 <!--
64 ************************** Publishing the plugin ***********************************
65 -->
66 <!--
67 ** extracts the JOSM release for the JOSM version in ../core and saves it in the
68 ** property ${coreversion.info.entry.revision}
69 **
70 -->
71 <target name="core-info">
72 <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
73 <env key="LANG" value="C"/>
74 <arg value="info"/>
75 <arg value="--xml"/>
76 <arg value="../../core"/>
77 </exec>
78 <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
79 <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
80 <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
81 <delete file="core.info.xml"/>
82 </target>
83 <!--
84 ** commits the source tree for this plugin
85 -->
86 <target name="commit-current">
87 <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
88 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
89 <env key="LANG" value="C"/>
90 <arg value="commit"/>
91 <arg value="-m '${commit.message}'"/>
92 <arg value="."/>
93 </exec>
94 </target>
95 <!--
96 ** updates (svn up) the source tree for this plugin
97 -->
98 <target name="update-current">
99 <echo>Updating plugin source ...</echo>
100 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
101 <env key="LANG" value="C"/>
102 <arg value="up"/>
103 <arg value="."/>
104 </exec>
105 <echo>Updating ${plugin.jar} ...</echo>
106 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
107 <env key="LANG" value="C"/>
108 <arg value="up"/>
109 <arg value="../dist/${plugin.jar}"/>
110 </exec>
111 </target>
112 <!--
113 ** commits the plugin.jar
114 -->
115 <target name="commit-dist">
116 <echo>
117 ***** Properties of published ${plugin.jar} *****
118 Commit message : '${commit.message}'
119 Plugin-Mainversion: ${plugin.main.version}
120 JOSM build version: ${coreversion.info.entry.revision}
121 Plugin-Version : ${version.entry.commit.revision}
122 ***** / Properties of published ${plugin.jar} *****
123
124 Now commiting ${plugin.jar} ...
125 </echo>
126 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
127 <env key="LANG" value="C"/>
128 <arg value="-m '${commit.message}'"/>
129 <arg value="commit"/>
130 <arg value="${plugin.jar}"/>
131 </exec>
132 </target>
133 <!-- ** make sure svn is present as a command line tool ** -->
134 <target name="ensure-svn-present">
135 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
136 <env key="LANG" value="C"/>
137 <arg value="--version"/>
138 </exec>
139 <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
140 <!-- return code not set at all? Most likely svn isn't installed -->
141 <condition>
142 <not>
143 <isset property="svn.exit.code"/>
144 </not>
145 </condition>
146 </fail>
147 <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
148 <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
149 <condition>
150 <isfailure code="${svn.exit.code}"/>
151 </condition>
152 </fail>
153 </target>
154 <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
155 </target>
156</project>
Note: See TracBrowser for help on using the repository browser.