forked from gidema/josm-ods-bag
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
138 lines (132 loc) · 6.18 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
<?xml version="1.0" encoding="utf-8"?>
<project name="ods-bag" 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" />
<tstamp>
<format property="plugin.date" pattern="yyyy-MM-dd'T'HH:mm:ss'Z'" />
</tstamp>
<artifact:pom id="mypom" file="pom.xml" />
<!-- 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.bag.BagImportPlugin"/>
<property name="plugin.version" value="${mypom.version}"/>
<property name="plugin.build.dir" value="build" />
<property name="plugin.src.dir" value="src" />
<!-- this is the directory where the plugin jar is copied to -->
<property name="maven.target.dir" value="${mypom.build.directory}" />
<property name="plugin.dist.dir" value="dist" />
<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="org.jdom" artifactId="jdom2" version="2.0.4"/>
</artifact:dependencies>
</target>
<!--
**********************************************************
** dist - creates the 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>
<jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
<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="Import buildings and addresses in The Netherlands from the BAG 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;opendataservices"/>
<attribute name="Plugin-Stage" value="45"/>
</manifest>
</jar>
</target>
<!--
**********************************************************
** clean - clean up the build environment
**********************************************************
-->
<target name="clean">
<delete dir="${plugin.build.dir}" />
<delete file="${plugin.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>
<!--
**********************************************************
** 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 for debugging ... " />
<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}">
<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="Import buildings and addresses in The Netherlands from the BAG 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;opendataservices"/>
<attribute name="Plugin-Stage" value="45"/>
</manifest>
</jar>
</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>