forked from Zimbra/zm-mailbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
116 lines (98 loc) · 4.96 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
<project name="zm-mailbox" default="all">
<target name="all" depends="publish-local-all">
<ant dir="./native" target="generate-native-headers" inheritAll="true"/>
<exec dir="./native" executable="make" failonerror="true"/>
<ant dir="./store" target="war" inheritAll="true"/>
<ant dir="./store" target="create-version-sql" inheritAll="true"/>
<ant dir="./store" target="create-version-ldap" inheritAll="true"/>
<ant dir="./store-conf" target="common-passwords" inheritAll="true"/>
</target>
<target name="publish-local-all">
<ant dir="./native" target="publish-local" inheritAll="true"/>
<ant dir="./common" target="publish-local" inheritAll="true"/>
<ant dir="./soap" target="publish-local" inheritAll="true"/>
<ant dir="./client" target="publish-local" inheritAll="true"/>
<ant dir="./store" target="publish-local" inheritAll="true"/>
<ant dir="./store" target="set-dev-version" inheritAll="true"/>
<echo>Starting package creation from war </echo>
</target>
<target name="set-no-halt-on-failure">
<echo message="WARNING: IGNORING UNIT TEST FAILURES"/>
<property name="halt-on-failure" value="no"/>
</target>
<target name="set-halt-on-failure">
<property name="halt-on-failure" value="yes"/>
</target>
<target name="test-all-plough-through" depends="set-no-halt-on-failure,test-all"/>
<target name="test-all" unless="skipTests" depends="set-halt-on-failure,publish-local-all">
<mkdir dir="${basedir}/build/zimbra"/>
<mkdir dir="${basedir}/build/zimbra/conf"/>
<copy file="${basedir}/store-conf/conf/antisamy.xml" todir="${basedir}/build/zimbra/conf/"/>
<copy file="${basedir}/store-conf/conf/owasp_policy.xml" todir="${basedir}/build/zimbra/conf/"/>
<property name="test-results-file" value="${basedir}/build/test-results.txt"/>
<echo file="${test-results-file}" message="BEGIN
" />
<ant dir="./native" target="test" inheritAll="true"/>
<ant dir="./common" target="test" inheritAll="true"/>
<ant dir="./soap" target="test" inheritAll="true"/>
<ant dir="./client" target="test" inheritAll="true"/>
<ant dir="./store" target="test" inheritAll="true"/>
<echo append="true" file="${test-results-file}" message="END
" />
</target>
<target name="dist">
<ant dir="./native" target="dist" inheritAll="false"/>
<ant dir="./common" target="dist" inheritAll="false"/>
<ant dir="./soap" target="dist" inheritAll="false"/>
<ant dir="./client" target="dist" inheritAll="false"/>
<ant dir="./store" target="dist" inheritAll="false"/>
</target>
<!-- Code added to parse regex provided in version zimbra.buildinfo.version -->
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="${user.home}/.zcs-deps/ant-contrib-1.0b1.jar"/>
</classpath>
</taskdef>
<propertyregex property="zimbra.buildinfo.majorversion"
input="${zimbra.buildinfo.version}"
regexp="([0-9]+)\.([0-9]+)\.([0-9]+)"
select="\1"
casesensitive="false" />
<propertyregex property="zimbra.buildinfo.minorversion"
input="${zimbra.buildinfo.version}"
regexp="([0-9]+)\.([0-9]+)\.([0-9]+)"
select="\2"
casesensitive="false" />
<propertyregex property="zimbra.buildinfo.microversion"
input="${zimbra.buildinfo.version}"
regexp="([0-9]+)\.([0-9]+)\.([0-9]+)"
select="\3"
casesensitive="false" />
<!-- Property defined to accept the version -->
<property name="store.ext.patch.revision" value="1" />
<property name="store.ext.patch.version"
value="${zimbra.buildinfo.majorversion}.${zimbra.buildinfo.minorversion}.${zimbra.buildinfo.microversion}"/>
<!--Package building starts here from the war files -->
<target name="pkg" depends="clean-pkg,all,dist">
<exec dir="." executable="./pkg-builder.pl" failonerror="true">
<arg value="-v"/>
<arg value="${store.ext.patch.version}"/>
<arg value="-r"/>
<arg value="${store.ext.patch.revision}"/>
</exec>
</target>
<target name="pkg-after-plough-through-tests" depends="test-all-plough-through,pkg"/>
<target name="clean" depends="clean-ant,clean-pkg">
<exec dir="./native" executable="make" failonerror="true"><arg value="clean"/></exec>
<delete dir="build"/>
</target>
<target name="clean-ant">
<ant dir="./native" target="clean" inheritAll="false"/>
<ant dir="./common" target="clean" inheritAll="false"/>
<ant dir="./soap" target="clean" inheritAll="false"/>
<ant dir="./client" target="clean" inheritAll="false"/>
<ant dir="./store" target="clean" inheritAll="false"/>
</target>
<target name="clean-pkg">
<delete dir="build/dist"/>
<delete dir="build/stage"/>
</target>
</project>