-
-
Notifications
You must be signed in to change notification settings - Fork 107
/
checkPlugins.sh
executable file
·50 lines (40 loc) · 1.05 KB
/
checkPlugins.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
#!/usr/bin/env bash
fail() {
echo "$1"
exit 1
}
checkInstalled() {
which "$1" || fail "ERROR: please install $1"
}
runGradleTaskInFolder() {
echo
echo "== cd $1 =="
cd $1 || fail "ERROR: Folder $1 doesn't exist"
pwd
echo '$' "./gradlew $TASK"
./gradlew $TASK || fail "ERROR for task $TASK"
cd ..
}
DIR="$(basename $PWD)"
TASK="check refreshVersions"
test -n "$1" && TASK="$*"
echo "TASK=$TASK"
test "$DIR" = "refreshVersions" || fail "ERROR: must be called from the refreshVersions folder"
checkInstalled java
checkInstalled node
checkInstalled yarn
cd plugins || fail "can't cd plugins"
./gradlew test publishToMavenLocal
cd ..
runGradleTaskInFolder sample-kotlin
runGradleTaskInFolder sample-multi-modules
runGradleTaskInFolder sample-groovy
runGradleTaskInFolder sample-kotlin-js
test -n "$ANDROID_SDK_ROOT" && {
runGradleTaskInFolder sample-android
}
echo "SUCCESS"
test "$TASK" = "refreshVersionsCleanup" || {
echo "To clean up your git history, you can run:"
echo " ./checkPlugins.sh refreshVersionsCleanup"
}