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

Last change on this file since 28036 was 28014, checked in by akks, 13 years ago

fixes due to core UrlLabel changes

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="plugin.main.version" value="5053"/>
24 <property name="josm" location="${josm.basedir}/core/dist/josm-custom.jar"/>
25 <property name="plugin.build.dir" value="build"/>
26 <property name="plugin.src.dir" value="src"/>
27 <!-- this is the directory where the plugin jar is copied to -->
28 <property name="plugin.dist.dir" value="${josm.basedir}/dist"/>
29 <property name="ant.build.javac.target" value="1.5"/>
30 <property name="plugin.dist.dir" value="${josm.basedir}/dist"/>
31 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
32 <!--
33 **********************************************************
34 ** init - initializes the build
35 **********************************************************
36 -->
37 <target name="init">
38 <mkdir dir="${plugin.build.dir}"/>
39 </target>
40 <!--
41 **********************************************************
42 ** compile - complies the source tree
43 **********************************************************
44 -->
45 <target name="compile" depends="init">
46 <echo message="compiling sources for ${plugin.jar} ... "/>
47 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
48 <compilerarg value="-Xlint:deprecation"/>
49 <compilerarg value="-Xlint:unchecked"/>
50 </javac>
51 </target>
52 <!--
53 **********************************************************
54 ** dist - creates the plugin jar
55 **********************************************************
56 -->
57 <target name="dist" depends="compile,revision">
58 <echo message="creating ${ant.project.name}.jar ... "/>
59 <copy todir="${plugin.build.dir}/resources">
60 <fileset dir="resources"/>
61 </copy>
62 <copy todir="${plugin.build.dir}/images">
63 <fileset dir="images"/>
64 </copy>
65 <copy todir="${plugin.build.dir}/data">
66 <fileset dir="data"/>
67 </copy>
68 <copy todir="${plugin.build.dir}">
69 <fileset dir=".">
70 <include name="README"/>
71 <include name="LICENSE"/>
72 </fileset>
73 </copy>
74 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
75 <!--
76 ************************************************
77 ** configure these properties. Most of them will be copied to the plugins
78 ** manifest file. Property values will also show up in the list available
79 ** plugins: http://josm.openstreetmap.de/wiki/Plugins.
80 **
81 ************************************************
82 -->
83 <manifest>
84 <attribute name="Author" value="Roland M. Olbricht"/>
85 <attribute name="Plugin-Class" value="public_transport.PublicTransportPlugin"/>
86 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
87 <attribute name="Plugin-Description" value="This plugin simplifies the mapping and editing of public transport routes."/>
88 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/public_transport"/>
89 <attribute name="Plugin-Mainversion" value="4980"/>
90 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
91 </manifest>
92 </jar>
93 </target>
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 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
103 <env key="LANG" value="C"/>
104 <arg value="info"/>
105 <arg value="--xml"/>
106 <arg value="."/>
107 </exec>
108 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
109 <delete file="REVISION"/>
110 </target>
111 <!--
112 **********************************************************
113 ** clean - clean up the build environment
114 **********************************************************
115 -->
116 <target name="clean">
117 <delete dir="${plugin.build.dir}"/>
118 <delete file="${plugin.jar}"/>
119 </target>
120 <!--
121 **********************************************************
122 ** install - install the plugin in your local JOSM installation
123 **********************************************************
124 -->
125 <target name="install" depends="dist">
126 <property environment="env"/>
127 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
128 <and>
129 <os family="windows"/>
130 </and>
131 </condition>
132 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
133 </target>
134</project>
Note: See TracBrowser for help on using the repository browser.