forked from alibaba/transmittable-thread-local
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.sh
34 lines (29 loc) · 767 Bytes
/
common.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
#!/bin/bash
redEcho() {
if [ -c /dev/stdout ] ; then
# if stdout is console, turn on color output.
echo -ne "\033[1;31m"
echo -n "$@"
echo -e "\033[0m"
else
echo "$@"
fi
}
runCmd() {
redEcho "$@"
"$@"
}
cleanInstall() {
[ "$1" = 'skip' ] || {
mvn clean install -Dmaven.test.skip && mvn test-compile
}
}
copyDeps() {
[ "$1" = 'skip' ] || {
mvn dependency:copy-dependencies -DincludeScope=test
# remove repackaged and shaded javassist lib
rm target/dependency/javassist*
}
}
version=`grep '<version>.*</version>' pom.xml | awk -F'</?version>' 'NR==1{print $2}'`
aid=`grep '<artifactId>.*</artifactId>' pom.xml | awk -F'</?artifactId>' 'NR==1{print $2}'`