Expose packagePath as a getter in FlutterCommand. (#80026)
This commit is contained in:
@@ -15,6 +15,7 @@ import 'package:flutter_tools/src/base/file_system.dart';
|
||||
import 'package:flutter_tools/src/base/io.dart';
|
||||
import 'package:flutter_tools/src/base/signals.dart';
|
||||
import 'package:flutter_tools/src/base/time.dart';
|
||||
import 'package:flutter_tools/src/build_info.dart';
|
||||
import 'package:flutter_tools/src/cache.dart';
|
||||
import 'package:flutter_tools/src/dart/pub.dart';
|
||||
import 'package:flutter_tools/src/reporting/reporting.dart';
|
||||
@@ -540,6 +541,12 @@ void main() {
|
||||
FileSystem: () => MemoryFileSystem.test(),
|
||||
ProcessManager: () => FakeProcessManager.any(),
|
||||
});
|
||||
|
||||
testUsingContext('use packagesPath to generate BuildInfo', () async {
|
||||
final DummyFlutterCommand flutterCommand = DummyFlutterCommand(packagesPath: 'foo');
|
||||
final BuildInfo buildInfo = await flutterCommand.getBuildInfo(forcedBuildMode: BuildMode.debug);
|
||||
expect(buildInfo.packagesPath, 'foo');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ class DummyFlutterCommand extends FlutterCommand {
|
||||
this.noUsagePath = false,
|
||||
this.name = 'dummy',
|
||||
this.commandFunction,
|
||||
this.packagesPath,
|
||||
});
|
||||
|
||||
final bool noUsagePath;
|
||||
@@ -36,4 +37,7 @@ class DummyFlutterCommand extends FlutterCommand {
|
||||
Future<FlutterCommandResult> runCommand() async {
|
||||
return commandFunction == null ? FlutterCommandResult.fail() : await commandFunction();
|
||||
}
|
||||
|
||||
@override
|
||||
final String packagesPath;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user