Add MultiRootFileSystem to better support using --filesystem-root. (#82991)

This commit is contained in:
Lau Ching Jun
2021-05-24 22:04:02 -07:00
committed by GitHub
parent bfff43cf6f
commit fdb1fb184d
10 changed files with 511 additions and 18 deletions

View File

@@ -289,6 +289,22 @@ abstract class FlutterCommand extends Command<void> {
/// This can be overridden by some of its subclasses.
String get packagesPath => globalResults['packages'] as String;
/// The value of the `--filesystem-scheme` argument.
///
/// This can be overridden by some of its subclasses.
String get fileSystemScheme =>
argParser.options.containsKey(FlutterOptions.kFileSystemScheme)
? stringArg(FlutterOptions.kFileSystemScheme)
: null;
/// The values of the `--filesystem-root` argument.
///
/// This can be overridden by some of its subclasses.
List<String> get fileSystemRoots =>
argParser.options.containsKey(FlutterOptions.kFileSystemRoot)
? stringsArg(FlutterOptions.kFileSystemRoot)
: null;
void usesPubOption({bool hide = false}) {
argParser.addFlag('pub',
defaultsTo: true,
@@ -1032,12 +1048,8 @@ abstract class FlutterCommand extends Command<void> {
extraGenSnapshotOptions: extraGenSnapshotOptions?.isNotEmpty ?? false
? extraGenSnapshotOptions
: null,
fileSystemRoots: argParser.options.containsKey(FlutterOptions.kFileSystemRoot)
? stringsArg(FlutterOptions.kFileSystemRoot)
: null,
fileSystemScheme: argParser.options.containsKey(FlutterOptions.kFileSystemScheme)
? stringArg(FlutterOptions.kFileSystemScheme)
: null,
fileSystemRoots: fileSystemRoots,
fileSystemScheme: fileSystemScheme,
buildNumber: buildNumber,
buildName: argParser.options.containsKey('build-name')
? stringArg('build-name')