forked from eclipse/xtext-eclipse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
1-maven-build.sh
executable file
·65 lines (60 loc) · 1.56 KB
/
1-maven-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
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env bash
if [ -z "$JENKINS_URL" ]; then
# if not set in environment use default
JENKINS_URL=https://ci.eclipse.org/xtext/
fi
# Use TARGET_PLATFORM from environment and 'oxygen' as default.
# Overridable by 'tp' command-line arg
if [ -z "$TARGET_PLATFORM" ]; then
TARGET_PLATFORM=oxygen
fi
MVN_ARGS=(\
--batch-mode \
--update-snapshots \
--fae \
-Dmaven.test.failure.ignore=true \
-Declipse.p2.mirrors=false \
-Dtycho.disableP2Mirrors=true \
-DJENKINS_URL=$JENKINS_URL \
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=info \
)
# args parsing inspired by https://gist.github.com/jehiah/855086
while [ "$1" != "" ]; do
PARAM=`echo $1 | awk -F= '{print $1}'`
VALUE=`echo $1 | awk -F= '{print $2}'`
case $PARAM in
-h | --help)
echo "Perform Maven build for xtext-eclipse"
echo ""
echo "./1-maven-build.sh"
echo -e "\t-h --help"
echo -e "\t--tp=$TARGET_PLATFORM (valid values: oxygen,photon,r201809,r201812,latest)"
echo ""
exit
;;
--tp)
TARGET_PLATFORM=($VALUE)
;;
--no-tests)
MVN_ARGS+=(-DskipTests=true)
;;
--local-repository)
MVN_ARGS+=(-Dmaven.repo.local='$VALUE')
;;
*)
# append any additionally passed arg
if [ -z "$VALUE" ]; then
MVN_ARGS+=($PARAM)
else
MVN_ARGS+=($PARAM=$VALUE)
fi
;;
esac
shift
done
MVN_ARGS+=(-P$TARGET_PLATFORM)
echo "Calling Maven with ARGS: ${MVN_ARGS[@]}"
echo "Using target platform '$TARGET_PLATFORM'"
mvn \
${MVN_ARGS[@]} \
$@