Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Unified Diff: pkg/front_end/lib/src/fasta/compile_platform.dart

Issue 3003743002: Move tools to tool folder. (Closed)
Patch Set: Fix two problems that show up elsewhere. Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/front_end/lib/src/fasta/compile_platform.dart
diff --git a/pkg/front_end/lib/src/fasta/compile_platform.dart b/pkg/front_end/lib/src/fasta/compile_platform.dart
deleted file mode 100644
index c95a67040ad83357828b9991066095ec9255cf73..0000000000000000000000000000000000000000
--- a/pkg/front_end/lib/src/fasta/compile_platform.dart
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library fasta.compile_platform;
-
-import 'dart:async' show Future;
-
-import 'dart:io' show exitCode, File;
-
-import '../kernel_generator_impl.dart' show generateKernelInternal;
-
-import 'compiler_command_line.dart' show CompilerCommandLine;
-
-import 'compiler_context.dart' show CompilerContext;
-
-import 'deprecated_problems.dart' show deprecated_InputError;
-
-import 'kernel/utils.dart' show writeProgramToFile;
-
-import 'severity.dart' show Severity;
-
-const int iterations = const int.fromEnvironment("iterations", defaultValue: 1);
-
-Future mainEntryPoint(List<String> arguments) async {
- for (int i = 0; i < iterations; i++) {
- if (i > 0) {
- print("\n");
- }
- try {
- await compilePlatform(arguments);
- } on deprecated_InputError catch (e) {
- exitCode = 1;
- CompilerContext.runWithDefaultOptions(
- (c) => c.report(deprecated_InputError.toMessage(e), Severity.error));
- return null;
- }
- }
-}
-
-Future compilePlatform(List<String> arguments) async {
- await CompilerCommandLine
- .withGlobalOptions("compile_platform", arguments, false,
- (CompilerContext c, List<String> restArguments) {
- c.options.inputs.add(Uri.parse('dart:core'));
- // Note: the patchedSdk argument is already stored in c.options.sdkRoot.
- Uri fullOutput = Uri.base.resolveUri(new Uri.file(restArguments[1]));
- Uri outlineOutput = Uri.base.resolveUri(new Uri.file(restArguments[2]));
- return compilePlatformInternal(c, fullOutput, outlineOutput);
- });
-}
-
-Future compilePlatformInternal(
- CompilerContext c, Uri fullOutput, Uri outlineOutput) async {
- if (c.options.strongMode) {
- print("Note: strong mode support is preliminary and may not work.");
- }
- if (c.options.verbose) {
- print("Generating outline of ${c.options.sdkRoot} into $outlineOutput");
- print("Compiling ${c.options.sdkRoot} to $fullOutput");
- }
-
- var result =
- await generateKernelInternal(buildSummary: true, buildProgram: true);
- if (result == null) {
- // Note: an error should have been reported by now.
- print('The platform .dill files were not created.');
- return;
- }
- new File.fromUri(outlineOutput).writeAsBytesSync(result.summary);
- c.options.ticker.logMs("Wrote outline to ${outlineOutput.toFilePath()}");
- await writeProgramToFile(result.program, fullOutput);
- c.options.ticker.logMs("Wrote program to ${fullOutput.toFilePath()}");
-}

Powered by Google App Engine
This is Rietveld 408576698