source: osm/applications/editors/josm/plugins/simple/build.xml@ 23119

Last change on this file since 23119 was 23119, checked in by postfix, 14 years ago

toms has now a plug interface
added simple as a pluggable example

File size: 3.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="simple" default="dist">
31
32 <!--
33 ************************************************
34 ** should not be necessary to change the following properties
35 -->
36 <property name="toms" location="../../dist/toms.jar/"/>
37 <property name="plugin.build.dir" value="build"/>
38 <property name="plugin.src.dir" value="src"/>
39 <!-- this is the directory where the plugin jar is copied to -->
40 <property name="plugin.dist.dir" value="../../dist"/>
41 <property name="ant.build.javac.target" value="1.5"/>
42 <property name="plugin.dist.dir" value="../../dist"/>
43 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
44
45 <!--
46 **********************************************************
47 ** init - initializes the build
48 **********************************************************
49 -->
50 <target name="init">
51 <mkdir dir="${plugin.build.dir}"/>
52 </target>
53
54 <!--
55 **********************************************************
56 ** compile - compiles the source tree
57 **********************************************************
58 -->
59 <target name="compile" depends="init">
60 <echo message="compiling sources for ${plugin.jar} ... "/>
61 <javac srcdir="src" classpath="${toms}" debug="true" destdir="${plugin.build.dir}">
62 <compilerarg value="-Xlint:deprecation"/>
63 <compilerarg value="-Xlint:unchecked"/>
64 </javac>
65 </target>
66
67 <target name="dist" depends="compile">
68 <echo message="creating ${ant.project.name}.jar ... "/>
69 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
70 <!--
71 ************************************************
72 ** configure these properties. Most of them will be copied to the plugins
73 ** manifest file. Property values will also show up in the list available
74 ** plugins: http://josm.openstreetmap.de/wiki/Plugins.
75 **
76 ************************************************
77 -->
78 <manifest>
79 <attribute name="Author" value="Werner, Malcolm"/>
80 <attribute name="Plugin-Class" value="ifc.Pluggable"/>
81 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
82 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
83 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
84 </manifest>
85 </jar>
86 </target>
87
88 <!--
89 **********************************************************
90 ** install - install the plugin in your local JOSM installation
91 **********************************************************
92 -->
93 <target name="install" depends="dist">
94 <property environment="env"/>
95 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
96 <and>
97 <os family="windows"/>
98 </and>
99 </condition>
100 <copy file="${plugin.jar}" todir="${josm.plugins.dir}/tplug"/>
101 </target>
102
103</project>
Note: See TracBrowser for help on using the repository browser.