Skip to content

Support relative workspace paths#69

Merged
ahumesky merged 1 commit intobazelbuild:mainfrom
tomrenn:workspace-relative
Jun 27, 2024
Merged

Support relative workspace paths#69
ahumesky merged 1 commit intobazelbuild:mainfrom
tomrenn:workspace-relative

Conversation

@tomrenn
Copy link
Contributor

@tomrenn tomrenn commented May 31, 2024

This makes it possible to reference the NDK path if it exists within the workspace. Using --repo_env ANDROID_NDK_HOME= for different OS platforms makes it possible to change the path for different configurations.

@ahumesky ahumesky self-assigned this Jun 3, 2024
@ahumesky ahumesky self-requested a review June 3, 2024 14:31
@tomrenn tomrenn force-pushed the workspace-relative branch 2 times, most recently from 51bb496 to 93b76aa Compare June 4, 2024 22:09
rules.bzl Outdated
"path attribute of android_ndk_repository must be set.")

if ndk_path.startswith("$WORKSPACE_ROOT"):
ndk_path = str(ctx.workspace_root) + ndk_path[15:]
Copy link
Collaborator

Choose a reason for hiding this comment

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

for clarity let's make this ndk_path.removeprefix("$WORKSPACE_ROOT")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, done.

@tomrenn tomrenn force-pushed the workspace-relative branch from 93b76aa to f4c0b3f Compare June 21, 2024 22:27
This makes it possible to reference the NDK path if it exists within the
workspace.
@tomrenn tomrenn force-pushed the workspace-relative branch from f4c0b3f to 6b36103 Compare June 26, 2024 23:10
@ahumesky ahumesky merged commit f942689 into bazelbuild:main Jun 27, 2024
copybara-service bot pushed a commit to bazelbuild/rules_android that referenced this pull request Dec 5, 2024
Make it possible for the Android SDK path to exist within the workspace when using the ANDROID_HOME repository environment variable. This is similar to bazelbuild/rules_android_ndk#69 which added the same behavior to rules_android_ndk

PiperOrigin-RevId: 703138165
Change-Id: I1d255e2b4311ddcd21b8308869da77e2cc33405b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants