forked from flutter/plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tool_runner.sh
executable file
·31 lines (24 loc) · 1.03 KB
/
tool_runner.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
#!/bin/bash
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -e
readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
readonly REPO_DIR="$(dirname "$SCRIPT_DIR")"
# Runs the plugin tools from the in-tree source.
function plugin_tools() {
(pushd "$REPO_DIR/script/tool" && dart pub get && popd) >/dev/null
dart run "$REPO_DIR/script/tool/bin/flutter_plugin_tools.dart" "$@"
}
ACTIONS=("$@")
BRANCH_NAME="${BRANCH_NAME:-"$(git rev-parse --abbrev-ref HEAD)"}"
# This has to be turned into a list and then split out to the command line,
# otherwise it gets treated as a single argument.
PLUGIN_SHARDING=($PLUGIN_SHARDING)
if [[ "${BRANCH_NAME}" == "master" ]]; then
echo "Running for all packages"
(cd "$REPO_DIR" && plugin_tools "${ACTIONS[@]}" ${PLUGIN_SHARDING[@]})
else
echo running "${ACTIONS[@]}"
(cd "$REPO_DIR" && plugin_tools "${ACTIONS[@]}" --run-on-changed-packages ${PLUGIN_SHARDING[@]})
fi