forked from hazelcast/hazelcast-simulator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
executable file
·43 lines (33 loc) · 1.13 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
#!/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"):
driver_dir = f"java/drivers/{driver_dir_name}"
if not os.path.isdir(driver_dir):
continue
print(driver_dir)
os.mkdir(f"drivers/{driver_dir_name}")
target_dir = f"{driver_dir}/target"
os.system(f"cp {target_dir}/*.jar drivers/{driver_dir_name}")
if os.path.isdir(f"{driver_dir}/conf"):
os.system(f"cp -r {driver_dir}/conf drivers/{driver_dir_name}")
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 drivers/driver-hazelcast3/hazelcast-*.jar")