Skip to content

Fix plugins path - #57684

Closed
firephreek wants to merge 5 commits into
flutter:masterfrom
firephreek:fix-plugins-path
Closed

firephreek wants to merge 5 commits into
flutter:masterfrom
firephreek:fix-plugins-path

Conversation

@firephreek

Copy link
Copy Markdown

Description

When Android Studio is installed via on Windows via JetBrains Toolbox, the path to the plugins folder is different. This causes issues with (at least) flutter doctor. These commits reconcile that by checking for a '.plugins' folder corresponding to a Toolbox install and using that. Additionally, tests were updated to resolve conflicts with the fs stub being used across groups.

Related Issues

Addresses issue #57642

Tests

I added the following tests:

flutter\packages\flutter_tools\test\general.shard\android\android_studio_test.dart

  • group('pluginsPath on Windows')
  • testUsingContext('extracts plugins path when installed via Toolbox')
  • testUsingContext('extracts plugins paths from home path when installed separately.')

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read Handling breaking changes.

  • No, no existing tests failed, so this is not a breaking change.
  • Yes, this is a breaking change. If not, delete the remainder of this section.
    • I wrote a design doc: https://flutter.dev/go/template Replace this with a link to your design doc's short link
    • I got input from the developer relations team, specifically from: Replace with the names of who gave advice
    • I wrote a migration guide: Replace with a link to your migration guide

Stryder added 3 commits May 20, 2020 13:57
Found this spot also setting the plugins path. Not sure where or why there are two.
Removed references to `global.fs` in tests to remove issues with `fs` object being shared across Windows and Linux 'platforms', causing tests to break.
@fluttergithubbot fluttergithubbot added the tool Affects the "flutter" command-line tool. See also t: labels. label May 20, 2020
@googlebot

Copy link
Copy Markdown

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@firephreek

Copy link
Copy Markdown
Author

@googlebot I fixed it.

@christopherfujino
christopherfujino self-requested a review May 28, 2020 20:39

@christopherfujino christopherfujino left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also notice that this PR still failed the CLA check. I can see the commits are authored with [email protected], did you by any chance sign the CLA with a different e-mail?


// The plugins path is different when installed via Jetbrains Toolbox
String pluginsPath;
if(globals.fs.isDirectorySync(installPath + '.plugins')){

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking we can make this change more resilient by moving this logic to the pluginsPath getter, which starts at line 131 in this file.

fs.file(homeFile).writeAsStringSync(installPath);
final AndroidStudio studio =
AndroidStudio.fromHomeDot(globals.fs.directory(studioHome));
AndroidStudio.fromHomeDot(fs.directory(studioHome));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this was wrong before your change, but while you're at it, can you fix the indentation here?

@zanderso zanderso added the waiting for response The Flutter team cannot make further progress on this issue until the original reporter responds label Jun 4, 2020
@christopherfujino

Copy link
Copy Markdown
Contributor

Hey @firephreek thanks so much for filing this PR. However, because this code keeps breaking, I think we're going to deprecate these plugins validators. More context in this comment. But thanks again for contributing!

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jul 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

tool Affects the "flutter" command-line tool. See also t: labels. waiting for response The Flutter team cannot make further progress on this issue until the original reporter responds

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants