forked from gridgain/gridgain-old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
207 lines (169 loc) · 7.23 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) GridGain Systems. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
_________ _____ __________________ _____
__ ____/___________(_)______ /__ ____/______ ____(_)_______
_ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
/ /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
\____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
-->
<project name="GridGain Development Build" basedir="." default="mk.dev.jar">
<description>
GridGain build script.
</description>
<property environment="env"/>
<condition property="tmp.dir" value="${TMP_DIR}" else="${java.io.tmpdir}">
<isset property="TMP_DIR"/>
</condition>
<condition property="gridgain.home" value="${GG_HOME}">
<isset property="GG_HOME"/>
</condition>
<condition property="gridgain.home" value="${env.GRIDGAIN_HOME}">
<and>
<not>
<isset property="gridgain.home"/>
</not>
<isset property="env.GRIDGAIN_HOME"/>
</and>
</condition>
<condition property="m2.home" value="${M2_HOME}">
<isset property="M2_HOME"/>
</condition>
<condition property="m2.home" value="${env.M2_HOME}">
<and>
<not>
<isset property="m2.home"/>
</not>
<isset property="env.M2_HOME"/>
</and>
</condition>
<condition property="jdk.home" value="${JAVA_HOME}">
<isset property="JAVA_HOME"/>
</condition>
<condition property="jdk.home" value="${env.JAVA_HOME}">
<and>
<not>
<isset property="jdk.home"/>
</not>
<isset property="env.JAVA_HOME"/>
</and>
</condition>
<fail unless="gridgain.home" message="Please specify GG_HOME ant property or environment variable."/>
<fail unless="m2.home" message="Please specify M2_HOME ant property or environment variable."/>
<fail unless="jdk.home" message="Please specify JAVA_HOME ant property or environment variable."/>
<property name="tmp.src" value="${tmp.dir}/src"/>
<property name="tmp.dist" value="${tmp.dir}/dist"/>
<property name="tmp.cls" value="${tmp.dir}/classes"/>
<property name="dir.core" value="${gridgain.home}/modules/core"/>
<property name="dir.client" value="${gridgain.home}/modules/clients"/>
<property name="dir.jdbc" value="${gridgain.home}/modules/jdbc-driver"/>
<property name="dir.scalar" value="${gridgain.home}/modules/scalar"/>
<property name="dir.visor-console" value="${gridgain.home}/modules/visor-console"/>
<property name="dir.core.src" value="${dir.core}/java"/>
<property name="dir.client.src" value="${dir.client}/java/src"/>
<property name="dir.jdbc.src" value="${dir.jdbc}/src"/>
<property name="dir.scalar.src" value="${dir.scalar}/src"/>
<property name="dir.visor-console.src" value="${dir.visor-console}/src"/>
<property name="dir.libs" value="${gridgain.home}/libs"/>
<property name="dir.libs.rel" value="target/libs"/>
<property name="jar.dev" value="gridgain.jar"/>
<!--
Inits build.
-->
<target name="init.build">
<echo message=""/>
<echo message=" _____ _ _______ _ "/>
<echo message=" / ___/____(_)___/ / ___/___ _(_)___ "/>
<echo message=" / (_ // __/ // _ / (_ // _ `/ // _ \"/>
<echo message=" \___//_/ /_/ \_,_/\___/ \_,_/_//_//_/"/>
<echo message=" IN-MEMORY COMPUTING"/>
<echo message=""/>
<echo message=" GRIDGAIN_HOME : ${gridgain.home}"/>
<echo message=" JAVA_HOME : ${jdk.home}"/>
<echo message=" M2_HOME : ${m2.home}"/>
<echo message=" TMP_DIR : ${tmp.dir}"/>
<echo message=""/>
</target>
<!--
Collects dependencies.
-->
<target name="mk.collect.libs">
<echo message=""/>
<echo message="mk.collect.libs"/>
<exec executable="${m2.home}/bin/mvn" dir="${gridgain.home}" failonerror="yes" >
<arg line="clean install"/>
</exec>
<delete dir="${dir.libs}"/>
<mkdir dir="${dir.libs}"/>
<copy todir="${dir.libs}">
<fileset dir="${dir.core}/${dir.libs.rel}"/>
</copy>
<copy todir="${dir.libs}" overwrite="no">
<fileset dir="${dir.client}/${dir.libs.rel}"/>
</copy>
<copy todir="${dir.libs}" overwrite="no">
<fileset dir="${dir.jdbc}/${dir.libs.rel}"/>
</copy>
<copy todir="${dir.libs}" overwrite="no">
<fileset dir="${dir.scalar}/${dir.libs.rel}"/>
</copy>
<copy todir="${dir.libs}" overwrite="no">
<fileset dir="${dir.visor-console}/${dir.libs.rel}"/>
</copy>
<delete>
<fileset dir="${dir.libs}" includes="**/gridgain*.*"/>
</delete>
</target>
<!--
Build GridGain development JAR.
-->
<target name="mk.dev.jar" depends="init.build, mk.collect.libs">
<echo message=""/>
<echo message="mk.dev.jar"/>
<!-- Clean. -->
<delete dir="${tmp.cls}"/>
<mkdir dir="${tmp.cls}"/>
<!-- Copy java classes built by mk.collect.libs. -->
<copy todir="${tmp.cls}">
<fileset dir="${dir.core}/target/classes" includes="**/*.class"/>
<fileset dir="${dir.client}/target/classes" includes="**/*.class"/>
<fileset dir="${dir.jdbc}/target/classes" includes="**/*.class"/>
<fileset dir="${dir.scalar}/target/classes" includes="**/*.class"/>
<fileset dir="${dir.visor-console}/target/classes" includes="**/*.class"/>
<!-- Copy resources. -->
<fileset dir="${dir.core.src}">
<exclude name="**/*.java"/>
<exclude name="**/*.html"/>
<exclude name="**/*.md"/>
</fileset>
<fileset dir="${dir.client.src}">
<exclude name="**/*.java"/>
<exclude name="**/*.html"/>
<exclude name="**/*.md"/>
</fileset>
<fileset dir="${dir.jdbc.src}">
<exclude name="**/*.java"/>
<exclude name="**/*.html"/>
<exclude name="**/*.md"/>
</fileset>
</copy>
<!-- Create JAR file. -->
<jar destfile="${tmp.dist}/${jar.dev}" basedir="${tmp.cls}">
<manifest>
<section name="GridGain">
<attribute name="Implementation-Title" value="${jar.dev}"/>
</section>
</manifest>
</jar>
<copy file="${tmp.dist}/${jar.dev}" tofile="${gridgain.home}/${jar.dev}"/>
</target>
</project>