-
Notifications
You must be signed in to change notification settings - Fork 82
[native_toolchain_c] Consider ANDROID_HOME environment variable
#2736
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
base: main
Are you sure you want to change the base?
Conversation
pkgs/native_toolchain_c/lib/src/native_toolchain/android_ndk.dart
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- If the environment variables
ANDROID_NDK,ANROID_NDK_HOME,ANDROID_NDK_LATEST_HOMEorANDROID_NDK_ROOTare set (as they are in GitHub actions), those directories.
Some of these are filtered out in the build hooks, so we'd need to add those there too.
Thanks @simolus3! 🚀
pkgs/native_toolchain_c/lib/src/native_toolchain/android_ndk.dart
Outdated
Show resolved
Hide resolved
pkgs/native_toolchain_c/lib/src/native_toolchain/android_ndk.dart
Outdated
Show resolved
Hide resolved
PR HealthChangelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. This check can be disabled by tagging the PR with License Headers ✔️
All source files should start with a license header. Unrelated files missing license headers
This check can be disabled by tagging the PR with |
|
It looks like the failing health checks may be an analyzer issue? Or at least I don't understand how these changes could cause the error from the logs. |
I have filed dart-lang/sdk#61870. We're not using any dot-shorthands in the code yet, so it's kinda weird. The new tests fail on Windows, backslashes. 🙃 |
When searching for an NDK, this now considers:
$ANDROID_HOME/ndk/*/directories.ANDROID_NDK,ANROID_NDK_HOME,ANDROID_NDK_LATEST_HOMEorANDROID_NDK_ROOTare set (as they are in GitHub actions), those directories.To make this testable (it's kind of odd there's no way to patch
Platform.environmentwithIOOverrides), this replaces theloggerpassed to tool resolvers with aToolResolvingContextclass that allows mocking environment variables (well, kind of. Most resolvers shell out and we can't mock that yet).Closes #2632.