-
Notifications
You must be signed in to change notification settings - Fork 54
/
build.sh
66 lines (54 loc) · 1.69 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/sh
echo ""
if [ "x$1" = "x" ]; then
echo "Syntax: $0 <version> [publish]"
echo ""
echo "<version> is the version of the plugin that'll appear in plugins.jetbrains.com,"
echo " for example: 1.1.3"
echo ""
echo "[publish] add the word 'publish' after the plugin version to both build and"
echo " publish the plugin to plugins.jetbrains.com"
echo ""
exit 1
fi
# Supported platform versions.
VERSIONS="181 182 183 191 192"
# Requested version to build.
PLUGIN_VERSION=$1
# Whether to publish as well or not.
SHOULD_PUBLISH=$2
echo "Provisioning for plugin version: $PLUGIN_VERSION"
echo ""
# Build for all platforms.
for VERSION in $VERSIONS; do
BUILD_COMMAND="./gradlew clean buildPlugin -PideaVersionPrefix=$VERSION -PpluginVersion=$PLUGIN_VERSION"
echo "Building for IntelliJ platform version: $VERSION"
$BUILD_COMMAND >/dev/null 2>&1
if [ $? == 0 ]; then
if [ "x$SHOULD_PUBLISH" = "xpublish" ]; then
PUBLISH_COMMAND="./gradlew clean publishPlugin -PideaVersionPrefix=$VERSION -PpluginVersion=$PLUGIN_VERSION"
echo "Publishing to JetBrains..."
$PUBLISH_COMMAND >/dev/null 2>&1
if [ $? != 0 ]; then
echo ""
echo "Ooops! Unable to publish to JetBrains for IntelliJ platform version: $VERSION"
echo "Please re-run the command manually to see what's wrong:"
echo ""
echo $PUBLISH_COMMAND
echo ""
exit 3
fi
fi
else
echo ""
echo "Ooops! Unable to build for IntelliJ platform version: $VERSION"
echo "Please re-run the command manually to see what's wrong:"
echo ""
echo $BUILD_COMMAND
echo ""
exit 2
fi
echo ""
echo "All done! Check the status on https://plugins.jetbrains.com/plugin/10128-flutter-i18n"
echo ""
done