Migrate flutter conductor out of dev/tools and into its own directory (#83313)

* Migrate flutter conductor out of dev/tools and into its own directory

* flesh out documentation

* fix analysis options

* fix integration test
This commit is contained in:
Christopher Fujino
2021-05-25 16:12:53 -07:00
committed by GitHub
parent 36eea758ac
commit 62d00c6d5f
37 changed files with 210 additions and 55 deletions

View File

@@ -34,6 +34,7 @@ function follow_links() (
PROG_NAME="$(follow_links "${BASH_SOURCE[0]}")"
BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
DART_BIN="$BIN_DIR/../../../bin/dart"
REPO_DIR="$BIN_DIR/../../.."
DART_BIN="$REPO_DIR/bin/dart"
"$DART_BIN" --enable-asserts "$BIN_DIR/conductor.dart" "$@"
"$DART_BIN" --enable-asserts "$REPO_DIR/dev/conductor/bin/conductor.dart" "$@"

View File

@@ -1,87 +0,0 @@
// Copyright 2014 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.
// @dart = 2.8
// See: https://github.com/flutter/flutter/wiki/Release-process
import 'dart:io' as io;
import 'package:args/command_runner.dart';
import 'package:dev_tools/candidates.dart';
import 'package:dev_tools/clean.dart';
import 'package:dev_tools/codesign.dart';
import 'package:dev_tools/globals.dart';
import 'package:dev_tools/repository.dart';
import 'package:dev_tools/roll_dev.dart';
import 'package:dev_tools/start.dart';
import 'package:dev_tools/status.dart';
import 'package:dev_tools/stdio.dart';
import 'package:file/file.dart';
import 'package:file/local.dart';
import 'package:platform/platform.dart';
import 'package:process/process.dart';
Future<void> main(List<String> args) async {
const FileSystem fileSystem = LocalFileSystem();
const ProcessManager processManager = LocalProcessManager();
const Platform platform = LocalPlatform();
final Stdio stdio = VerboseStdio(
stdout: io.stdout,
stderr: io.stderr,
stdin: io.stdin,
);
final Checkouts checkouts = Checkouts(
fileSystem: fileSystem,
parentDirectory: localFlutterRoot.parent,
platform: platform,
processManager: processManager,
stdio: stdio,
);
final CommandRunner<void> runner = CommandRunner<void>(
'conductor',
'A tool for coordinating Flutter releases.',
usageLineLength: 80,
);
<Command<void>>[
RollDevCommand(
checkouts: checkouts,
fileSystem: fileSystem,
platform: platform,
stdio: stdio,
),
CodesignCommand(
checkouts: checkouts,
flutterRoot: localFlutterRoot,
),
StatusCommand(
checkouts: checkouts,
),
StartCommand(
checkouts: checkouts,
flutterRoot: localFlutterRoot,
),
CleanCommand(
checkouts: checkouts,
),
CandidatesCommand(
checkouts: checkouts,
flutterRoot: localFlutterRoot,
),
].forEach(runner.addCommand);
if (!assertsEnabled()) {
stdio.printError('The conductor tool must be run with --enable-asserts.');
io.exit(1);
}
try {
await runner.run(args);
} on Exception catch (e, stacktrace) {
stdio.printError('$e\n\n$stacktrace');
io.exit(1);
}
}