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

Implement support for resource_sets API in bazel-common #132

Closed
wants to merge 2 commits into from

Conversation

arunkumar9t2
Copy link
Contributor

@arunkumar9t2 arunkumar9t2 commented Apr 9, 2024

This PR implements support for resource_sets API introduced in grab/grab-bazel-common#165.

This is done by mapping AGP's AndroidSourceSet to newly added BazelSourceSet. During mapping, existence of the directories are checked for.

After this source, Gradle like variant declaration can be closely mimicked as below and resources, manifest and assets will be merged before actual build begins.

android_binary(
    name = "android_binary_sample",
    srcs = glob([
        "src/main/java/**/*.kt",
    ]),
    custom_package = "com.grab.test",
    manifest = "src/main/AndroidManifest.xml",
    resource_sets = {
        "flavor": {
            "res": "src/flavor/res",
            "manifest": "src/flavor/AndroidManifest.xml",
            "assets": "src/flavor/assets",
        },
        "main": {
            "res": "src/main/res",
            "manifest": "src/main/AndroidManifest.xml",
            "assets": "src/main/assets",
        },
    },
)

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.

3 participants