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="02_smed_about" basedir=".">
|
---|
31 |
|
---|
32 | <!-- enter the SVN commit message -->
|
---|
33 | <property name="commit.message" value="New release" />
|
---|
34 | <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
|
---|
35 | <property name="plugin.main.version" value="3329" />
|
---|
36 |
|
---|
37 |
|
---|
38 | <!--
|
---|
39 | ************************************************
|
---|
40 | ** should not be necessary to change the following properties
|
---|
41 | -->
|
---|
42 | <property name="josm" location="../../core/dist/josm-custom.jar"/>
|
---|
43 | <property name="smed" location="../../dist/smed.jar/"/>
|
---|
44 | <property name="plugin.build.dir" value="build"/>
|
---|
45 | <property name="plugin.src.dir" value="src"/>
|
---|
46 | <property name="smed.build.dir" value="../smed/build"/>
|
---|
47 | <property name="smed.src.dir" value="../smed/src"/>
|
---|
48 | <property name="smed.plugins" value="../smed/plugins"/>
|
---|
49 | <!-- this is the directory where the plugin jar is copied to -->
|
---|
50 | <property name="plugin.dist.dir" value="../../dist"/>
|
---|
51 | <property name="ant.build.javac.target" value="1.5"/>
|
---|
52 | <property name="plugin.dist.dir" value="../../dist"/>
|
---|
53 | <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
|
---|
54 | <property name="smed.jar" value="${plugin.dist.dir}/smed.jar"/>
|
---|
55 |
|
---|
56 | <!--
|
---|
57 | **********************************************************
|
---|
58 | ** init - initializes the build
|
---|
59 | **********************************************************
|
---|
60 | -->
|
---|
61 | <target name="init">
|
---|
62 | <mkdir dir="${plugin.build.dir}"/>
|
---|
63 | </target>
|
---|
64 | <!--
|
---|
65 | **********************************************************
|
---|
66 | ** init_smed - initializes the build of smed
|
---|
67 | **********************************************************
|
---|
68 | -->
|
---|
69 | <target name="init_smed">
|
---|
70 | <mkdir dir="${smed.build.dir}"/>
|
---|
71 | </target>
|
---|
72 |
|
---|
73 | <!--
|
---|
74 | **********************************************************
|
---|
75 | ** compile_smed - compiles the source tree of smed
|
---|
76 | **********************************************************
|
---|
77 | -->
|
---|
78 | <target name="compile_smed" depends="init_smed">
|
---|
79 | <echo message="compiling sources for ${smed.jar} ... "/>
|
---|
80 | <javac srcdir="${smed.src.dir}" classpath="${josm}" debug="true" destdir="${smed.build.dir}">
|
---|
81 | <compilerarg value="-Xlint:deprecation"/>
|
---|
82 | <compilerarg value="-Xlint:unchecked"/>
|
---|
83 | </javac>
|
---|
84 | </target>
|
---|
85 |
|
---|
86 | <!--
|
---|
87 | **********************************************************
|
---|
88 | ** compile - complies the source tree
|
---|
89 | **********************************************************
|
---|
90 | -->
|
---|
91 | <target name="compile" depends="init,dist_smed">
|
---|
92 | <echo message="compiling sources for ${plugin.jar} ... "/>
|
---|
93 | <javac srcdir="src" classpath="${josm}:${smed}" debug="true" destdir="${plugin.build.dir}">
|
---|
94 | <compilerarg value="-Xlint:deprecation"/>
|
---|
95 | <compilerarg value="-Xlint:unchecked"/>
|
---|
96 | </javac>
|
---|
97 | </target>
|
---|
98 |
|
---|
99 | <!--
|
---|
100 | **********************************************************
|
---|
101 | ** dist_smed - creates smed.jar
|
---|
102 | **********************************************************
|
---|
103 | -->
|
---|
104 | <target name="dist_smed" depends="compile_smed">
|
---|
105 | <echo message="creating smed.jar ... "/>
|
---|
106 |
|
---|
107 | <copy todir="${smed.build.dir}/images">
|
---|
108 | <fileset dir="${smed.src.dir}/images"/>
|
---|
109 | </copy>
|
---|
110 |
|
---|
111 | <copy todir="${smed.build.dir}/images">
|
---|
112 | <fileset dir="../smed/images"/>
|
---|
113 | </copy>
|
---|
114 |
|
---|
115 | <copy todir="${smed.build.dir}/smed/msg">
|
---|
116 | <fileset dir="${smed.src.dir}/smed/msg"/>
|
---|
117 | </copy>
|
---|
118 |
|
---|
119 | <copy todir="${smed.build.dir}">
|
---|
120 | <fileset dir="../smed">
|
---|
121 | <include name="copyright.txt" />
|
---|
122 | <include name="LICENSE.txt" />
|
---|
123 | </fileset>
|
---|
124 | </copy>
|
---|
125 |
|
---|
126 | <jar destfile="${smed.jar}" basedir="${smed.build.dir}">
|
---|
127 | <!--
|
---|
128 | ************************************************
|
---|
129 | ** configure these properties. Most of them will be copied to the plugins
|
---|
130 | ** manifest file. Property values will also show up in the list available
|
---|
131 | ** plugins: http://josm.openstreetmap.de/wiki/Plugins.
|
---|
132 | **
|
---|
133 | ************************************************
|
---|
134 | -->
|
---|
135 | <manifest>
|
---|
136 | <attribute name="Author" value="Werner, Malcolm"/>
|
---|
137 | <attribute name="Plugin-Class" value="smed.Smed"/>
|
---|
138 | <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
|
---|
139 | <attribute name="Plugin-Description" value="Create and edit seamaps for OpenSeaMap"/>
|
---|
140 | <attribute name="Plugin-Icon" value="images/Smed.png"/>
|
---|
141 | <attribute name="Plugin-Link" value="http://openseamap.org/"/>
|
---|
142 | <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
|
---|
143 | <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
|
---|
144 | </manifest>
|
---|
145 | </jar>
|
---|
146 | </target>
|
---|
147 |
|
---|
148 | <!--
|
---|
149 | **********************************************************
|
---|
150 | ** dist - creates the plugin jar
|
---|
151 | **********************************************************
|
---|
152 | -->
|
---|
153 | <target name="dist" depends="compile">
|
---|
154 | <echo message="creating ${ant.project.name}.jar ... "/>
|
---|
155 |
|
---|
156 | <copy todir="${plugin.build.dir}/images">
|
---|
157 | <fileset dir="${plugin.src.dir}/images"/>
|
---|
158 | </copy>
|
---|
159 |
|
---|
160 | <copy todir="${plugin.build.dir}/images">
|
---|
161 | <fileset dir="images"/>
|
---|
162 | </copy>
|
---|
163 | <copy todir="${plugin.build.dir}/smed_ex/msg">
|
---|
164 | <fileset dir="${plugin.src.dir}/smed_about/msg"/>
|
---|
165 | </copy>
|
---|
166 | <copy todir="${plugin.build.dir}">
|
---|
167 | <fileset dir=".">
|
---|
168 | <include name="copyright.txt" />
|
---|
169 | <include name="LICENSE.txt" />
|
---|
170 | </fileset>
|
---|
171 | </copy>
|
---|
172 | <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
|
---|
173 | <!--
|
---|
174 | ************************************************
|
---|
175 | ** configure these properties. Most of them will be copied to the plugins
|
---|
176 | ** manifest file. Property values will also show up in the list available
|
---|
177 | ** plugins: http://josm.openstreetmap.de/wiki/Plugins.
|
---|
178 | **
|
---|
179 | ************************************************
|
---|
180 | -->
|
---|
181 | <manifest>
|
---|
182 | <attribute name="Author" value="Werner, Malcolm"/>
|
---|
183 | <attribute name="Plugin-Class" value="smed_ex.impl.SmedExImpl"/>
|
---|
184 | <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
|
---|
185 | <attribute name="Plugin-Description" value="Plugin for Seamap Editor"/>
|
---|
186 | <attribute name="Plugin-Icon" value="images/Smed.png"/>
|
---|
187 | <attribute name="Plugin-Link" value="http://openseamap.org/"/>
|
---|
188 | <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
|
---|
189 | <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
|
---|
190 | <attribute name="Class-Path" value="./tplug/ifc.jar"/>
|
---|
191 | </manifest>
|
---|
192 | </jar>
|
---|
193 |
|
---|
194 | <copy file="${plugin.jar}" todir="${smed.plugins}"/>
|
---|
195 |
|
---|
196 | </target>
|
---|
197 |
|
---|
198 | <!--
|
---|
199 | **********************************************************
|
---|
200 | ** clean - clean up the build environment
|
---|
201 | **********************************************************
|
---|
202 | -->
|
---|
203 | <target name="clean">
|
---|
204 | <delete dir="${plugin.build.dir}"/>
|
---|
205 | <delete file="${plugin.jar}"/>
|
---|
206 | <delete dir="${smed.build.dir}"/>
|
---|
207 | <delete file="${smed.jar}"/>
|
---|
208 | </target>
|
---|
209 |
|
---|
210 | <!--
|
---|
211 | **********************************************************
|
---|
212 | ** install - install the plugin in your local JOSM installation
|
---|
213 | **********************************************************
|
---|
214 | -->
|
---|
215 | <target name="install" depends="dist">
|
---|
216 | <property environment="env"/>
|
---|
217 | <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins/splug" else="${user.home}/.josm/plugins/splug">
|
---|
218 | <and>
|
---|
219 | <os family="windows"/>
|
---|
220 | </and>
|
---|
221 | </condition>
|
---|
222 | <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
|
---|
223 | </target>
|
---|
224 |
|
---|
225 |
|
---|
226 | </project>
|
---|