| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library fasta.compile_platform; | 5 library fasta.compile_platform; |
| 6 | 6 |
| 7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
| 8 | 8 |
| 9 import 'dart:io' show File, IOSink; | 9 import 'dart:io' show File, IOSink; |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 null, | 53 null, |
| 54 null, | 54 null, |
| 55 "The environment variable '$name' has the value '$value', " | 55 "The environment variable '$name' has the value '$value', " |
| 56 "that's a directory that contains '$asyncSources', so it isn't a " | 56 "that's a directory that contains '$asyncSources', so it isn't a " |
| 57 "patched SDK. $what"); | 57 "patched SDK. $what"); |
| 58 } | 58 } |
| 59 return null; | 59 return null; |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 | 62 |
| 63 main(List<String> arguments) async { | 63 mainEntryPoint(List<String> arguments) async { |
| 64 Uri output = Uri.base.resolveUri(new Uri.file(arguments.single)); | 64 Uri output = Uri.base.resolveUri(new Uri.file(arguments.single)); |
| 65 DartOptions options = new DartOptions( | 65 DartOptions options = new DartOptions( |
| 66 strongMode: false, sdk: await dartAotSdk.value, packagePath: null); | 66 strongMode: false, sdk: await dartAotSdk.value, packagePath: null); |
| 67 Program program = new Program(); | 67 Program program = new Program(); |
| 68 DartLoader loader = new DartLoader(program, options, null, | 68 DartLoader loader = new DartLoader(program, options, null, |
| 69 ignoreRedirectingFactories: false, | 69 ignoreRedirectingFactories: false, |
| 70 dartSdk: createDartSdk(options.sdk, strongMode: options.strongMode)); | 70 dartSdk: createDartSdk(options.sdk, strongMode: options.strongMode)); |
| 71 Target target = | 71 Target target = |
| 72 getTarget("vm", new TargetFlags(strongMode: options.strongMode)); | 72 getTarget("vm", new TargetFlags(strongMode: options.strongMode)); |
| 73 loader.loadProgram(Uri.base.resolve("pkg/fasta/test/platform.dart"), | 73 loader.loadProgram(Uri.base.resolve("pkg/fasta/test/platform.dart"), |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 isConst: true, | 110 isConst: true, |
| 111 initializer: literal, | 111 initializer: literal, |
| 112 fileUri: "${new Uri.file(source.fullName)}")..fileOffset = offset); | 112 fileUri: "${new Uri.file(source.fullName)}")..fileOffset = offset); |
| 113 } | 113 } |
| 114 } | 114 } |
| 115 | 115 |
| 116 IOSink sink = new File.fromUri(output).openWrite(); | 116 IOSink sink = new File.fromUri(output).openWrite(); |
| 117 new BinaryPrinter(sink).writeProgramFile(program); | 117 new BinaryPrinter(sink).writeProgramFile(program); |
| 118 await sink.close(); | 118 await sink.close(); |
| 119 } | 119 } |
| OLD | NEW |