-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmake_aio_gsql_client.sh
executable file
·59 lines (54 loc) · 2.24 KB
/
make_aio_gsql_client.sh
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
#!/bin/bash
GLE_DIR=$1
if [ "$#" -ne 1 ]; then
echo "Illegal number of parameters: need GLE src path"
exit 1
fi
# how to add a new version:
# make sure GLE repo is available.
# 1. Add 2 lines in this file, section 2.
# 2. Change pom.xml with the new version
#######################################
# 1. create Driver.java begin section #
#######################################
rm -rf com/tigergraph/*
mkdir -p com/tigergraph/client
cat <<EOT >> com/tigergraph/client/Driver.java
package com.tigergraph.client;
import java.io.OutputStream;
public class Driver {
public static void main(String[] args) {
String Gsql_Client_Version= System.getenv("GSQL_CLIENT_VERSION");
if (Gsql_Client_Version == null) {
Gsql_Client_Version = System.getProperty("GSQL_CLIENT_VERSION");
}
if (Gsql_Client_Version == null) {
Gsql_Client_Version = "";
}
// do two loops: 1st to try the given Gsql_Client_Version;
// 2nd is to try each one except the given Gsql_Client_Version
String Supported_Versions="";
for (int i = 1; i <= 2; i++) {
if ( i==2) {
System.out.println( "Supported Versions ( " + Supported_Versions +")");
System.out.println( "You may use 'GSQL_CLIENT_VERSION=v? java ...' or \n 'java -DGSQL_CLIENT_VERSION=v? ...' to specify the version");
}
EOT
########################################################################
# 2. add each version. Make sure we can CD to the first GLE directory. #
########################################################################
cd $GLE_DIR; git checkout tg_2.5.0_dev; cd -
# client path, branch, version_string in combined client
./new_gsql_version.sh $GLE_DIR/src/main/java/ tg_2.5.0_dev v2_5_0
./new_gsql_version.sh $GLE_DIR tg_2.4.1_dev v2_4_1
./new_gsql_version.sh $GLE_DIR tg_2.4.0_dev v2_4_0
./new_gsql_version.sh $GLE_DIR tg_2.3.2_dev v2_3_2
######################################
# 3. finish Driver.java endi section #
######################################
cat <<EOT >> com/tigergraph/client/Driver.java
}
} // end main
}
EOT
# Continue with " mvn package "