-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
60 lines (51 loc) · 1.64 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
<?xml version='1.0' encoding='utf-8'?>
<project default="import">
<property name="download_username" value="" />
<property name="download_password" value="" />
<property name="zipfile" value="tmp/archive.zip" />
<target name="import" depends="fetch, extract, touch"/>
<target name="echo">
<echo>download_url=${download_url}</echo>
<echo>download_username=${download_username}</echo>
<echo>download_password=${download_password}</echo>
</target>
<target name="fetch">
<fail unless="download_url">
download_url property is missing. Use an option like -Ddownload_url={URL}.
</fail>
<delete dir="tmp" />
<mkdir dir="tmp" />
<get src="${download_url}" dest="${zipfile}" verbose="true"
username="${download_username}" password="${download_password}" />
</target>
<target name="extract">
<delete dir="extracted" />
<mkdir dir="extracted" />
<unzip src="${zipfile}" dest="extracted" />
</target>
<target name="touch">
<delete dir="imported" />
<mkdir dir="imported" />
<copy todir="imported">
<fileset dir="extracted/archive">
<include name="**/*" />
</fileset>
</copy>
<tstamp>
<format property="touch.time" pattern="yyyy-MM-dd'T'hh:mm:ss" />
</tstamp>
<replaceregexp
match="timestamp=".*""
replace="timestamp="${touch.time}""
byline="true">
<fileset dir="imported">
<include name="**/*.xml" />
</fileset>
</replaceregexp>
</target>
<target name="clean">
<delete dir="extracted" />
<delete dir="imported" />
<delete dir="tmp" />
</target>
</project>