forked from microsoft/azure-tools-for-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BuildDevint
executable file
·87 lines (67 loc) · 2.81 KB
/
BuildDevint
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
81
82
83
84
85
86
87
#!/bin/bash
set -e
SCRIPTPATH=$(pwd -P)
cd "$SCRIPTPATH"
MAVEN_QUIET=""
# Utils
SKIP_CHECKSTYLE=$TRAVIS
# Eclipse
BUILD_ECLIPSE=true
#IntelliJ
BUILD_INTELLIJ=true
INJECT_INTELLIJ_VERSION=false
IJ_VERSION_LATEST=2019.1
IJ_SCALA_VERSION_LATEST=2019.1.6
IJ_VERSION_FALLBACK=2018.3
IJ_SCALA_VERSION_FALLBACK=2018.3.2
while getopts "hqve:" option; do
echo $option
case $option in
h) echo "usage: $0 [-h] [-q] [-v] [-e eclipse/intellij]"; exit ;;
q) MAVEN_QUIET="-q" ;;
v) INJECT_INTELLIJ_VERSION=true ;;
e)
shopt -s nocasematch
case $OPTARG in
eclipse) BUILD_ECLIPSE=false ;;
intellij) BUILD_INTELLIJ=false ;;
esac ;;
?) echo "error: option -$OPTARG is not implemented"; exit ;;
esac
done
ARTIFACTS_DIR="artifacts"
# check dir exists
if [ ! -d "$ARTIFACTS_DIR" ]; then
echo "Creating artifacts directory $ARTIFACTS_DIR"
mkdir -p $ARTIFACTS_DIR
fi
# echo shell commands when they are executed.
set -x
# Build Utils
echo "Building Utils ..."
mvn install -f $SCRIPTPATH/Utils/pom.xml -Dmaven.repo.local=$SCRIPTPATH/.repository -Dcheckstyle.skip=$SKIP_CHECKSTYLE $MAVEN_QUIET
mvn install -f $SCRIPTPATH/PluginsAndFeatures/AddLibrary/AzureLibraries/pom.xml -Dmaven.repo.local=$SCRIPTPATH/.repository $MAVEN_QUIET
# Build Eclipse plugin
if $BUILD_ECLIPSE; then
echo "Building Eclipse plugin ..."
mvn clean install -f $SCRIPTPATH/PluginsAndFeatures/azure-toolkit-for-eclipse/pom.xml $MAVEN_QUIET
cp ./PluginsAndFeatures/azure-toolkit-for-eclipse/WindowsAzurePlugin4EJ/target/WindowsAzurePlugin4EJ*.zip ./$ARTIFACTS_DIR/WindowsAzurePlugin4EJ.zip
fi
# Build IntelliJ plugin
if $BUILD_INTELLIJ; then
echo "Building IntelliJ plugin ..."
chmod +x ./tools/IntellijVersionHelper
## Build intellij plugin for latest version
if [ $INJECT_INTELLIJ_VERSION == "true" ] ; then
./tools/IntellijVersionHelper $IJ_VERSION_LATEST
fi
(cd PluginsAndFeatures/azure-toolkit-for-intellij && ./gradlew clean buildPlugin -s -Pintellij_version=IC-$IJ_VERSION_LATEST -Pdep_plugins=org.intellij.scala:$IJ_SCALA_VERSION_LATEST)
cp ./PluginsAndFeatures/azure-toolkit-for-intellij/build/distributions/azure-toolkit-for-intellij.zip ./$ARTIFACTS_DIR/azure-toolkit-for-intellij-$IJ_VERSION_LATEST.zip
## Build intellij plugin for fallback version
if [ $INJECT_INTELLIJ_VERSION == "true" ] ; then
./tools/IntellijVersionHelper $IJ_VERSION_FALLBACK
fi
(cd PluginsAndFeatures/azure-toolkit-for-intellij && ./gradlew clean buildPlugin -s -Pintellij_version=IC-$IJ_VERSION_FALLBACK -Pdep_plugins=org.intellij.scala:$IJ_SCALA_VERSION_FALLBACK)
cp ./PluginsAndFeatures/azure-toolkit-for-intellij/build/distributions/azure-toolkit-for-intellij.zip ./$ARTIFACTS_DIR/azure-toolkit-for-intellij-$IJ_VERSION_FALLBACK.zip
fi
echo "ALL BUILD SUCCESSFUL"