source: osm/applications/editors/josm/plugins/openvisible/build.xml@ 31034

Last change on this file since 31034 was 30530, checked in by donvip, 10 years ago

[josm_plugins] add eclipse projects + fix "includeantruntime" warnings

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