diff --git a/packages/flutter_tools/gradle/flutter.gradle b/packages/flutter_tools/gradle/flutter.gradle index 79326de9719..34161320b87 100644 --- a/packages/flutter_tools/gradle/flutter.gradle +++ b/packages/flutter_tools/gradle/flutter.gradle @@ -260,14 +260,6 @@ class FlutterPlugin implements Plugin { if (project.hasProperty('preview-dart-2')) { previewDart2Value = project.property('preview-dart-2') } - String[] fileSystemRootsValue = null - if (project.hasProperty('filesystem-roots')) { - fileSystemRootsValue = project.property('filesystem-roots').split('\\|') - } - String fileSystemSchemeValue = null - if (project.hasProperty('filesystem-scheme')) { - fileSystemSchemeValue = project.property('filesystem-scheme') - } Boolean trackWidgetCreationValue = false if (project.hasProperty('track-widget-creation')) { trackWidgetCreationValue = project.property('track-widget-creation') @@ -310,8 +302,6 @@ class FlutterPlugin implements Plugin { localEngineSrcPath this.localEngineSrcPath targetPath target previewDart2 previewDart2Value - fileSystemRoots fileSystemRootsValue - fileSystemScheme fileSystemSchemeValue trackWidgetCreation trackWidgetCreationValue preferSharedLibrary preferSharedLibraryValue targetPlatform targetPlatformValue @@ -330,8 +320,6 @@ class FlutterPlugin implements Plugin { localEngineSrcPath this.localEngineSrcPath targetPath target previewDart2 previewDart2Value - fileSystemRoots fileSystemRootsValue - fileSystemScheme fileSystemSchemeValue trackWidgetCreation trackWidgetCreationValue preferSharedLibrary preferSharedLibraryValue targetPlatform targetPlatformValue @@ -369,10 +357,6 @@ abstract class BaseFlutterTask extends DefaultTask { @Optional @Input Boolean previewDart2 @Optional @Input - String[] fileSystemRoots - @Optional @Input - String fileSystemScheme - @Optional @Input Boolean trackWidgetCreation @Optional @Input Boolean preferSharedLibrary @@ -417,8 +401,8 @@ abstract class BaseFlutterTask extends DefaultTask { if (previewDart2) { args "--preview-dart-2" } else { - args "--no-preview-dart-2" - } + args "--no-preview-dart-2" + } if (trackWidgetCreation) { args "--track-widget-creation" } @@ -452,15 +436,7 @@ abstract class BaseFlutterTask extends DefaultTask { args "--preview-dart-2" } else { args "--no-preview-dart-2" - } - if (fileSystemRoots != null) { - for (root in fileSystemRoots) { - args "--filesystem-root", root - } - } - if (fileSystemScheme != null) { - args "--filesystem-scheme", fileSystemScheme - } + } if (trackWidgetCreation) { args "--track-widget-creation" } diff --git a/packages/flutter_tools/lib/src/android/gradle.dart b/packages/flutter_tools/lib/src/android/gradle.dart index 95ee4de193f..4d2d883d34c 100644 --- a/packages/flutter_tools/lib/src/android/gradle.dart +++ b/packages/flutter_tools/lib/src/android/gradle.dart @@ -303,10 +303,6 @@ Future _buildGradleProjectV2(String gradle, BuildInfo buildInfo, String ta command.add('-Pextra-front-end-options=${buildInfo.extraFrontEndOptions}'); if (buildInfo.extraGenSnapshotOptions != null) command.add('-Pextra-gen-snapshot-options=${buildInfo.extraGenSnapshotOptions}'); - if (buildInfo.fileSystemRoots != null) - command.add('-Pfilesystem-roots=${buildInfo.fileSystemRoots.join('|')}'); - if (buildInfo.fileSystemScheme != null) - command.add('-Pfilesystem-scheme=${buildInfo.fileSystemScheme}'); } if (buildInfo.preferSharedLibrary && androidSdk.ndkCompiler != null) { command.add('-Pprefer-shared-library=true'); diff --git a/packages/flutter_tools/lib/src/build_info.dart b/packages/flutter_tools/lib/src/build_info.dart index 2f9cabf891e..c86d5b73bd4 100644 --- a/packages/flutter_tools/lib/src/build_info.dart +++ b/packages/flutter_tools/lib/src/build_info.dart @@ -17,8 +17,6 @@ class BuildInfo { this.extraGenSnapshotOptions, this.preferSharedLibrary, this.targetPlatform, - this.fileSystemRoots, - this.fileSystemScheme, }); final BuildMode mode; @@ -34,9 +32,6 @@ class BuildInfo { /// Whether build should be done using Dart2 Frontend parser. final bool previewDart2; - final List fileSystemRoots; - final String fileSystemScheme; - /// Whether the build should track widget creation locations. final bool trackWidgetCreation; diff --git a/packages/flutter_tools/lib/src/commands/build_flx.dart b/packages/flutter_tools/lib/src/commands/build_flx.dart index 8a849cae926..c763369cadd 100644 --- a/packages/flutter_tools/lib/src/commands/build_flx.dart +++ b/packages/flutter_tools/lib/src/commands/build_flx.dart @@ -35,18 +35,7 @@ class BuildFlxCommand extends BuildSubCommand { ..addFlag('report-licensed-packages', help: 'Whether to report the names of all the packages that are included ' 'in the application\'s LICENSE file.', - defaultsTo: false) - ..addMultiOption('filesystem-root', - hide: !verboseHelp, - help: 'Specify the path, that is used as root in a virtual file system\n' - 'for compilation. Input file name should be specified as Uri in\n' - 'filesystem-scheme scheme. Use only in Dart 2 mode.\n' - 'Requires --output-dill option to be explicitly specified.\n') - ..addOption('filesystem-scheme', - defaultsTo: 'org-dartlang-root', - hide: !verboseHelp, - help: 'Specify the scheme that is used for virtual file system used in\n' - 'compilation. See more details on filesystem-root option.\n'); + defaultsTo: false); usesPubOption(); } @@ -78,8 +67,6 @@ class BuildFlxCommand extends BuildSubCommand { precompiledSnapshot: argResults['precompiled'], reportLicensedPackages: argResults['report-licensed-packages'], trackWidgetCreation: argResults['track-widget-creation'], - fileSystemScheme: argResults['filesystem-scheme'], - fileSystemRoots: argResults['filesystem-root'], ); } } diff --git a/packages/flutter_tools/lib/src/commands/run.dart b/packages/flutter_tools/lib/src/commands/run.dart index cb817a4dc81..f4eebbdec11 100644 --- a/packages/flutter_tools/lib/src/commands/run.dart +++ b/packages/flutter_tools/lib/src/commands/run.dart @@ -172,18 +172,7 @@ class RunCommand extends RunCommandBase { help: 'Specify the path to frontend server output kernel file.', ) ..addOption(FlutterOptions.kExtraFrontEndOptions, hide: true) - ..addOption(FlutterOptions.kExtraGenSnapshotOptions, hide: true) - ..addMultiOption('filesystem-root', - hide: !verboseHelp, - help: 'Specify the path, that is used as root in a virtual file system\n' - 'for compilation. Input file name should be specified as Uri in\n' - 'filesystem-scheme scheme. Use only in Dart 2 mode.\n' - 'Requires --output-dill option to be explicitly specified.\n') - ..addOption('filesystem-scheme', - defaultsTo: 'org-dartlang-root', - hide: !verboseHelp, - help: 'Specify the scheme that is used for virtual file system used in\n' - 'compilation. See more details on filesystem-root option.\n'); + ..addOption(FlutterOptions.kExtraGenSnapshotOptions, hide: true); } List devices; @@ -356,8 +345,6 @@ class RunCommand extends RunCommandBase { previewDart2: argResults['preview-dart-2'], trackWidgetCreation: argResults['track-widget-creation'], dillOutputPath: argResults['output-dill'], - fileSystemRoots: argResults['filesystem-root'], - fileSystemScheme: argResults['filesystem-scheme'], ); }).toList(); diff --git a/packages/flutter_tools/lib/src/compile.dart b/packages/flutter_tools/lib/src/compile.dart index be6623441b7..7c15e91f682 100644 --- a/packages/flutter_tools/lib/src/compile.dart +++ b/packages/flutter_tools/lib/src/compile.dart @@ -55,9 +55,7 @@ Future compile( bool trackWidgetCreation: false, List extraFrontEndOptions, String incrementalCompilerByteStorePath, - String packagesPath, - List fileSystemRoots, - String fileSystemScheme}) async { + String packagesPath}) async { final String frontendServer = artifacts.getArtifactPath( Artifact.frontendServerSnapshotForEngineDartSdk ); @@ -95,17 +93,9 @@ Future compile( if (outputFilePath != null) { command.addAll(['--output-dill', outputFilePath]); } - if (depFilePath != null && (fileSystemRoots == null || fileSystemRoots.isEmpty)) { + if (depFilePath != null) { command.addAll(['--depfile', depFilePath]); } - if (fileSystemRoots != null) { - for (String root in fileSystemRoots) { - command.addAll(['--filesystem-root', root]); - } - } - if (fileSystemScheme != null) { - command.addAll(['--filesystem-scheme', fileSystemScheme]); - } if (extraFrontEndOptions != null) command.addAll(extraFrontEndOptions); @@ -137,13 +127,10 @@ Future compile( /// restarts the Flutter app. class ResidentCompiler { ResidentCompiler(this._sdkRoot, {bool trackWidgetCreation: false, - String packagesPath, List fileSystemRoots, String fileSystemScheme , - CompilerMessageConsumer compilerMessageConsumer: printError}) + String packagesPath, CompilerMessageConsumer compilerMessageConsumer: printError}) : assert(_sdkRoot != null), _trackWidgetCreation = trackWidgetCreation, _packagesPath = packagesPath, - _fileSystemRoots = fileSystemRoots, - _fileSystemScheme = fileSystemScheme, stdoutHandler = new _StdoutHandler(consumer: compilerMessageConsumer) { // This is a URI, not a file path, so the forward slash is correct even on Windows. if (!_sdkRoot.endsWith('/')) @@ -152,8 +139,6 @@ class ResidentCompiler { final bool _trackWidgetCreation; final String _packagesPath; - final List _fileSystemRoots; - final String _fileSystemScheme; String _sdkRoot; Process _server; final _StdoutHandler stdoutHandler; @@ -172,13 +157,11 @@ class ResidentCompiler { // First time recompile is called we actually have to compile the app from // scratch ignoring list of invalidated files. if (_server == null) - return _compile(_mapFilename(mainPath), outputPath, _mapFilename(packagesFilePath)); + return _compile(mainPath, outputPath, packagesFilePath); final String inputKey = new Uuid().generateV4(); - _server.stdin.writeln('recompile ${mainPath != null ? _mapFilename(mainPath) + " ": ""}$inputKey'); - for (String filePath in invalidatedFiles) { - _server.stdin.writeln(_mapFilename(filePath)); - } + _server.stdin.writeln('recompile ${mainPath != null ? mainPath + " ": ""}$inputKey'); + invalidatedFiles.forEach(_server.stdin.writeln); _server.stdin.writeln(inputKey); return stdoutHandler.outputFilename.future; @@ -209,14 +192,6 @@ class ResidentCompiler { if (_packagesPath != null) { args.addAll(['--packages', _packagesPath]); } - if (_fileSystemRoots != null) { - for (String root in _fileSystemRoots) { - args.addAll(['--filesystem-root', root]); - } - } - if (_fileSystemScheme != null) { - args.addAll(['--filesystem-scheme', _fileSystemScheme]); - } _server = await processManager.start(args); _server.stdout .transform(utf8.decoder) @@ -263,19 +238,6 @@ class ResidentCompiler { _server.stdin.writeln('reset'); } - String _mapFilename(String filename) { - if (_fileSystemRoots != null) { - for (String root in _fileSystemRoots) { - if (filename.startsWith(root)) { - return new Uri( - scheme: _fileSystemScheme, path: filename.substring(root.length)) - .toString(); - } - } - } - return filename; - } - Future shutdown() { _server.kill(); return _server.exitCode; diff --git a/packages/flutter_tools/lib/src/devfs.dart b/packages/flutter_tools/lib/src/devfs.dart index 40446d17177..4af38acc05b 100644 --- a/packages/flutter_tools/lib/src/devfs.dart +++ b/packages/flutter_tools/lib/src/devfs.dart @@ -487,7 +487,7 @@ class DevFS { final DevFSContent content = dirtyEntries[uri]; if (content is DevFSFileContent) { filesUris.add(uri); - invalidatedFiles.add(content.file.path); + invalidatedFiles.add(content.file.uri.toString()); numBytes -= content.size; } } diff --git a/packages/flutter_tools/lib/src/flx.dart b/packages/flutter_tools/lib/src/flx.dart index f02ad9a4ab2..b7b8236e88c 100644 --- a/packages/flutter_tools/lib/src/flx.dart +++ b/packages/flutter_tools/lib/src/flx.dart @@ -44,8 +44,6 @@ Future build({ bool precompiledSnapshot: false, bool reportLicensedPackages: false, bool trackWidgetCreation: false, - List fileSystemRoots, - String fileSystemScheme, }) async { outputPath ??= defaultFlxOutputPath; snapshotPath ??= defaultSnapshotPath; @@ -84,9 +82,6 @@ Future build({ outputFilePath: applicationKernelFilePath, depFilePath: depfilePath, trackWidgetCreation: trackWidgetCreation, - fileSystemRoots: fileSystemRoots, - fileSystemScheme: fileSystemScheme, - packagesPath: packagesPath, ); if (kernelBinaryFilename == null) { throwToolExit('Compiler terminated unexpectedly on $mainPath'); diff --git a/packages/flutter_tools/lib/src/resident_runner.dart b/packages/flutter_tools/lib/src/resident_runner.dart index 835fe227611..3abc1525ad4 100644 --- a/packages/flutter_tools/lib/src/resident_runner.dart +++ b/packages/flutter_tools/lib/src/resident_runner.dart @@ -36,8 +36,6 @@ class FlutterDevice { ApplicationPackage package; ResidentCompiler generator; String dillOutputPath; - List fileSystemRoots; - String fileSystemScheme; StreamSubscription _loggingSubscription; @@ -45,14 +43,11 @@ class FlutterDevice { @required bool previewDart2, @required bool trackWidgetCreation, this.dillOutputPath, - this.fileSystemRoots, - this.fileSystemScheme, }) { if (previewDart2) { generator = new ResidentCompiler( artifacts.getArtifactPath(Artifact.flutterPatchedSdkPath), trackWidgetCreation: trackWidgetCreation, - fileSystemRoots: fileSystemRoots, fileSystemScheme: fileSystemScheme ); } } diff --git a/packages/flutter_tools/lib/src/run_hot.dart b/packages/flutter_tools/lib/src/run_hot.dart index a84708c8b5e..db0e1193ac8 100644 --- a/packages/flutter_tools/lib/src/run_hot.dart +++ b/packages/flutter_tools/lib/src/run_hot.dart @@ -392,7 +392,7 @@ class HotRunner extends ResidentRunner { // We are now running from source. _runningFromSnapshot = false; final String launchPath = debuggingOptions.buildInfo.previewDart2 - ? mainPath + '.dill' + ? dillOutputPath ?? mainPath + '.dill' : mainPath; await _launchFromDevFS(launchPath); restartTimer.stop(); diff --git a/packages/flutter_tools/lib/src/runner/flutter_command.dart b/packages/flutter_tools/lib/src/runner/flutter_command.dart index c65e9a7ac00..cd50e616d29 100644 --- a/packages/flutter_tools/lib/src/runner/flutter_command.dart +++ b/packages/flutter_tools/lib/src/runner/flutter_command.dart @@ -61,8 +61,6 @@ class FlutterCommandResult { class FlutterOptions { static const String kExtraFrontEndOptions = 'extra-front-end-options'; static const String kExtraGenSnapshotOptions = 'extra-gen-snapshot-options'; - static const String kFileSystemRoot = 'filesystem-root'; - static const String kFileSystemScheme = 'filesystem-scheme'; } abstract class FlutterCommand extends Command { @@ -196,12 +194,7 @@ abstract class FlutterCommand extends Command { preferSharedLibrary: argParser.options.containsKey('prefer-shared-library') ? argResults['prefer-shared-library'] : false, - targetPlatform: targetPlatform, - fileSystemRoots: argParser.options.containsKey(FlutterOptions.kFileSystemRoot) - ? argResults[FlutterOptions.kFileSystemRoot] : null, - fileSystemScheme: argParser.options.containsKey(FlutterOptions.kFileSystemScheme) - ? argResults[FlutterOptions.kFileSystemScheme] : null, - ); + targetPlatform: targetPlatform); } void setupApplicationPackages() { diff --git a/packages/flutter_tools/test/compile_test.dart b/packages/flutter_tools/test/compile_test.dart index 3eb6c4d19bf..45e0bb9e676 100644 --- a/packages/flutter_tools/test/compile_test.dart +++ b/packages/flutter_tools/test/compile_test.dart @@ -227,7 +227,7 @@ Future _recompile(StreamController> streamController, final String output = await generator.recompile(null /* mainPath */, ['/path/to/main.dart']); expect(output, equals('/path/to/main.dart.dill')); final String commands = mockFrontendServerStdIn.getAndClear(); - final RegExp re = new RegExp('^recompile (.*)\\n/path/to/main.dart\\n(.*)\\n\$'); + final RegExp re = new RegExp(r'^recompile (.*)\n/path/to/main.dart\n(.*)\n$'); expect(commands, matches(re)); final Match match = re.firstMatch(commands); expect(match[1] == match[2], isTrue);