-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathbuild.xml
145 lines (119 loc) · 4.98 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
139
140
141
142
143
144
<?xml version="1.0"?>
<project name="eir.release.sf" default="package" basedir=".">
<!-- Components Versions -->
<property name="release.version" value="1.0.0" />
<property name="eir.version" value="1.0.0-SNAPSHOT" />
<property name="protocols.build.list" value="parent,m3ua,mtp,isup,sccp,tcap,map" />
<property name="protocols.copy.list" value="m3ua,mtp,isup,sccp,tcap,map" />
<!-- Directories Configuration -->
<property name="checkout.basedir" value="../" />
<property name="zip.dir" value="${basedir}/zip" />
<property name="zip.file.destination.dir" value="${basedir}/upload" />
<property name="zip.file.name" value="restcomm-eir-${release.version}" />
<property name="failoncopy" value="true" />
<property name="test.skip" value="true" />
<!-- Definition -->
<property name="release.name" value="release-1.0.0" />
<property environment="sys" />
<condition property="mvn.executable" value="${sys.M2_HOME}\bin\mvn.bat" else="mvn">
<os family="windows" />
</condition>
<taskdef onerror="fail" resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="${ss7.release.sf}/../ant-contrib-1.0b3.jar" />
</classpath>
</taskdef>
<target name="init">
<echo message="Java Version: ${java.version}" />
<echo message="Java home: ${java.home}" />
<fail message="Unsupported Java version: ${java.version}. Make sure that the version of the Java compiler is 1.7 (7.0) or greater.">
<condition>
<not>
<or>
<contains string="${java.version}" substring="1.7" casesensitive="false" />
</or>
</not>
</condition>
</fail>
</target>
<target name="checkout" description="Checks out src and downloads everything that is required." depends="checkout-sources" />
<target name="build" description="Builds components sources and everything associated." depends="build-sources-eir" />
<target name="copy" depends="copy-eir" />
<target name="package" description="Builds binary package." depends="init,zip.src,notes,copy,zip.binary" />
<target name="clean">
<echo>Cleaning checkout directory</echo>
<delete dir="${ant.file.eir.release.sf}/../${checkout.basedir}" verbose="false" />
<echo>Cleaning work directory</echo>
<delete dir="${zip.dir}" verbose="false" />
<echo>Cleaning upload directory</echo>
<delete dir="${zip.file.destination.dir}" verbose="false" />
</target>
<target name="checkout-sources">
<echo>Checking out sources</echo>
<mkdir dir="${checkout.basedir}" />
<exec executable="${mvn.executable}" dir="${ant.file.restcomm.release}/../">
<arg line="validate -P checkout -Dcheckout.dir=${checkout.basedir}" />
</exec>
</target>
<target name="build-sources-eir">
<echo>Build EIR</echo>
<exec executable="${mvn.executable}" dir="${checkout.basedir}/eir">
<arg line="-f pom.xml install -P release -Dmaven.test.skip=${test.skip} -Drelease.name=${release.name} -Dhttp.proxyHost=${http.proxyHost} -Dhttp.proxyPort=${http.proxyPort}" />
</exec>
</target>
<target name="notes">
<copy todir="${zip.dir}" file="${basedir}/README.TXT" failonerror="${failoncopy}">
<filterchain>
<replacetokens>
<token key="VERSION" value="${release.version}" />
</replacetokens>
</filterchain>
</copy>
</target>
<target name="copy-eir">
<echo>Copy EIR Server</echo>
<copy todir="${zip.dir}/eir/restcomm-eir-server" failonerror="${failoncopy}">
<fileset dir="${checkout.basedir}/core//bootstrap/target/restcomm-eir-server">
<include name="**" />
</fileset>
</copy>
<echo>Copy EIR SLEE part</echo>
<copy todir="${zip.dir}/eir/slee" failonerror="${failoncopy}">
<fileset dir="${checkout.basedir}/core/slee/services/du/target/">
<include name="eir-service-du-${eir.version}.jar" />
</fileset>
</copy>
<echo>Copy Docs</echo>
<copy todir="${zip.dir}/eir/docs" failonerror="${failoncopy}">
<fileset dir="${checkout.basedir}/docs/jdocbook-restcomm/target/docbook/publish">
<include name="**" />
</fileset>
</copy>
<echo>Copy Build File</echo>
<copy file="${checkout.basedir}/release/release-build.xml" tofile="${zip.dir}/eir/build.xml" failonerror="${failoncopy}" />
</target>
<target name="zip.binary">
<zip destfile="${zip.file.destination.dir}/${zip.file.name}.zip">
<zipfileset dir="${zip.dir}" excludes="zip">
</zipfileset>
</zip>
<antcall target="checksum">
<param name="source.file" value="${zip.file.destination.dir}/${zip.file.name}.zip" />
<param name="algorithm" value="sha1" />
</antcall>
</target>
<target name="zip.src">
<mkdir dir="${zip.file.destination.dir}" />
<zip destfile="${zip.file.destination.dir}/${zip.file.name}-src.zip">
<zipfileset dir="${checkout.basedir}" excludes="zip">
</zipfileset>
</zip>
<antcall target="checksum">
<param name="source.file" value="${zip.file.destination.dir}/${zip.file.name}-src.zip" />
<param name="algorithm" value="sha1" />
</antcall>
</target>
<target name="checksum">
<checksum file="${source.file}" algorithm="${algorithm}" fileext=".${algorithm}.asc" forceOverwrite="yes" />
</target>
</project>