source: osm/applications/editors/josm/plugins/public_transport/build.xml@ 20072

Last change on this file since 20072 was 20072, checked in by roland, 14 years ago

Public Transport Plugin: added documentation, not yet complete

File size: 5.5 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3** Usage
4** =====
5** To build it run
6**
7** > ant dist
8**
9** To install the generated plugin locally (in you default plugin directory) run
10**
11** > ant install
12**
13** The generated plugin jar is not automatically available in JOSMs plugin configuration
14** dialog. You have to check it in first.
15**
16-->
17<project name="public_transport" default="dist" basedir=".">
18 <property name="josm.basedir" location="../.."/>
19 <!--
20 ************************************************
21 ** should not be necessary to change the following properties
22 -->
23 <property name="josm" location="${josm.basedir}/core/dist/josm-custom.jar"/>
24 <property name="plugin.build.dir" value="build"/>
25 <property name="plugin.src.dir" value="src"/>
26 <!-- this is the directory where the plugin jar is copied to -->
27 <property name="plugin.dist.dir" value="${josm.basedir}/dist"/>
28 <property name="ant.build.javac.target" value="1.5"/>
29 <property name="plugin.dist.dir" value="${josm.basedir}/dist"/>
30 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
31
32 <!--
33 **********************************************************
34 ** init - initializes the build
35 **********************************************************
36 -->
37 <target name="init">
38 <mkdir dir="${plugin.build.dir}"/>
39 </target>
40
41 <!--
42 **********************************************************
43 ** compile - complies the source tree
44 **********************************************************
45 -->
46 <target name="compile" depends="init">
47 <echo message="compiling sources for ${plugin.jar} ... "/>
48 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
49 <compilerarg value="-Xlint:deprecation"/>
50 <compilerarg value="-Xlint:unchecked"/>
51 </javac>
52 </target>
53
54 <!--
55 **********************************************************
56 ** dist - creates the plugin jar
57 **********************************************************
58 -->
59 <target name="dist" depends="compile,revision">
60 <echo message="creating ${plugin.jar.name} ... "/>
61 <copy todir="${plugin.build.dir}/resources">
62 <fileset dir="resources"/>
63 </copy>
64 <copy todir="${plugin.build.dir}/images">
65 <fileset dir="images"/>
66 </copy>
67 <copy todir="${plugin.build.dir}">
68 <fileset dir=".">
69 <include name="README" />
70 <include name="LICENSE" />
71 </fileset>
72 </copy>
73 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
74 <!--
75 ************************************************
76 ** configure these properties. Most of them will be copied to the plugins
77 ** manifest file. Property values will also show up in the list available
78 ** plugins: http://josm.openstreetmap.de/wiki/Plugins.
79 **
80 ************************************************
81 -->
82 <manifest>
83 <attribute name="Author" value="Roland M. Olbricht"/>
84 <attribute name="Plugin-Class" value="public_transport.PublicTransportPlugin"/>
85 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
86 <attribute name="Plugin-Description" value="This plugin simplifies the mapping and editing of public transport routes."/>
87 <attribute name="Plugin-Link" value="http://svn.openstreetmap.org/applications/editors/josm/plugins/public_transport/resources/public_transport.html"/>
88 <attribute name="Plugin-Mainversion" value="2907"/>
89 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
90 </manifest>
91 </jar>
92 </target>
93
94 <!--
95 **********************************************************
96 ** revision - extracts the current revision number for the
97 ** file build.number and stores it in the XML property
98 ** version.*
99 **********************************************************
100 -->
101 <target name="revision">
102
103 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
104 <env key="LANG" value="C"/>
105 <arg value="info"/>
106 <arg value="--xml"/>
107 <arg value="."/>
108 </exec>
109 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
110 <delete file="REVISION"/>
111 </target>
112
113 <!--
114 **********************************************************
115 ** clean - clean up the build environment
116 **********************************************************
117 -->
118 <target name="clean">
119 <delete dir="${plugin.build.dir}"/>
120 <delete file="${plugin.jar}"/>
121 </target>
122
123 <!--
124 **********************************************************
125 ** install - install the plugin in your local JOSM installation
126 **********************************************************
127 -->
128 <target name="install" depends="dist">
129 <property environment="env"/>
130 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
131 <and>
132 <os family="windows"/>
133 </and>
134 </condition>
135 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
136 </target>
137</project>
Note: See TracBrowser for help on using the repository browser.