mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 01:30:32 +00:00
Remove unused package-root option and configuration from dart2js
Related to https://github.com/dart-lang/sdk/issues/41197 Change-Id: I4681139b5fe9d2d3d49c69796cf8a3c277753bee Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140980 Commit-Queue: Kevin Moore <kevmoo@google.com> Reviewed-by: Sigmund Cherem <sigmund@google.com> Auto-Submit: Kevin Moore <kevmoo@google.com>
This commit is contained in:
parent
fcc43457b3
commit
b3522564d9
|
@ -89,12 +89,8 @@ class CompilationResult {
|
|||
/// to the compiled script. This behavior will be removed in the future
|
||||
/// as the compiler may create multiple files to support lazy loading
|
||||
/// of libraries.
|
||||
Future<CompilationResult> compile(
|
||||
Uri script,
|
||||
Uri librariesSpecificationUri,
|
||||
Uri packageRoot,
|
||||
CompilerInputProvider inputProvider,
|
||||
DiagnosticHandler handler,
|
||||
Future<CompilationResult> compile(Uri script, Uri librariesSpecificationUri,
|
||||
CompilerInputProvider inputProvider, DiagnosticHandler handler,
|
||||
[List<String> options = const [],
|
||||
CompilerOutputProvider outputProvider,
|
||||
Map<String, String> environment = const {},
|
||||
|
@ -102,7 +98,6 @@ Future<CompilationResult> compile(
|
|||
CompilerOptions compilerOptions = CompilerOptions.parse(options,
|
||||
librariesSpecificationUri: librariesSpecificationUri)
|
||||
..entryPoint = script
|
||||
..packageRoot = packageRoot
|
||||
..packageConfig = packageConfig
|
||||
..environment = environment;
|
||||
|
||||
|
|
|
@ -113,7 +113,6 @@ Future<api.CompilationResult> compile(List<String> argv,
|
|||
int codegenShards;
|
||||
List<String> bazelPaths;
|
||||
Uri packageConfig = null;
|
||||
Uri packageRoot = null;
|
||||
List<String> options = new List<String>();
|
||||
bool wantHelp = false;
|
||||
bool wantVersion = false;
|
||||
|
@ -145,10 +144,6 @@ Future<api.CompilationResult> compile(List<String> argv,
|
|||
Uri.base.resolve(extractPath(argument, isDirectory: false));
|
||||
}
|
||||
|
||||
void setPackageRoot(String argument) {
|
||||
packageRoot = Uri.base.resolve(extractPath(argument));
|
||||
}
|
||||
|
||||
void setPackageConfig(String argument) {
|
||||
packageConfig = Uri.base.resolve(extractPath(argument, isDirectory: false));
|
||||
}
|
||||
|
@ -434,7 +429,6 @@ Future<api.CompilationResult> compile(List<String> argv,
|
|||
new OptionHandler(Flags.trustJSInteropTypeAnnotations, passThrough),
|
||||
new OptionHandler(r'--help|/\?|/h', (_) => wantHelp = true),
|
||||
new OptionHandler('--packages=.+', setPackageConfig),
|
||||
new OptionHandler('--package-root=.+|-p.+', setPackageRoot),
|
||||
new OptionHandler(Flags.noSourceMaps, passThrough),
|
||||
new OptionHandler(Option.resolutionInput, ignoreOption),
|
||||
new OptionHandler(Option.bazelPaths, setBazelPaths),
|
||||
|
@ -570,10 +564,6 @@ Future<api.CompilationResult> compile(List<String> argv,
|
|||
"checked mode.");
|
||||
}
|
||||
|
||||
if (packageRoot != null && packageConfig != null) {
|
||||
helpAndFail("Cannot specify both '--package-root' and '--packages.");
|
||||
}
|
||||
|
||||
String scriptName = arguments[0];
|
||||
|
||||
switch (writeStrategy) {
|
||||
|
@ -773,7 +763,6 @@ Future<api.CompilationResult> compile(List<String> argv,
|
|||
onError: (String message) => fail(message),
|
||||
onWarning: (String message) => print(message))
|
||||
..entryPoint = script
|
||||
..packageRoot = packageRoot
|
||||
..packageConfig = packageConfig
|
||||
..environment = environment
|
||||
..kernelInitializedCompilerState = kernelInitializedCompilerState
|
||||
|
|
|
@ -42,11 +42,6 @@ class CompilerOptions implements DiagnosticOptions {
|
|||
/// The entry point of the application that is being compiled.
|
||||
Uri entryPoint;
|
||||
|
||||
/// Package root location.
|
||||
///
|
||||
/// If not null then [packageConfig] should be null.
|
||||
Uri packageRoot;
|
||||
|
||||
/// Location of the package configuration file.
|
||||
///
|
||||
/// If not null then [packageRoot] should be null.
|
||||
|
@ -492,13 +487,6 @@ class CompilerOptions implements DiagnosticOptions {
|
|||
throw new ArgumentError(
|
||||
"[librariesSpecificationUri] should be a file: $librariesSpecificationUri");
|
||||
}
|
||||
if (packageRoot != null && packageConfig != null) {
|
||||
throw new ArgumentError("Only one of [packageRoot] or [packageConfig] "
|
||||
"may be given.");
|
||||
}
|
||||
if (packageRoot != null && !packageRoot.path.endsWith("/")) {
|
||||
throw new ArgumentError("[packageRoot] must end with a /");
|
||||
}
|
||||
if (platformBinaries == null &&
|
||||
equalMaps(languageExperiments, fe.defaultExperimentalFlags)) {
|
||||
throw new ArgumentError("Missing required ${Flags.platformBinaries}");
|
||||
|
|
|
@ -49,13 +49,11 @@ main() {
|
|||
|
||||
// Find the path to sdk/ in the repo relative to this script.
|
||||
Uri librariesSpec = Uri.base.resolve('sdk/lib/libraries.json');
|
||||
Uri packageRoot = Uri.base.resolve('packages/');
|
||||
var platformDir =
|
||||
Uri.parse(nativeToUriPath(Platform.resolvedExecutable)).resolve('.');
|
||||
asyncTest(() => compiler.compile(
|
||||
entrypoint,
|
||||
librariesSpec,
|
||||
packageRoot,
|
||||
provideInput,
|
||||
handleDiagnostic,
|
||||
['--platform-binaries=${platformDir}']).then((code) {
|
||||
|
|
|
@ -73,7 +73,6 @@ Future<CompilationResult> runCompiler(
|
|||
List<String> options: const <String>[],
|
||||
bool showDiagnostics: true,
|
||||
Uri librariesSpecificationUri,
|
||||
Uri packageRoot,
|
||||
Uri packageConfig,
|
||||
void beforeRun(CompilerImpl compiler)}) async {
|
||||
if (entryPoint == null) {
|
||||
|
@ -87,7 +86,6 @@ Future<CompilationResult> runCompiler(
|
|||
options: options,
|
||||
showDiagnostics: showDiagnostics,
|
||||
librariesSpecificationUri: librariesSpecificationUri,
|
||||
packageRoot: packageRoot,
|
||||
packageConfig: packageConfig);
|
||||
if (beforeRun != null) {
|
||||
beforeRun(compiler);
|
||||
|
@ -107,12 +105,11 @@ CompilerImpl compilerFor(
|
|||
List<String> options: const <String>[],
|
||||
bool showDiagnostics: true,
|
||||
Uri librariesSpecificationUri,
|
||||
Uri packageRoot,
|
||||
Uri packageConfig}) {
|
||||
retainDataForTesting = true;
|
||||
librariesSpecificationUri ??= Uri.base.resolve('sdk/lib/libraries.json');
|
||||
|
||||
if (packageRoot == null && packageConfig == null) {
|
||||
if (packageConfig == null) {
|
||||
if (Platform.packageConfig != null) {
|
||||
packageConfig = Uri.base.resolve(Platform.packageConfig);
|
||||
} else {
|
||||
|
@ -135,7 +132,6 @@ CompilerImpl compilerFor(
|
|||
CompilerOptions compilerOptions = CompilerOptions.parse(options,
|
||||
librariesSpecificationUri: librariesSpecificationUri)
|
||||
..entryPoint = entryPoint
|
||||
..packageRoot = packageRoot
|
||||
..environment = {}
|
||||
..packageConfig = packageConfig;
|
||||
compilerOptions.kernelInitializedCompilerState =
|
||||
|
|
|
@ -58,12 +58,8 @@ void handler(Uri uri, int begin, int end, String message, Diagnostic kind) {
|
|||
|
||||
main() {
|
||||
asyncStart();
|
||||
Future<CompilationResult> result = compile(
|
||||
new Uri(scheme: 'main'),
|
||||
new Uri(scheme: 'lib', path: '/'),
|
||||
new Uri(scheme: 'package', path: '/'),
|
||||
provider,
|
||||
handler);
|
||||
Future<CompilationResult> result = compile(new Uri(scheme: 'main'),
|
||||
new Uri(scheme: 'lib', path: '/'), provider, handler);
|
||||
result.then((CompilationResult result) {
|
||||
if (!result.isSuccess) {
|
||||
throw 'Compilation failed';
|
||||
|
|
Loading…
Reference in a new issue