Reland: fix android studio 4.1 plugin path for mac (#69954)
This commit is contained in:
@@ -66,14 +66,28 @@ class AndroidStudio implements Comparable<AndroidStudio> {
|
||||
pathsSelectorValue = jvmProperties['idea.paths.selector'] as String;
|
||||
}
|
||||
}
|
||||
final String presetPluginsPath = pathsSelectorValue == null
|
||||
? null
|
||||
: globals.fs.path.join(
|
||||
globals.fsUtils.homeDirPath,
|
||||
'Library',
|
||||
'Application Support',
|
||||
pathsSelectorValue,
|
||||
);
|
||||
|
||||
final int major = version?.major;
|
||||
final int minor = version?.minor;
|
||||
String presetPluginsPath;
|
||||
if (pathsSelectorValue != null) {
|
||||
if (major != null && major >= 4 && minor != null && minor >= 1) {
|
||||
presetPluginsPath = globals.fs.path.join(
|
||||
globals.fsUtils.homeDirPath,
|
||||
'Library',
|
||||
'Application Support',
|
||||
'Google',
|
||||
pathsSelectorValue,
|
||||
);
|
||||
} else {
|
||||
presetPluginsPath = globals.fs.path.join(
|
||||
globals.fsUtils.homeDirPath,
|
||||
'Library',
|
||||
'Application Support',
|
||||
pathsSelectorValue,
|
||||
);
|
||||
}
|
||||
}
|
||||
return AndroidStudio(studioPath, version: version, presetPluginsPath: presetPluginsPath);
|
||||
}
|
||||
|
||||
@@ -127,12 +141,23 @@ class AndroidStudio implements Comparable<AndroidStudio> {
|
||||
final int major = version?.major;
|
||||
final int minor = version?.minor;
|
||||
if (globals.platform.isMacOS) {
|
||||
return globals.fs.path.join(
|
||||
globals.fsUtils.homeDirPath,
|
||||
'Library',
|
||||
'Application Support',
|
||||
'AndroidStudio$major.$minor',
|
||||
);
|
||||
/// plugin path of Android Studio has been changed after version 4.1.
|
||||
if (major != null && major >= 4 && minor != null && minor >= 1) {
|
||||
return globals.fs.path.join(
|
||||
globals.fsUtils.homeDirPath,
|
||||
'Library',
|
||||
'Application Support',
|
||||
'Google',
|
||||
'AndroidStudio$major.$minor',
|
||||
);
|
||||
} else {
|
||||
return globals.fs.path.join(
|
||||
globals.fsUtils.homeDirPath,
|
||||
'Library',
|
||||
'Application Support',
|
||||
'AndroidStudio$major.$minor',
|
||||
);
|
||||
}
|
||||
} else {
|
||||
return globals.fs.path.join(
|
||||
globals.fsUtils.homeDirPath,
|
||||
|
||||
Reference in New Issue
Block a user