-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
82 lines (67 loc) · 3.61 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
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<!--
* Title: GigaSpaces ant build.xml file.
make sure all root directory is already updated with latest src and files from SVN.
* Copyright: Copyright (c) 2008
* Company: GigaSpaces Technologies Ltd.
* @author Alex Beresnev
* @version 6.6.0
-->
<project name="Examples" default="all" basedir=".">
<condition property="mvn.executable" value="mvn.bat">
<os family="windows" />
</condition>
<condition property="mvn.executable" value="mvn">
<os family="unix" />
</condition>
<property name="maven.repo.local" value="${user.home}/.m2/repository" />
<property name="examples.root.dir" value="${basedir}" />
<property name="gigaspaces.root.dir" value="${examples.root.dir}/../gigaspaces" />
<property name="openspaces.root.dir" value="${examples.root.dir}/../openspaces" />
<property name="product.package.dir" value="${examples.root.dir}/../gigaspaces" />
<property name="examples.dir" value="${examples.root.dir}/examples" />
<property name="examples.release.dir" value="${examples.root.dir}/release" />
<property name="examples.lib.dir" value="${examples.root.dir}/lib" />
<property name="example.dir" value="${gs.compilation.dir}/examples" />
<target name="prepare_environment" if="xap.compilation.dir">
<delete dir="${examples.lib.dir}" failonerror="no" />
<copy todir="${examples.lib.dir}">
<fileset dir="${gs.compilation.dir}/lib" includes="**/*.jar" />
</copy>
</target>
<target name="build_examples" description="build all examples">
<!--<prepare-example example.folder="${examples.dir}/data"/>-->
<!--<prepare-example example.folder="${examples.dir}/helloworld"/>-->
<!--<prepare-example example.folder="${examples.dir}/tutorials/extreme-application-platform/openspaces-oms" target.name="compile"/>-->
<!-- Note: In Benchmark example only classes folder should be created. DO NOT COMPILE!!! -->
<delete dir="${example.dir}/../tools/benchmark/classes" />
<ant antfile="build.xml" dir="${example.dir}/../tools/benchmark" target="prepare" />
</target>
<target name="clean" description="delete all classes and release folder">
<delete failonerror="no">
<fileset dir="${examples.release.dir}" />
<fileset dir="${examples.dir}" includes="**/classes/**" />
</delete>
<mkdir dir="${examples.release.dir}"/>
</target>
<target name="package" description="create examples.zip and examples-1.4.zip under releases folder">
<property name="tmp.dir" value="tmp/examples"/>
<zip destfile="${examples.release.dir}/examples.zip" >
<zipfileset dir="${examples.dir}" includes="**/*" excludes="**/tutorials/" prefix="examples" filemode="775"/>
</zip>
<delete dir="${tmp.dir}" />
</target>
<macrodef name="prepare-example" description="build example">
<attribute name="example.folder"/>
<sequential>
<echo message="@{example.folder}"/>
<exec executable="${env.M2_HOME}\bin\${mvn.executable}" dir="@{example.folder}" failonerror="true">
<arg line="clean compile -Dmaven.repo.local=${maven.repo.local}"/>
</exec>
<exec executable="${env.M2_HOME}\bin\${mvn.executable}" dir="@{example.folder}" failonerror="true">
<arg line="clean -Dmaven.repo.local=${maven.repo.local}"/>
</exec>
</sequential>
</macrodef>
<target name="all" depends="clean, prepare_environment, build_examples, package" />
</project>