mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 04:37:12 +00:00
Remove warning about inferring packages URI from dart2js
Change-Id: I37ee171b0359e1fa6720d7af9e403f4dfab76e9e Reviewed-on: https://dart-review.googlesource.com/c/79480 Auto-Submit: Peter von der Ahé <ahe@google.com> Commit-Queue: Johnni Winther <johnniwinther@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
parent
18110717fe
commit
ddf67772bb
|
@ -7,6 +7,7 @@ library dart2js.cmdline;
|
||||||
import 'dart:async' show Future;
|
import 'dart:async' show Future;
|
||||||
import 'dart:convert' show utf8, LineSplitter;
|
import 'dart:convert' show utf8, LineSplitter;
|
||||||
import 'dart:io' show exit, File, FileMode, Platform, stdin, stderr;
|
import 'dart:io' show exit, File, FileMode, Platform, stdin, stderr;
|
||||||
|
import 'dart:isolate' show Isolate;
|
||||||
|
|
||||||
import 'package:front_end/src/api_unstable/dart2js.dart' as fe;
|
import 'package:front_end/src/api_unstable/dart2js.dart' as fe;
|
||||||
import 'package:package_config/discovery.dart' show findPackages;
|
import 'package:package_config/discovery.dart' show findPackages;
|
||||||
|
@ -20,7 +21,7 @@ import 'util/command_line.dart';
|
||||||
import 'util/uri_extras.dart';
|
import 'util/uri_extras.dart';
|
||||||
import 'util/util.dart' show stackTraceFilePrefix;
|
import 'util/util.dart' show stackTraceFilePrefix;
|
||||||
|
|
||||||
const String LIBRARY_ROOT = '../../../../../sdk';
|
const String LIBRARY_ROOT = '../../../../sdk';
|
||||||
const String OUTPUT_LANGUAGE_DART = 'Dart';
|
const String OUTPUT_LANGUAGE_DART = 'Dart';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -561,9 +562,13 @@ void fail(String message) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<api.CompilationResult> compilerMain(List<String> arguments,
|
Future<api.CompilationResult> compilerMain(List<String> arguments,
|
||||||
{fe.InitializedCompilerState kernelInitializedCompilerState}) {
|
{fe.InitializedCompilerState kernelInitializedCompilerState}) async {
|
||||||
var root = uriPathToNative("/$LIBRARY_ROOT");
|
Uri script = Platform.script;
|
||||||
arguments = <String>['--library-root=${Platform.script.toFilePath()}$root']
|
if (script.isScheme("package")) {
|
||||||
|
script = await Isolate.resolvePackageUri(script);
|
||||||
|
}
|
||||||
|
Uri libraryRoot = script.resolve(LIBRARY_ROOT);
|
||||||
|
arguments = <String>['--library-root=${libraryRoot.toFilePath()}']
|
||||||
..addAll(arguments);
|
..addAll(arguments);
|
||||||
return compile(arguments,
|
return compile(arguments,
|
||||||
kernelInitializedCompilerState: kernelInitializedCompilerState);
|
kernelInitializedCompilerState: kernelInitializedCompilerState);
|
||||||
|
|
|
@ -50,6 +50,6 @@ fi
|
||||||
|
|
||||||
DART_ROOT="$(cd "${SDK_DIR}/.." ; pwd -P)"
|
DART_ROOT="$(cd "${SDK_DIR}/.." ; pwd -P)"
|
||||||
|
|
||||||
DART2JS="$DART_ROOT/pkg/compiler/lib/src/dart2js.dart"
|
DART2JS="package:compiler/src/dart2js.dart"
|
||||||
|
|
||||||
exec "$DART" "--packages=$DART_ROOT/.packages" "${EXTRA_VM_OPTIONS[@]}" "$DART2JS" "${EXTRA_OPTIONS[@]}" "$@"
|
exec "$DART" "--packages=$DART_ROOT/.packages" "${EXTRA_VM_OPTIONS[@]}" "$DART2JS" "${EXTRA_OPTIONS[@]}" "$@"
|
||||||
|
|
Loading…
Reference in a new issue