mirror of
https://github.com/dart-lang/sdk
synced 2024-09-04 16:03:44 +00:00
Support targetting flutter and flutter_runner in kernel_worker
Change-Id: I87745f48ba09a0ac8629ae6518b7dad883733447 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100180 Commit-Queue: Jake Macdonald <jakemac@google.com> Reviewed-by: Jake Macdonald <jakemac@google.com>
This commit is contained in:
parent
2298712d62
commit
2c4dc7a431
|
@ -20,6 +20,8 @@ import 'package:front_end/src/api_unstable/bazel_worker.dart' as fe;
|
|||
import 'package:kernel/ast.dart' show Component, Library;
|
||||
import 'package:kernel/target/targets.dart';
|
||||
import 'package:vm/target/vm.dart';
|
||||
import 'package:vm/target/flutter.dart';
|
||||
import 'package:vm/target/flutter_runner.dart';
|
||||
import 'package:compiler/src/kernel/dart2js_target.dart';
|
||||
|
||||
main(List<String> args) async {
|
||||
|
@ -120,8 +122,14 @@ final summaryArgsParser = new ArgParser()
|
|||
negatable: true,
|
||||
help: 'Whether to only build summary files.')
|
||||
..addOption('target',
|
||||
allowed: const ['vm', 'dart2js', 'ddc'],
|
||||
help: 'Build kernel for the vm, dart2js, or ddc')
|
||||
allowed: const [
|
||||
'vm',
|
||||
'flutter',
|
||||
'flutter_runner',
|
||||
'dart2js',
|
||||
'ddc',
|
||||
],
|
||||
help: 'Build kernel for the vm, flutter, flutter_runner, dart2js or ddc')
|
||||
..addOption('dart-sdk-summary')
|
||||
..addMultiOption('input-summary')
|
||||
..addMultiOption('input-linked')
|
||||
|
@ -189,6 +197,20 @@ Future<ComputeKernelResult> computeKernel(List<String> args,
|
|||
out.writeln('error: --summary-only not supported for the vm target');
|
||||
}
|
||||
break;
|
||||
case 'flutter':
|
||||
target = new FlutterTarget(targetFlags);
|
||||
if (summaryOnly) {
|
||||
throw new ArgumentError(
|
||||
'error: --summary-only not supported for the flutter target');
|
||||
}
|
||||
break;
|
||||
case 'flutter_runner':
|
||||
target = new FlutterRunnerTarget(targetFlags);
|
||||
if (summaryOnly) {
|
||||
throw new ArgumentError('error: --summary-only not supported for the '
|
||||
'flutter_runner target');
|
||||
}
|
||||
break;
|
||||
case 'dart2js':
|
||||
target = new Dart2jsTarget('dart2js', targetFlags);
|
||||
if (summaryOnly) {
|
||||
|
|
Loading…
Reference in a new issue