forked from hazelcast/hazelcast-simulator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
executable file
·62 lines (46 loc) · 1.98 KB
/
build
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
#!/usr/bin/env python3
import os
import shutil
def mvn_clean_install():
cwd = os.getcwd()
os.chdir("java")
exitcode = os.system('mvn clean install -DskipTests')
if exitcode != 0:
print("Failed to build Simulator due to a Maven build failure.")
exit(exitcode)
os.chdir(cwd)
def make_empty_dir(dir):
if os.path.isdir(dir):
shutil.rmtree(dir)
os.mkdir(dir)
mvn_clean_install()
make_empty_dir("drivers")
# Copy the drivers.
for driver_dir_name in os.listdir("java/drivers"):
src_driver_dir = f"java/drivers/{driver_dir_name}"
target_driver_dir = f"drivers/{driver_dir_name}"
if not os.path.isdir(src_driver_dir):
continue
print(src_driver_dir)
os.mkdir(f"drivers/{driver_dir_name}")
target_dir = f"{src_driver_dir}/target"
os.system(f"cp {target_dir}/*.jar drivers/{driver_dir_name}")
if os.path.isdir(f"{src_driver_dir}/conf"):
os.system(f"cp -r {src_driver_dir}/conf {target_driver_dir}")
if os.path.exists(f"{target_driver_dir}/conf/install"):
os.system(f"chmod +x {target_driver_dir}/conf/install")
if os.path.exists(f"{target_driver_dir}/conf/configure"):
os.system(f"chmod +x {target_driver_dir}/conf/configure")
make_empty_dir("lib")
os.system(f"cp java/simulator/target/*.jar lib/")
os.system(f"cp java/extra/* lib/")
os.system(f"rm drivers/driver-hazelcast4plus/hazelcast-*.jar")
os.system(f"rm -fr drivers/driver-hazelcast4")
os.system(f"cp -r drivers/driver-hazelcast4plus drivers/driver-hazelcast4")
os.system(f"rm -fr drivers/driver-hazelcast-enterprise4")
os.system(f"cp -r drivers/driver-hazelcast4plus drivers/driver-hazelcast-enterprise4")
os.system(f"rm -fr drivers/driver-hazelcast5")
os.system(f"cp -r drivers/driver-hazelcast4plus drivers/driver-hazelcast5")
os.system(f"rm -fr drivers/driver-hazelcast-enterprise5")
os.system(f"cp -r drivers/driver-hazelcast4plus drivers/driver-hazelcast-enterprise5")
os.system(f"rm -fr drivers/driver-hazelcast4plus")