Skip to content

Associate internal symbols not visible to java sources when associate target has public only ABI jars #1467

@rbeazleyspot

Description

@rbeazleyspot

When a target associates with another target that is opted into public only abi jars (experimental_use_abi_jars = True, experimental_treat_internal_as_private_in_abi_jars = True, experimental_remove_private_classes_in_abi_jars = True) any java source compiled as part of the target cannot see any internal declarations, an example would be java generated using KAPT.

I have pushed a branch here that restructures the Dagger example so there is a separate "wiring" target containing the dagger component and modules. It associates with the coffee_base target containing a mix of internal and public types.

This wont build as the java compile step cannot see the internal symbols even though its an associate.

It seams the fix is reasonably straight forward as you can see here where there is a specific list of deps for the compilation task containing full class jars. Rather than just changing dep_infos as these are used for normal java info output and we dont want to undo the strict public abi jar advantages (the filtering logic of abi jars is also cleaner).

Would this be a legitimate change?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions