blob: 30d715b487ae7c72bcd2a9ef412d1ed4c5ec13d6 [file] [log] [blame]
// 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.
import 'dart:io';
import 'package:args/args.dart';
import 'package:compiler/src/filenames.dart';
import 'package:compiler/src/dart2js_resolver.dart';
main(var argv) async {
var parser = new ArgParser();
parser.addOption('deps', abbr: 'd', allowMultiple: true);
parser.addOption('out', abbr: 'o');
parser.addOption('library-root', abbr: 'l');
parser.addOption('packages', abbr: 'p');
parser.addOption('bazel-paths', abbr: 'I', allowMultiple: true);
var args = parser.parse(argv);
if ( {
print('missing input files');
var inputs =
.map((uri) => currentDirectory.resolve(nativeToUriPath(uri)))
var text = await resolve(inputs,
deps: args['deps'],
root: args['library-root'],
packages: args['packages'],
bazelSearchPaths: args['bazel-paths']);
var outFile = args['out'] ?? '';
await new File(outFile).writeAsString(text);