Skip to content

Generate associates abi jar with plugin#1479

Open
rbeazleyspot wants to merge 7 commits intobazel-contrib:masterfrom
rbeazleyspot:generate-associates-abi-jar-with-plugin
Open

Generate associates abi jar with plugin#1479
rbeazleyspot wants to merge 7 commits intobazel-contrib:masterfrom
rbeazleyspot:generate-associates-abi-jar-with-plugin

Conversation

@rbeazleyspot
Copy link
Contributor

@rbeazleyspot rbeazleyspot commented Mar 9, 2026

This is a different fix for issue #1467 when Kapt generates Java code such as that generated by KAPT that requires access to internal classes that are stripped from ABI jars.

If a target B associates with a target A and B is generating Dagger code, the call to java_common.compile in _run_kt_java_builder_actions doesn't seem to have access to the internal symbols from the associates array. Hence, compilation of the Java code fails.

This PR adds a new "Associates ABI Jar" that contains public and internal, its behind an experimental flag. Its only useful in the case where a strict public only ABI jar is produced.

This new experimental abi jar is used as a dep for the java compile action when associating with a target.

It uses the same kotlin abi gen plugin but configures it to not treat internal as private classes, it still enforces removal of privates from this jar.

The plugin had to be wrappped and bound with a different ID so that it can be configured differently along side the existing plugin.

There is an example dagger with associates project added which accounts for most of the changed lines.

@rbeazleyspot rbeazleyspot marked this pull request as ready for review March 10, 2026 10:27
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.

1 participant