-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·52 lines (50 loc) · 1.68 KB
/
build.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
#!/usr/bin/env bash
bDATE=$(date '+%Y%m%d%H%M%S')
yDATE=$(date '+%Y')
mDATE=$(date '+%-m')
bDIR=$(dirname $0)
bDIR=$(cd $bDIR && pwd)
#OPTS="-DskipTests=true -DproxySet=true -DproxyHost=127.0.0.1 -DproxyPort=3128 -Dhttps.nonProxyHosts=127.0.0.1"
OPTS="-DskipTests=true"
while test ! -z "$1" ; do
case "$1" in
-setversion*)
VALUE="${2}"
(cd $bDIR && mvn build-helper:parse-version versions:set \
-DnewVersion="${VALUE}" ) || exit 1
shift
;;
-release*)
(cd $bDIR && mvn -X build-helper:parse-version versions:set \
-DnewVersion="\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}" ) || exit 1
;;
-drel*)
(cd $bDIR && mvn -X build-helper:parse-version versions:set \
-DnewVersion="${yDATE}.${mDATE}.\${parsedVersion.nextIncrementalVersion}" ) || exit 1
;;
-clean*)
(cd $bDIR && mvn clean $OPTS -U) || exit 1
;;
-pack*)
(cd $bDIR && mvn clean package $OPTS -U) || exit 1
;;
-fix*)
(cd $bDIR && mvn -N versions:update-child-modules) || exit 1
;;
-install*)
(cd $bDIR && mvn install $OPTS) || exit 1
;;
-copy*)
cp -v $bDIR/src/main/dist/stub.sh ~/bin/script-cli.sh
cp -v $bDIR/src/main/dist/stub.sh ~/bin/pmltopdf-cli.sh
cp -v $bDIR/script-cli/target/script-cli.sh.jar ~/bin/script-cli.sh.jar
cp -v $bDIR/pdfml-jmelange/target/pmltopdf.sh.jar ~/bin/pmltopdf-cli.sh.jar
;;
-deps)
(cd $bDIR && mvn org.apache.maven.plugins:maven-dependency-plugin:tree) || exit 1
;;
*) echo "unknown option ..."
;;
esac
shift
done