-
Notifications
You must be signed in to change notification settings - Fork 4
/
dist.sh
executable file
·83 lines (66 loc) · 1.25 KB
/
dist.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/env bash
function clean() {
if test -d dist; then
rm -fr dist
fi
if test -f dist.tar.gz; then
rm -f dist.tar.gz
echo "Previous artifact dist.tar.gz is removed"
fi
mkdir dist
}
function copy_headers() {
echo "Copying header files"
cp -r include dist/
echo "Done"
}
function copy_shared_libraries() {
echo "Copying shared libraries"
cp -r build/lib/* dist/
echo "Done"
}
function copy_examples() {
echo "Copying examples"
cp -r example dist/
rm -f dist/example/CMakeLists.txt
echo "Done"
}
function copy_vm() {
echo "Copying VirtualMachine"
cp -r third_party/jdk8m dist/vm
rm -fr dist/vm/include
echo "Done"
}
function copy_vendors() {
echo "Copying OMS vendor implementations"
mkdir -p dist/vendors/rocketmq
echo "Done"
}
function copy_artifacts() {
copy_headers
copy_shared_libraries
copy_examples
copy_vm
copy_vendors
}
function build() {
if test ! -d build; then
mkdir build
fi
rm -fr build/*
cd build
cmake ..
make
cd ..
}
function execute_tests() {
cd build
./runUnitTests
}
function main() {
build
clean
copy_artifacts
tar -czvf dist.tar.gz dist
}
main