Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix analysis.setContextRoots failed when DAS launched from Android Studio #304

Merged
merged 6 commits into from
Jan 29, 2025

Conversation

EricSchlichting
Copy link
Contributor

This addresses #270.

Android Studio launches dart analysis server with a very limited PATH variable. Because of this just using the command flutter or dart fails since those executables are not on the limited PATH.

If we instead use Platform.resolvedExecutable it gives us a full path to the dart executable used to run the custom lint plugin.

I removed the consideration for running flutter pub get since it looks like flutter pub get runs dart pub get under the hood and it worked fine in my testing.

❯ flutter pub get --help
Get the current package's dependencies.

Usage: dart pub get
-h, --help                Print this usage information.
    --[no-]offline        Use cached packages instead of accessing the network.
-n, --dry-run             Report what dependencies would change but don't change any.
    --enforce-lockfile    Enforce pubspec.lock. Fail resolution if pubspec.lock does not satisfy pubspec.yaml
    --[no-]precompile     Build executables in immediate dependencies.
-C, --directory=<dir>     Run this in the directory <dir>.

Run "dart help" to see global options.
See https://dart.dev/tools/pub/cmd/pub-get for detailed documentation.

Copy link

vercel bot commented Jan 14, 2025

@EricSchlichting is attempting to deploy a commit to the Invertase Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

docs-page bot commented Jan 14, 2025

To view this pull requests documentation preview, visit the following URL:

docs.page/invertase/dart_custom_lint~304

Documentation is deployed and generated using docs.page.

@CLAassistant
Copy link

CLAassistant commented Jan 14, 2025

CLA assistant check
All committers have signed the CLA.

@EricSchlichting EricSchlichting changed the title Fix analysis.setContextRoots failed on Android Studio Fix analysis.setContextRoots failed when DAS launched from Android Studio Jan 14, 2025
@EricSchlichting
Copy link
Contributor Author

@rrousselGit this is ready for your re-review

@rrousselGit rrousselGit merged commit 7095532 into invertase:main Jan 29, 2025
2 of 3 checks passed
@rrousselGit
Copy link
Collaborator

Thanks for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants