PageRenderTime 11ms CodeModel.GetById 2ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 1ms

/protocols/ss7/release/build.xml

http://mobicents.googlecode.com/
XML | 208 lines | 174 code | 30 blank | 4 comment | 0 complexity | 197045b475eb1f1f92fef2cd5c33a5e0 MD5 | raw file
  1<?xml version="1.0"?>
  2<project name="ss7.release.sf" default="package" basedir=".">
  3
  4	<!-- Components Versions -->
  5	<property name="release.version" value="2.0.0-SNAPSHOT" />
  6
  7	<property name="ss7.version" value="2.0.0-SNAPSHOT" />
  8
  9
 10	<property name="asn.version" value="1.0.0.CR1" />
 11	<property name="stream.version" value="1.0.0.CR1" />
 12	
 13
 14	<property name="protocols.build.list" value="parent,m3ua,mtp,isup,sccp,tcap,map" />
 15	<property name="protocols.copy.list" value="m3ua,mtp,isup,sccp,tcap,map" />
 16
 17	<!-- Directories Configuration -->
 18	<property name="checkout.basedir" value="checkout" />
 19	<property name="zip.dir" value="${basedir}/zip" />
 20	<property name="zip.file.destination.dir" value="${basedir}/upload" />
 21	<property name="zip.file.name" value="mobicents-ss7-${release.version}" />
 22	<property name="failoncopy" value="true" />
 23	<property name="test.skip" value="true" />
 24	<!-- Definition -->
 25
 26	<property name="release.name" value="SNAPSHOT" />
 27
 28	<property environment="sys" />
 29	<condition property="mvn.executable" value="${sys.M2_HOME}\bin\mvn.bat" else="mvn">
 30		<os family="windows" />
 31	</condition>
 32
 33	<taskdef onerror="fail" resource="net/sf/antcontrib/antlib.xml">
 34		<classpath>
 35			<pathelement location="${ss7.release.sf}/../ant-contrib-1.0b3.jar" />
 36		</classpath>
 37	</taskdef>
 38
 39	<target name="init" >
 40	    <echo message="Java Version: ${java.version}"/> 
 41	    <echo message="Java home: ${java.home}"/> 
 42	    <fail message="Unsupported Java version: ${java.version}. Make sure that the version of the Java compiler is 1.7 (7.0) or greater."> 
 43		<condition> 
 44		    <not> 
 45			<or> 
 46			    <contains string="${java.version}" substring="1.7" casesensitive="false" /> 
 47			</or> 
 48		    </not> 
 49		</condition> 
 50	    </fail>
 51	</target>
 52
 53	<target name="checkout" description="Checks out src and downloads everything that is required." depends="checkout-sources" />
 54	<target name="build" description="Builds components sources and everything associated." depends="build-sources-asn,build-sources-stream,build-sources-ss7" />
 55	<target name="copy" depends="copy-asn,copy-protocols-ss7" />
 56	<target name="package" description="Builds builds binary package." depends="init,clean,checkout,zip.src,build,notes,copy,zip.binary" />
 57	<target name="clean">
 58		<echo>Cleaning checkout directory</echo>
 59		<delete dir="${ant.file.ss7.release.sf}/../${checkout.basedir}" verbose="false" />
 60		<echo>Cleaning work directory</echo>
 61		<delete dir="${zip.dir}" verbose="false" />
 62		<echo>Cleaning upload directory</echo>
 63		<delete dir="${zip.file.destination.dir}" verbose="false" />
 64	</target>
 65
 66
 67
 68	<target name="checkout-sources">
 69		<echo>Checking out sources</echo>
 70		 <mkdir dir="${checkout.basedir}"/>
 71		<exec executable="${mvn.executable}" dir="${ant.file.mobicents.release}/../">
 72			<arg line="validate -P checkout -Dcheckout.dir=${checkout.basedir}" />
 73		</exec>
 74	</target>
 75
 76	<target name="build-sources-asn">
 77		<exec executable="${mvn.executable}" dir="${checkout.basedir}/asn">
 78			<arg line="install -Prelease,set-svn-revision -Dmaven.test.skip=${test.skip} -Drelease.name=${release.name}" />
 79		</exec>
 80	</target>
 81
 82	<target name="build-sources-stream">
 83		<exec executable="${mvn.executable}" dir="${checkout.basedir}/stream">
 84			<arg line="install -P release,set-svn-revision -Dmaven.test.skip=${test.skip} -Drelease.name=${release.name}" />
 85		</exec>
 86	</target>
 87	<target name="build-sources-ss7">
 88		<echo>Build SS7</echo>
 89		<exec executable="${mvn.executable}" dir="${checkout.basedir}/ss7">
 90					<arg line="-f pom.xml install -P release,set-svn-revision -Dmaven.test.skip=${test.skip} -Drelease.name=${release.name}" />
 91				</exec>
 92	</target>
 93
 94	<target name="notes">
 95		<copy todir="${zip.dir}" file="${basedir}/README.TXT" failonerror="${failoncopy}">
 96			<filterchain>
 97				<replacetokens>
 98					<token key="VERSION" value="${release.version}" />
 99					<token key="ASN_VERSION" value="${asn.version}" />
100					<token key="STREAM_VERSION" value="${stream.version}" />
101					<token key="SS7_VERSION" value="${ss7.version}" />
102				</replacetokens>
103			</filterchain>
104		</copy>
105	</target>
106
107	<target name="copy-asn">
108		<echo>Copy ASN</echo>
109		<copy todir="${zip.dir}/asn" failonerror="${failoncopy}">
110			<fileset dir="${checkout.basedir}/asn/release/${release.name}">
111				<include name="**" />
112			</fileset>
113		</copy>
114	</target>
115	<target name="copy-stream">
116		<echo>Copy Stream</echo>
117		<copy todir="${zip.dir}/stream" failonerror="${failoncopy}">
118			<fileset dir="${checkout.basedir}/stream/release/${release.name}">
119				<include name="**" />
120			</fileset>
121		</copy>
122	</target>
123	<target name="copy-protocols-ss7">
124		<echo>Copy SS7 Service</echo>
125		<copy todir="${zip.dir}/ss7/mobicents-ss7-service" failonerror="${failoncopy}">
126			<fileset dir="${checkout.basedir}/ss7/service/target/mobicents-ss7-service">
127				<include name="**" />
128			</fileset>
129		</copy>
130
131		<echo>Copy sgw</echo>
132		<copy todir="${zip.dir}/ss7/mobicents-sgw" failonerror="${failoncopy}">
133			<fileset dir="${checkout.basedir}/ss7/sgw/boot/target/mobicents-sgw">
134				<include name="**" />
135			</fileset>
136		</copy>
137
138		<echo>Copy Shell</echo>
139		<copy todir="${zip.dir}/ss7/shell" failonerror="${failoncopy}">
140			<fileset dir="${checkout.basedir}/ss7/management/shell/target/release">
141				<include name="**" />
142			</fileset>
143		</copy>
144
145		<echo>Copy Protocols</echo>
146		<copy todir="${zip.dir}/ss7/protocols" failonerror="${failoncopy}">
147			<fileset dir="${checkout.basedir}/ss7/tcap/release/point">
148				<include name="**" />
149			</fileset>
150			<fileset dir="${checkout.basedir}/ss7/map/release/point">
151				<include name="**" />
152			</fileset>
153			<!---->
154			<fileset dir="${checkout.basedir}/ss7/isup/release/point">
155				<include name="**" />
156			</fileset>
157			
158		</copy>
159
160		<echo>Copy Native</echo>
161		<copy todir="${zip.dir}/ss7/native" failonerror="${failoncopy}">
162			<fileset dir="${checkout.basedir}/ss7/hardware/dahdi/native/linux/target">
163				<include name="*.so" />
164			</fileset>
165			<fileset dir="${checkout.basedir}/ss7/hardware/dialogic/native/linux/target">
166				<include name="*.so" />
167			</fileset>
168		</copy>
169
170		<echo>Copy Docs</echo>
171		<copy todir="${zip.dir}/ss7/docs" failonerror="${failoncopy}">
172			<fileset dir="${checkout.basedir}/ss7/docs/jdocbook-mobicents/target/docbook/publish">
173				<include name="**" />
174			</fileset>
175		</copy>
176
177		<echo>Copy Build File</echo>
178		<copy file="${checkout.basedir}/ss7/release/release-build.xml" tofile="${zip.dir}/ss7/build.xml" failonerror="${failoncopy}" />
179	</target>
180
181	<target name="zip.binary">
182		<zip destfile="${zip.file.destination.dir}/${zip.file.name}.zip">
183			<zipfileset dir="${zip.dir}" excludes="zip">
184			</zipfileset>
185		</zip>
186
187		<antcall target="checksum">
188			<param name="source.file" value="${zip.file.destination.dir}/${zip.file.name}.zip" />
189			<param name="algorithm" value="sha1" />
190		</antcall>
191	</target>
192	<target name="zip.src">
193		<mkdir dir="${zip.file.destination.dir}"/>
194		<zip destfile="${zip.file.destination.dir}/${zip.file.name}-src.zip">
195			<zipfileset dir="${checkout.basedir}" excludes="zip">
196			</zipfileset>
197		</zip>
198
199		<antcall target="checksum">
200			<param name="source.file" value="${zip.file.destination.dir}/${zip.file.name}-src.zip" />
201			<param name="algorithm" value="sha1" />
202		</antcall>
203
204	</target>
205	<target name="checksum">
206		<checksum file="${source.file}" algorithm="${algorithm}" fileext=".${algorithm}.asc" forceOverwrite="yes" />
207	</target>
208</project>