Repository navigation
[tools] Fix Android Studio duplicate detection - #88384
Merged
Merged
Conversation
jmagman
reviewed
Aug 17, 2021
| final String plistFile = globals.fs.path.join(studioPath, 'Info.plist'); | ||
| final 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. |
Member
There was a problem hiding this comment.
Update the comment too. Maybe "If we've found a JetBrainsToolbox wrapper, ignore it."
|
|
||
| final String applicationsPlistFilePath = globals.fs.path.join(applicationPlistFolder, 'Info.plist'); | ||
| const Map<String, dynamic> jetbrainsInfoPlist = <String, dynamic>{ | ||
| 'JetBrainsToolboxApp': '$homeMac/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7583922/Android Studio.app', |
Member
There was a problem hiding this comment.
You don't need to get so complicated since the value is ignored, it's just checking that the key exists.
Suggested change
| 'JetBrainsToolboxApp': '$homeMac/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7583922/Android Studio.app', | |
| 'JetBrainsToolboxApp': 'ignored', |
or
Suggested change
| 'JetBrainsToolboxApp': '$homeMac/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7583922/Android Studio.app', | |
| 'JetBrainsToolboxApp': 'bogus', |
The simpler the case is, the easier it is to see what it's testing.
Contributor
Author
There was a problem hiding this comment.
originally wanted to leave this as empty string '' but ignored is perfect here
jmagman
approved these changes
Aug 17, 2021
jmagman
left a comment
Member
There was a problem hiding this comment.
LGTM, thanks for digging into this!
Contributor
Author
|
@jmagman |
Contributor
|
This pull request is not suitable for automatic merging in its current state.
|
|
@TahaTesser When it wiil be at stable? |
Member
|
This change is available in 2.6.0-0.0.pre. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #86291
Made the changes suggested in #86291 (comment)
For the test, I've removed
extracts custom paths for Android Studio downloaded by JetBrainsToolbox on Mac, since we are not extracting the path this way and this fails due to changes made inandroid_studio.dartand added my own test for duplicate detection
If we provide
plistUtils.fileContents[applicationsPlistFilePath] = macStudioInfoPlist2020_3;Result
if we provide plist with
JetBrainsToolboxAppkeyResult
expect(AndroidStudio.allInstalled().length, 1);Test passes
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.