[flutter_tools] remove globals from plist parser and update tests (#51444)

This commit is contained in:
Jonah Williams
2020-02-26 18:31:42 -08:00
committed by GitHub
parent d4226566d4
commit 80619f100f
12 changed files with 131 additions and 105 deletions

View File

@@ -41,14 +41,14 @@ class AndroidStudio implements Comparable<AndroidStudio> {
factory AndroidStudio.fromMacOSBundle(String bundlePath) {
String studioPath = globals.fs.path.join(bundlePath, 'Contents');
String plistFile = globals.fs.path.join(studioPath, 'Info.plist');
Map<String, dynamic> plistValues = PlistParser.instance.parseFile(plistFile);
Map<String, dynamic> plistValues = globals.plistParser.parseFile(plistFile);
// As AndroidStudio managed by JetBrainsToolbox could have a wrapper pointing to the real Android Studio.
// Check if we've found a JetBrainsToolbox wrapper and deal with it properly.
final String jetBrainsToolboxAppBundlePath = plistValues['JetBrainsToolboxApp'] as String;
if (jetBrainsToolboxAppBundlePath != null) {
studioPath = globals.fs.path.join(jetBrainsToolboxAppBundlePath, 'Contents');
plistFile = globals.fs.path.join(studioPath, 'Info.plist');
plistValues = PlistParser.instance.parseFile(plistFile);
plistValues = globals.plistParser.parseFile(plistFile);
}
final String versionString = plistValues[PlistParser.kCFBundleShortVersionStringKey] as String;