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

Java Android Library Support #94

Open
realbarisbasturk opened this issue Jul 22, 2022 · 6 comments
Open

Java Android Library Support #94

realbarisbasturk opened this issue Jul 22, 2022 · 6 comments

Comments

@realbarisbasturk
Copy link
Contributor

Binary compatibility plugin configures necessary tasks like 'apiDump' and 'apiCheck' only if kotlin, kotlin-android or kotlin-multiplatform plugins are applied as can be seen here

Although it can be used for Java libraries, due to missing the plugins listed above, necessary tasks are not created.

Java Android libraries can be supported if the tasks are also created for projects where com.android.library plugin is applied.

@qwwdfsad qwwdfsad added enhancement New feature or request PR welcome labels Aug 31, 2022
@qwwdfsad
Copy link
Member

Good point.

I'm not sure how hard it would be to add it and if there are any caveats that may prevent us from implementing it though. I'm ready to properly review and evaluate a contribution (or a PoC) for this functionality

@qwwdfsad
Copy link
Member

Unfortunately, kotlin-android and com.android.library interact in an unpredictable way that prevents major libs from updating (#103, as well as few other libs I've tested).

Unfortunately, I'm short on time in order to properly investigate and fix it, so in order to unblock libraries from updating, I'm reverting this feature and releasing 0.12.1

@qwwdfsad
Copy link
Member

The first bug in the implementation is its non-laziness, which misses the applied kotlin-android plugin in some scenarios (the expected way to check is project.pluginManager.hasPlugin(...).

The problem itself is deeper -- it's not the plugin check, but the fact these two tasks (kotlin-android and com.android.library) work exclusively, meaning that only the result of one of them should be present.
Instead, when com.android.library is detected, its outputs should be added both as input and as input dependency for kotlin-android task if it is present, or a separate task should've created otherwise

@realbarisbasturk
Copy link
Contributor Author

I did not test the case where plugin is applied to the root project (as it is recommended). Since the functional tests I added also does not cover this case but instead applies the plugin to the individual java/kotlin modules, I missed it during development. Thanks for sharing your findings, I will look into it asap (hopefully this weekend) and create a new PR to fix the issue.

@qwwdfsad
Copy link
Member

No need to hurry, bugs happen.
I've rather posted it here so it's easier to catch the fix when somebody is ready to work on it

@realbarisbasturk
Copy link
Contributor Author

Hi @qwwdfsad, it's been a while since I've created a PR for this issue. I'd appreciate if you could take a look when you have a chance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants