Skip to content

Commit

Permalink
Setup for android_library.
Browse files Browse the repository at this point in the history
Summary:
We already use `attrs_validators` as a way to expose `ValidationInfo` to `apple_library` and` apple_test`, this brings it to Android too:

Context: https://fb.workplace.com/permalink.php?story_fbid=pfbid02bd14VGLE15KsL6DXAyx57hoszZPy47FjyTR32t5T4xFYRUehC5oZhsLEWkvKajBjl&id=100017837684196

Reviewed By: IanChilds

Differential Revision: D68782105

fbshipit-source-id: fc26ca7b374f87224c027880ecdbe291d712a8e8
  • Loading branch information
Dustin Shahidehpour authored and facebook-github-bot committed Jan 30, 2025
1 parent 20cd2fa commit 95ca206
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion android/android_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
# of this source tree.

load("@prelude//:attrs_validators.bzl", "get_attrs_validators_info")
load("@prelude//:validation_deps.bzl", "get_validation_deps_outputs")
load(
"@prelude//android:android_providers.bzl",
Expand Down Expand Up @@ -54,7 +55,7 @@ def android_library_impl(ctx: AnalysisContext) -> list[Provider]:
manifest = ctx.attrs.manifest,
),
merge_exported_android_resource_info(ctx.attrs.exported_deps),
] + android_providers
] + android_providers + get_attrs_validators_info(ctx)

def optional_jars(ctx: AnalysisContext) -> list[Artifact]:
return ctx.attrs.android_optional_jars or []
Expand Down
2 changes: 2 additions & 0 deletions decls/android_rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# the generated docs, and so those should be verified to be accurate and
# well-formatted (and then delete this TODO)

load("@prelude//:attrs_validators.bzl", "ATTRS_VALIDATORS_NAME", "ATTRS_VALIDATORS_TYPE")
load("@prelude//decls:test_common.bzl", "test_common")
load("@prelude//utils:clear_platform.bzl", "clear_platform_transition")
load(":android_common.bzl", "android_common")
Expand Down Expand Up @@ -783,6 +784,7 @@ android_library = prelude_rule(
"runtime_deps": attrs.list(attrs.dep(), default = []),
"source_abi_verification_mode": attrs.option(attrs.enum(SourceAbiVerificationMode), default = None),
"use_jvm_abi_gen": attrs.option(attrs.bool(), default = None),
ATTRS_VALIDATORS_NAME: ATTRS_VALIDATORS_TYPE,
}
) | jvm_common.plugins(),
)
Expand Down

0 comments on commit 95ca206

Please sign in to comment.