-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
101 lines (85 loc) · 2.78 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
<project name="PROJECT" default="build" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<macrodef name="private-tar">
<attribute name="product"/>
<sequential>
<tar destfile="target/@{product}-bin.tbz2" compression="bzip2">
<tarfileset dir="src/main/sh" filemode="755">
<include name="@{product}.sh" />
</tarfileset>
</tar>
</sequential>
</macrodef>
<macrodef name="private-concat">
<attribute name="product"/>
<sequential>
<concat destfile="target/@{product}">
<filelist dir="target" files="shunarchive"/>
<filelist dir="target" files="@{product}-bin.tbz2"/>
</concat>
<chmod file="target/@{product}" perm="+x"/>
</sequential>
</macrodef>
<macrodef name="shunarchive">
<attribute name="product"/>
<sequential>
<private-tar product="@{product}" />
<private-concat product="@{product}" />
</sequential>
</macrodef>
<macrodef name="private-template">
<attribute name="product"/>
<sequential>
<tar destfile="target/@{product}.tbz2" compression="bzip2" basedir="src/main/resources/template/@{product}" />
</sequential>
</macrodef>
<macrodef name="ivy-publish">
<attribute name="product"/>
<sequential>
<tar destfile="target/@{product}.tbz2" compression="bzip2" basedir="target">
<include name="@{product}"/>
</tar>
<ivy:settings file="src/main/config/ivysettings.xml" />
<ivy:resolve file="src/main/config/ivy-@{product}.xml" />
<ivy:publish resolver="internal" pubrevision="1.0" overwrite="true">
<artifacts pattern="target/[artifact].[ext]" />
</ivy:publish>
<delete file="target/ivy.xml"/>
</sequential>
</macrodef>
<!-- main -->
<target name="build" depends="resolve,extract,PROJECT"/>
<target name="resolve">
<ivy:settings file="src/main/config/ivysettings.xml" />
<ivy:retrieve />
</target>
<target name="check-shunarchive">
<condition property="shunarchive.not.present">
<not>
<available file="target/shunarchive" property="shunarchive.present"/>
</not>
</condition>
</target>
<target name="extract-buildtools" depends="check-shunarchive,resolve" if="shunarchive.not.present">
<untar src="lib/buildtools-1.0.tbz2" compression="bzip2" dest="target"/>
</target>
<target name="extract" depends="extract-buildtools"/>
<target name="clean">
<delete dir="target/myproject"/>
<delete>
<fileset dir="target">
<include name="*.tbz2"/>
<include name="*.py"/>
<include name="*.pyc"/>
<include name=".history"/>
<include name="shunarchive"/>
<include name="PROJECT"/>
</fileset>
</delete>
</target>
<!-- products -->
<target name="PROJECT" depends="extract">
</target>
<target name="publish" depends="build">
<ivy-publish product="PROJECT"/>
</target>
</project>