Skip to content

Commit 1861517

Browse files
kenzieschmollCoderDake
authored andcommitted
Add --update-perfetto option to build scripts (flutter#4581)
1 parent 8a8151d commit 1861517

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

tool/build_e2e.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
import 'dart:io';
66

77
const argDevToolsBuild = 'devtools-build';
8+
const argUpdatePerfetto = '--update-perfetto';
89

910
void main(List<String> args) async {
11+
final shouldUpdatePerfetto = args.contains(argUpdatePerfetto);
12+
1013
final mainDevToolsDirectory = Directory.current;
1114
if (!mainDevToolsDirectory.path.endsWith('/devtools')) {
1215
throw Exception('Please execute this script from your top level '
@@ -23,7 +26,9 @@ void main(List<String> args) async {
2326
print('Running the build_release.sh script...');
2427
final buildProcess = await Process.start(
2528
'./tool/build_release.sh',
26-
[],
29+
[
30+
if (shouldUpdatePerfetto) argUpdatePerfetto,
31+
],
2732
workingDirectory: mainDevToolsDirectory.path,
2833
);
2934
_forwardOutputStreams(buildProcess);

tool/build_release.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,20 @@
44
# Use of this source code is governed by a BSD-style license that can be
55
# found in the LICENSE file.
66

7+
# Contains a path to this script, relative to the directory it was called from.
8+
RELATIVE_PATH_TO_SCRIPT="${BASH_SOURCE[0]}"
9+
10+
# The directory that this script is located in.
11+
TOOL_DIR=`dirname "${RELATIVE_PATH_TO_SCRIPT}"`
12+
13+
# The devtools root directory is assumed to be the parent of this directory.
14+
DEVTOOLS_DIR="${TOOL_DIR}/.."
15+
716
# Use the Flutter SDK from flutter-sdk/.
817
FLUTTER_DIR="`pwd`/flutter-sdk"
918
PATH="$FLUTTER_DIR/bin":$PATH
1019

11-
REQUIRED_FLUTTER_VERSION=$(<"flutter-version.txt")
20+
REQUIRED_FLUTTER_VERSION=$(<"${DEVTOOLS_DIR}/flutter-version.txt")
1221

1322
flutter --version
1423
ACTUAL_FLUTTER_VERSION=$(<"$FLUTTER_DIR/version")
@@ -26,7 +35,11 @@ fi
2635
# echo on
2736
set -ex
2837

29-
pushd packages/devtools_app
38+
if [[ $1 = "--update-perfetto" ]]; then
39+
$TOOL_DIR/update_perfetto.sh
40+
fi
41+
42+
pushd $DEVTOOLS_DIR/packages/devtools_app
3043

3144
flutter clean
3245
rm -rf build/web

0 commit comments

Comments
 (0)