forked from gidema/josm-openservices
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
190 lines (184 loc) · 7.99 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<?xml version="1.0" encoding="utf-8"?>
<!--
** This is a template build file for a JOSM plugin.
**
** Maintaining versions
** ====================
** see README.template
**
** Usage
** =====
** To build it run
**
** > ant dist
**
** To install the generated plugin locally (in you default plugin directory) run
**
** > ant install
**
** The generated plugin jar is not automatically available in JOSMs plugin configuration
** dialog. You have to check it in first.
**
** Use the ant target 'publish' to check in the plugin and make it available to other
** JOSM users:
** set the properties commit.message and plugin.main.version
** and run
** > ant publish
**
**
-->
<project name="opendataservices" default="dist" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<path id="maven-ant-tasks.classpath" path="lib/maven-ant-tasks-2.1.3.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="antlib:org.apache.maven.artifact.ant" classpathref="maven-ant-tasks.classpath" />
<artifact:pom id="mypom" file="pom.xml" />
<tstamp>
<format property="plugin.date" pattern="yyyy-MM-dd'T'HH:mm:ss'Z'" />
</tstamp>
<!-- enter the SVN commit message -->
<property name="commit.message" value="Commit message" />
<!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
<property name="plugin.main.version" value="${mypom.properties.josm.version}" />
<property name="plugin.class" value="org.openstreetmap.josm.plugins.ods.OpenDataServicesPlugin" />
<property name="plugin.version" value="${mypom.version}" />
<property name="plugin.build.dir" value="build/deploy" />
<property name="maven.target.dir" value="${mypom.build.directory}" />
<property name="plugin.src.dir" value="src/main/java" />
<!-- this is the directory where the plugin jar is copied to -->
<property name="plugin.dist.dir" value="dist/deploy" />
<property name="ant.build.javac.target" value="1.8" />
<property name="ant.build.javac.source" value="1.8" />
<property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar" />
<!-- Debugging -->
<property name="plugin.debug.build.dir" value="build/debug" />
<property name="plugin.debug.dist.dir" value="dist/debug" />
<property name="plugin.debug.jar" value="${plugin.debug.dist.dir}/${ant.project.name}.jar" />
<!--
**********************************************************
** init - initializes the build
**********************************************************
-->
<target name="init" depends="clean">
<mkdir dir="${plugin.build.dir}"/>
<mkdir dir="${plugin.debug.build.dir}"/>
<artifact:dependencies filesetId="dependency.fileset">
<dependency groupId="commons-lang" artifactId="commons-lang" version="2.6"/>
<dependency groupId="org.osgeo" artifactId="proj4j" version="0.1.0"/>
</artifact:dependencies>
</target>
<!--
**********************************************************
** dist - creates the plugin jar
**********************************************************
-->
<target name="dist" depends="init">
<echo message="creating ${ant.project.name}.jar ... " />
<copy todir="${plugin.build.dir}">
<fileset dir="${maven.target.dir}/classes" />
</copy>
<unjar dest="${plugin.build.dir}">
<fileset file="${commons-lang:commons-lang:jar}" />
<fileset file="${org.osgeo:proj4j:jar}" />
<patternset>
<exclude name="META-INF/ECLIPSEF.*"/>
</patternset>
</unjar>
<jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
<!--
************************************************
** configure these properties. Most of them will be copied to the plugins
** manifest file. Property values will also show up in the list available
** plugins: http://josm.openstreetmap.de/wiki/Plugins.
**
************************************************
-->
<manifest>
<attribute name="Author" value="Gertjan Idema <[email protected]>" />
<attribute name="Plugin-Class" value="${plugin.class}" />
<attribute name="Plugin-Date" value="${plugin.date}" />
<attribute name="Plugin-Description" value="The OpenServices plugin provides a framework for downloading geo data from webservices like WFS" />
<attribute name="Plugin-Icon" value="images/wfs.png" />
<!--<attribute name="Plugin-Link" value="http://fixme.com"/>-->
<attribute name="Plugin-Mainversion" value="${plugin.main.version}" />
<attribute name="Plugin-Version" value="${plugin.version}" />
<attribute name="Plugin-Requires" value="geotools-wfs" />
<attribute name="Plugin-Stage" value="40" />
</manifest>
</jar>
</target>
<!--
**********************************************************
** dist4debug - creates the debug plugin jar
**********************************************************
-->
<target name="dist4debug" depends="init">
<tstamp>
<format property="time" pattern="yyyy-MM-dd'T'hh:mm:ss'Z'" />
</tstamp>
<echo message="creating ${ant.project.name}.jar ... " />
<copy todir="${plugin.debug.build.dir}">
<fileset dir="${maven.target.dir}/classes/">
<filename name="./*.txt"/>
</fileset>
</copy>
<jar destfile="${plugin.debug.jar}" basedir="${plugin.debug.build.dir}">
<!--
************************************************
** configure these properties. Most of them will be copied to the plugins
** manifest file. Property values will also show up in the list available
** plugins: http://josm.openstreetmap.de/wiki/Plugins.
**
************************************************
-->
<manifest>
<attribute name="Author" value="Gertjan Idema <[email protected]>" />
<attribute name="Plugin-Class" value="${plugin.class}" />
<attribute name="Plugin-Date" value="${plugin.date}" />
<attribute name="Plugin-Description" value="The OpenServices plugin provides a framework for downloading geo data from webservices like WFS" />
<attribute name="Plugin-Icon" value="images/wfs.png" />
<!--<attribute name="Plugin-Link" value="http://fixme.com"/>-->
<attribute name="Plugin-Mainversion" value="${plugin.main.version}" />
<attribute name="Plugin-Version" value="${plugin.version}" />
<attribute name="Plugin-Stage" value="40" />
<!--<attribute name="Plugin-Requires" value="geotools"/>-->
</manifest>
</jar>
</target>
<!--
**********************************************************
** clean - clean up the build environment
**********************************************************
-->
<target name="clean">
<delete dir="${plugin.build.dir}" />
<delete file="${plugin.jar}" />
<delete file="${plugin.debug.jar}" />
</target>
<!--
**********************************************************
** install - install the plugin in your local JOSM installation
**********************************************************
-->
<target name="install" depends="dist">
<property environment="env" />
<condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
<and>
<os family="windows" />
</and>
</condition>
<copy file="${plugin.jar}" todir="${josm.plugins.dir}" />
</target>
<!--
**********************************************************
** install4debug - install the debug plugin in the JOSM debug environment
**********************************************************
-->
<target name="install4debug" depends="dist4debug">
<property environment="env" />
<condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM_ECLIPSE_ODS6/plugins" else="${user.home}/.josm_eclipse_ods6/plugins">
<and>
<os family="windows" />
</and>
</condition>
<copy file="${plugin.debug.jar}" todir="${josm.plugins.dir}" />
</target>
</project>