forked from zstackio/zstack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunMavenProfile
executable file
·67 lines (58 loc) · 1.36 KB
/
runMavenProfile
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
#!/bin/sh
usage() {
echo "usage:$0 [deploydb|deploy|xml-java-schema|premium|sdk|doc]"
}
py() {
cd test
mvn test -Dtest=TestGenerateApiPythonClassAndJsonTemplate
cd - > /dev/null
}
doc() {
cd test
mvn test -Dtest=TestGenerateDocTemplate
cd - > /dev/null
}
md() {
cd test
mvn test -Dtest=TestGenerateMarkDownDoc
cd - > /dev/null
}
sdk() {
set -u
rm -rf ~/zstack-sdk/java
cd test
mvn test -Dtest=TestGenerateSDK
if [ $? -ne 0 ]; then
echo "if you see a compile error, you may try to compile and install the sdk module first"
exit 1
fi
cd - > /dev/null
cd sdk/src/main/java/org/zstack/sdk/
find . -type f | grep -E -v "(ZSClient|ZSConfig|ApiException|AsyncRestState|Completion|Constants|ErrorCode|ErrorCodeList|InternalCompletion|ApiResult|Param|RestInfo|AbstractAction|QueryAction).java" | xargs rm -f
cd -
yes | cp ~/zstack-sdk/java/* sdk/src/main/java/org/zstack/sdk/
set +u
}
run_profile() {
if test x$1 = x'premium'; then
mvn -Dmaven.test.skip=true -P premium clean install
elif test x$1 = x'md'; then
md
elif test x$1 = x'sdk'; then
sdk
elif test x$1 = x'doc'; then
doc
elif test x$1 = x'py'; then
py
else
mvn -pl build -P $1 exec:exec -D$1
fi
}
if [ "$#" -eq 0 ]; then
usage
exit 1
fi
for cmd in $@
do
run_profile ${cmd}
done