-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
101 lines (88 loc) · 3.9 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
<?xml version="1.0" encoding="UTF-8" ?>
<project name="" default="all" basedir=".">
<property name="version" value="2.10.0" />
<property name="leaflet-version" value="1.5.1" />
<property name="yui-version" value="2.4.8" />
<property name="pluginname" value="Osm_akuechler" />
<property name="dwn-folder" value="downloads" />
<property name="dist-folder" value="dist" />
<property name="build-folder" value="${dist-folder}/build" />
<property name="yui-url" value="https://repo1.maven.org/maven2/com/yahoo/platform/yui/yuicompressor/${yui-version}/yuicompressor-${yui-version}.jar" />
<property name="leaflet-url" value="https://repo1.maven.org/maven2/org/webjars/npm/leaflet/${leaflet-version}/leaflet-${leaflet-version}.jar" />
<property name="leaflet-license" value="https://cdn.jsdelivr.net/gh/Leaflet/Leaflet@${leaflet-version}/LICENSE" />
<available file="${dwn-folder}/yuicompressor-${yui-version}.jar" property="exists.yui" />
<available file="${dwn-folder}/leaflet-${leaflet-version}.jar" property="exists.leaflet" />
<available file="${dwn-folder}/leaflet-license-${leaflet-version}" property="exists.leaflet-license" />
<!--
<property name="proxy.port" value="8080"/>
<property name="proxy.host" value="proxy"/>
<property name="proxy.user" value=""/>
<property name="proxy.pass" value=""/>
<setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
proxyuser="${proxy.user}" proxypassword="${proxy.pass}"/>
-->
<target name="clean">
<delete dir="${dist-folder}" />
<delete dir="${build-folder}" />
</target>
<target name="prepare">
<mkdir dir="${dist-folder}" />
<mkdir dir="${build-folder}" />
<mkdir dir="${dwn-folder}" />
</target>
<target name="dwnyui" unless="exists.yui">
<get src="${yui-url}" dest="${dwn-folder}/yuicompressor-${yui-version}.jar" />
</target>
<target name="dwnleaflet" unless="exists.leaflet">
<get src="${leaflet-url}" dest="${dwn-folder}/leaflet-${leaflet-version}.jar" />
</target>
<target name="dwnleafletlicense" unless="exists.leaflet-license">
<get src="${leaflet-license}" dest="${dwn-folder}/leaflet-license-${leaflet-version}" />
</target>
<target name="pack" depends="prepare,build">
<zip destfile="${dist-folder}/${pluginname}_${version}.zip" basedir="${build-folder}" />
</target>
<target name="build" depends="prepare, dwnleaflet, dwnleafletlicense, dwnyui">
<unjar src="${dwn-folder}/leaflet-${leaflet-version}.jar" dest="${dist-folder}/leaflet/">
<patternset>
<include name="META-INF/resources/webjars/leaflet/${leaflet-version}/**" />
</patternset>
<cutdirsmapper dirs="5" />
</unjar>
<copy todir="${build-folder}/leaflet">
<fileset dir="${dist-folder}/leaflet/dist">
<include name="**" />
</fileset>
</copy>
<copy todir="${build-folder}">
<fileset dir="${basedir}">
<include name="licenses/**" />
<include name="css/**" />
<include name="js/**" />
<include name="${pluginname}.php" />
<include name="${pluginname}.xml" />
<include name="index.html" />
</fileset>
</copy>
<copy todir="${build-folder}/licenses">
<fileset dir="${dwn-folder}">
<include name="leaflet-license-${leaflet-version}"/>
</fileset>
</copy>
<replace file="${build-folder}/${pluginname}.xml" token="@version@" value="${version}" />
<replace file="${build-folder}/${pluginname}.php" token="@leaflet-version@" value="${leaflet-version}" />
<java fork="true" jar="${dwn-folder}/yuicompressor-${yui-version}.jar">
<arg line="-v"/>
<arg line="-o ${build-folder}/js/${pluginname}.min.js"/>
<arg line="${build-folder}/js/${pluginname}.js" />
<arg line="--charset utf-8" />
</java>
<java fork="true" jar="${dwn-folder}/yuicompressor-${yui-version}.jar">
<arg line="-v"/>
<arg line="-o ${build-folder}/css/${pluginname}.min.css"/>
<arg line="${build-folder}/css/${pluginname}.css" />
<arg line="--charset utf-8" />
</java>
</target>
<target name="all" depends="clean,pack" />
</project>