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

Unified Diff: pkg/dev_compiler/tool/global_compile.dart

Issue 2363053003: Update global_compile tool (Closed)
Patch Set: Format Created 4 years, 3 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
« no previous file with comments | « pkg/dev_compiler/lib/src/compiler/reify_coercions.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/tool/global_compile.dart
diff --git a/pkg/dev_compiler/tool/global_compile.dart b/pkg/dev_compiler/tool/global_compile.dart
index cded0c71ab42a742cd161e8336771612ce074c28..b604099ec885d912df9c29c9415186a3d1fb2867 100644
--- a/pkg/dev_compiler/tool/global_compile.dart
+++ b/pkg/dev_compiler/tool/global_compile.dart
@@ -28,6 +28,8 @@ void main(List<String> args) {
defaultsTo: 'out.js')
..addFlag('unsafe-force-compile',
help: 'Generate code with undefined behavior', negatable: false)
+ ..addFlag('emit-metadata',
+ help: 'Preserve annotations in generated code', negatable: false)
..addOption('package-root',
help: 'Directory containing packages',
abbr: 'p',
@@ -47,16 +49,22 @@ void main(List<String> args) {
var unsafe = options['unsafe-force-compile'] as bool;
var log = options['log'] as bool;
var tmp = options['tmp'] as String;
+ var metadata = options['emit-metadata'] as bool;
// Build an invocation to dartdevc
var dartPath = Platform.resolvedExecutable;
var ddcPath = path.dirname(path.dirname(Platform.script.toFilePath()));
var template = [
'$ddcPath/bin/dartdevc.dart',
- '--no-source-map', // Invalid as we're just concatenating files below
+ '--modules=legacy', // TODO(vsm): Change this to use common format.
+ '--single-out-file',
+ '--inline-source-map',
'-p',
packageRoot
];
+ if (metadata) {
+ template.add('--emit-metadata');
+ }
if (unsafe) {
template.add('--unsafe-force-compile');
}
@@ -78,11 +86,12 @@ void main(List<String> args) {
// Prepend Dart runtime files to the output
var out = new File(outfile);
var dartLibrary =
- new File(path.join(ddcPath, 'lib', 'runtime', 'dart_library.js'))
+ new File(path.join(ddcPath, 'lib', 'js', 'legacy', 'dart_library.js'))
.readAsStringSync();
out.writeAsStringSync(dartLibrary);
- var dartSdk = new File(path.join(ddcPath, 'lib', 'runtime', 'dart_sdk.js'))
- .readAsStringSync();
+ var dartSdk =
+ new File(path.join(ddcPath, 'lib', 'js', 'legacy', 'dart_sdk.js'))
+ .readAsStringSync();
out.writeAsStringSync(dartSdk, mode: FileMode.APPEND);
// Linearize module concatenation for deterministic output
« no previous file with comments | « pkg/dev_compiler/lib/src/compiler/reify_coercions.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698