source: osm/applications/editors/josm/plugins/smed_fw/build.xml@ 27038

Last change on this file since 27038 was 26605, checked in by stoecker, 13 years ago

fix build version due to core change

File size: 7.5 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3** This is a template build file for a JOSM plugin.
4**
5** Maintaining versions
6** ====================
7** see README.template
8**
9** Usage
10** =====
11** To build it run
12**
13** > ant dist
14**
15** To install the generated plugin locally (in you default plugin directory) run
16**
17** > ant install
18**
19** The generated plugin jar is not automatically available in JOSMs plugin configuration
20** dialog. You have to check it in first.
21**
22** Use the ant target 'publish' to check in the plugin and make it available to other
23** JOSM users:
24** set the properties commit.message and plugin.main.version
25** and run
26** > ant publish
27**
28**
29-->
30<project name="smed_fw" basedir=".">
31 <!-- enter the SVN commit message -->
32 <property name="commit.message" value="smed with embeddes felix and DS"/>
33 <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
34 <property name="plugin.main.version" value="4394"/>
35 <!--
36 ************************************************
37 ** should not be necessary to change the following properties
38 -->
39 <property name="josm" location="../../core/dist/josm-custom.jar"/>
40 <property name="felix" location="core/dist/felix.jar"/>
41 <property name="plugin.build.dir" value="build/"/>
42 <property name="plugin.src.dir" value="src/"/>
43 <property name="smed_fw.dist.dir" value="dist/"/>
44 <!-- this is the directory where the plugin jar is copied to -->
45 <property name="plugin.dist.dir" value="../../dist/"/>
46 <property name="smed_fw_core.dist.dir" value="core/dist/"/>
47 <property name="ant.build.javac.target" value="1.5"/>
48 <property name="plugin.jar" value="${plugin.dist.dir}${ant.project.name}.jar"/>
49 <!--
50 **********************************************************
51 ** init - initializes the build
52 **********************************************************
53 -->
54 <target name="init">
55 <mkdir dir="${plugin.build.dir}"/>
56 <mkdir dir="${smed_fw_core.dist.dir}"/>
57 <mkdir dir="${smed_fw.dist.dir}"/>
58 </target>
59 <!--
60 **********************************************************
61 ** compile - complies the source tree
62 **********************************************************
63 -->
64 <target name="compile" depends="init">
65 <echo message="compiling sources for ${plugin.jar} ... "/>
66 <javac srcdir="src" classpath="${josm}:${felix}" debug="true" destdir="${plugin.build.dir}">
67 <compilerarg value="-Xlint:deprecation"/>
68 <compilerarg value="-Xlint:unchecked"/>
69 </javac>
70 </target>
71 <!--
72 **********************************************************
73 ** dist - creates the plugin jar
74 **********************************************************
75 -->
76 <target name="dist" depends="compile, revision">
77 <echo message="creating ${ant.project.name}.jar ... "/>
78 <copy todir="${plugin.build.dir}/images">
79 <fileset dir="images"/>
80 </copy>
81 <copy todir="${plugin.build.dir}/smed_fw/msg">
82 <fileset dir="${plugin.src.dir}/smed_fw/msg"/>
83 </copy>
84 <copy todir="${plugin.build.dir}">
85 <fileset dir="${smed_fw.dist.dir}"/>
86 </copy>
87 <copy todir="${plugin.build.dir}">
88 <fileset dir=".">
89 <include name="*.txt"/>
90 </fileset>
91 </copy>
92 <copy file="${felix}" todir="${plugin.build.dir}"/>
93 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
94 <!--
95 ************************************************
96 ** configure these properties. Most of them will be copied to the plugins
97 ** manifest file. Property values will also show up in the list available
98 ** plugins: http://josm.openstreetmap.de/wiki/Plugins.
99 **
100 ************************************************
101 -->
102 <manifest>
103 <attribute name="Author" value="Werner, Malcolm"/>
104 <attribute name="Plugin-Class" value="smed_fw.SmedFW"/>
105 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
106 <attribute name="Plugin-Description" value="Create and edit seamaps for OpenSeaMap"/>
107 <attribute name="Plugin-Icon" value="images/Smed.png"/>
108 <attribute name="Plugin-Link" value="http://openseamap.org/"/>
109 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
110 <!--
111 <attribute name="Plugin-Version" value="23456"/>
112 -->
113 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
114 <attribute name="Class-Path" value="bin/felix.jar"/>
115 </manifest>
116 </jar>
117 <!-- install interface -->
118 <copy file="${plugin.jar}" todir="${smed_fw_core.dist.dir}"/>
119 </target>
120 <!--
121 **********************************************************
122 ** revision - extracts the current revision number for the
123 ** file build.number and stores it in the XML property
124 ** version.*
125 **********************************************************
126 -->
127 <target name="revision">
128 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
129 <env key="LANG" value="C"/>
130 <arg value="info"/>
131 <arg value="--xml"/>
132 <arg value="."/>
133 </exec>
134 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
135 <delete file="REVISION"/>
136 </target>
137 <!--
138 **********************************************************
139 ** clean - clean up the build environment
140 **********************************************************
141 -->
142 <target name="clean">
143 <delete dir="${plugin.build.dir}"/>
144 <delete file="${plugin.jar}"/>
145 </target>
146 <!--
147 **********************************************************
148 ** install - install the plugin in your local JOSM installation
149 **********************************************************
150 -->
151 <target name="install" depends="dist">
152 <property environment="env"/>
153 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
154 <and>
155 <os family="windows"/>
156 </and>
157 </condition>
158 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
159 </target>
160 <!--
161 ** commits the source tree for this plugin
162 -->
163 <target name="commit-current">
164 <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
165 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
166 <env key="LANG" value="C"/>
167 <arg value="commit"/>
168 <arg value="-m '${commit.message}'"/>
169 <arg value="."/>
170 </exec>
171 </target>
172 <!--
173 ** updates (svn up) the source tree for this plugin
174 -->
175 <target name="update-current">
176 <echo>Updating plugin source ...</echo>
177 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
178 <env key="LANG" value="C"/>
179 <arg value="up"/>
180 <arg value="."/>
181 </exec>
182 <echo>Updating ${plugin.jar} ...</echo>
183 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
184 <env key="LANG" value="C"/>
185 <arg value="up"/>
186 <arg value="../dist/${plugin.jar}"/>
187 </exec>
188 </target>
189</project>
Note: See TracBrowser for help on using the repository browser.