ef3ac59dd6
This ports a fairly large part of DDC's Analyzer-based code generator, however most nodes are not supported yet. The goal is to preserve all functionality of code that was ported, except for deprecated features (e.g. mirrors, fuzzy arrows, libraryRoot). Change-Id: I3b10d5773c7c10a740fa336720243b03c6b82529 Reviewed-on: https://dart-review.googlesource.com/10705 Reviewed-by: Vijay Menon <vsm@google.com>
33 lines
1.2 KiB
Dart
33 lines
1.2 KiB
Dart
#!/usr/bin/env dart
|
|
// Copyright (c) 2017, 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.
|
|
|
|
import 'dart:async';
|
|
import 'dart:io';
|
|
import 'package:dev_compiler/src/kernel/target.dart';
|
|
import 'package:front_end/compiler_options.dart';
|
|
import 'package:front_end/kernel_generator.dart';
|
|
import 'package:kernel/kernel.dart';
|
|
import 'package:path/path.dart' as path;
|
|
|
|
Future main(List<String> args) async {
|
|
Directory.current = path.dirname(path.dirname(path.fromUri(Platform.script)));
|
|
var target = new DevCompilerTarget();
|
|
|
|
var options = new CompilerOptions()
|
|
..compileSdk = true
|
|
..chaseDependencies = true
|
|
..packagesFileUri = path.toUri(path.absolute('../../.packages'))
|
|
..sdkRoot = path.toUri(path.absolute('tool/input_sdk'))
|
|
..target = target;
|
|
|
|
var inputs = target.extraRequiredLibraries.map(Uri.parse).toList();
|
|
var program = await kernelForBuildUnit(inputs, options);
|
|
|
|
// Useful for debugging:
|
|
// writeProgramToText(program);
|
|
var output = path.absolute('lib/sdk/ddc_sdk.dill');
|
|
await writeProgramToBinary(program, output);
|
|
}
|