source: osm/applications/editors/josm/plugins/tagging-preset-tester/build.xml@ 30726

Last change on this file since 30726 was 30592, checked in by donvip, 10 years ago

[josm_tagging-preset-tester] fix #josm9645 - Malfunction in Tagging Preset Tester main dialog

  • Property svn:mime-type set to text/xml
File size: 7.2 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<project name="tagging-preset-tester" default="dist" basedir=".">
3 <property name="commit.message" value="[josm_tagging_preset_tester] #josm10288: fix NPE when starting without map"/>
4 <property name="plugin.main.version" value="7412"/>
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.7"/>
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}" includeantruntime="false">
16 <compilerarg value="-Xlint:deprecation"/>
17 <compilerarg value="-Xlint:unchecked"/>
18 </javac>
19 </target>
20 <target name="run" depends="install">
21 <echo message="creating ${plugin.jar}"/>
22 <java classpath="${josm};${plugin.jar}" classname="org.openstreetmap.josm.plugins.taggingpresettester.TaggingPresetTester"/>
23 </target>
24 <target name="dist" depends="compile,revision">
25 <copy todir="${plugin.build.dir}/images">
26 <fileset dir="images"/>
27 </copy>
28 <copy todir="${plugin.build.dir}/data">
29 <fileset dir="data"/>
30 </copy>
31 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
32 <manifest>
33 <attribute name="Author" value="Imi"/>
34 <attribute name="Main-Class" value="org.openstreetmap.josm.plugins.taggingpresettester.TaggingPresetTester"/>
35 <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.taggingpresettester.TaggingPresetTesterAction"/>
36 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
37 <attribute name="Plugin-Description" value="Adds a tagging preset tester to the help menu, which helps you developing of tagging presets (quick preview of the dialog that will popup). You can start the jar-file as standalone as well."/>
38 <attribute name="Plugin-Icon" value="images/tagging-preset-tester.png"/>
39 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
40 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
41 </manifest>
42 </jar>
43 </target>
44 <target name="revision">
45 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
46 <env key="LANG" value="C"/>
47 <arg value="info"/>
48 <arg value="--xml"/>
49 <arg value="."/>
50 </exec>
51 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
52 <delete file="REVISION"/>
53 </target>
54 <target name="clean">
55 <delete dir="${plugin.build.dir}"/>
56 <delete file="${plugin.jar}"/>
57 </target>
58 <target name="install" depends="dist">
59 <property environment="env"/>
60 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
61 <and>
62 <os family="windows"/>
63 </and>
64 </condition>
65 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
66 </target>
67 <!--
68 ************************** Publishing the plugin ***********************************
69 -->
70 <!--
71 ** extracts the JOSM release for the JOSM version in ../core and saves it in the
72 ** property ${coreversion.info.entry.revision}
73 **
74 -->
75 <target name="core-info">
76 <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
77 <env key="LANG" value="C"/>
78 <arg value="info"/>
79 <arg value="--xml"/>
80 <arg value="../../core"/>
81 </exec>
82 <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
83 <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
84 <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
85 <delete file="core.info.xml"/>
86 </target>
87 <!--
88 ** commits the source tree for this plugin
89 -->
90 <target name="commit-current">
91 <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
92 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="true">
93 <env key="LANG" value="C"/>
94 <arg value="commit"/>
95 <arg value="-m '${commit.message}'"/>
96 <arg value="."/>
97 </exec>
98 </target>
99 <!--
100 ** updates (svn up) the source tree for this plugin
101 -->
102 <target name="update-current">
103 <echo>Updating plugin source ...</echo>
104 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
105 <env key="LANG" value="C"/>
106 <arg value="up"/>
107 <arg value="."/>
108 </exec>
109 <echo>Updating ${plugin.jar} ...</echo>
110 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
111 <env key="LANG" value="C"/>
112 <arg value="up"/>
113 <arg value="../dist/${plugin.jar}"/>
114 </exec>
115 </target>
116 <!--
117 ** commits the plugin.jar
118 -->
119 <target name="commit-dist">
120 <echo>
121***** Properties of published ${plugin.jar} *****
122Commit message : '${commit.message}'
123Plugin-Mainversion: ${plugin.main.version}
124JOSM build version: ${coreversion.info.entry.revision}
125Plugin-Version : ${version.entry.commit.revision}
126***** / Properties of published ${plugin.jar} *****
127
128Now commiting ${plugin.jar} ...
129</echo>
130 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
131 <env key="LANG" value="C"/>
132 <arg value="-m '${commit.message}'"/>
133 <arg value="commit"/>
134 <arg value="${plugin.jar}"/>
135 </exec>
136 </target>
137 <!-- ** make sure svn is present as a command line tool ** -->
138 <target name="ensure-svn-present">
139 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
140 <env key="LANG" value="C"/>
141 <arg value="--version"/>
142 </exec>
143 <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
144 <!-- return code not set at all? Most likely svn isn't installed -->
145 <condition>
146 <not>
147 <isset property="svn.exit.code"/>
148 </not>
149 </condition>
150 </fail>
151 <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
152 <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
153 <condition>
154 <isfailure code="${svn.exit.code}"/>
155 </condition>
156 </fail>
157 </target>
158 <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
159 </target>
160</project>
Note: See TracBrowser for help on using the repository browser.