-
Notifications
You must be signed in to change notification settings - Fork 55
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
Use defaultPublishConfig if possible for android modules #29
Use defaultPublishConfig if possible for android modules #29
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
@@ -48,8 +49,10 @@ class BinaryCompatibilityValidatorPlugin : Plugin<Project> { | |||
project.pluginManager.withPlugin("kotlin-android") { | |||
if (project.name in project.rootProject.ignoredProjects()) return@withPlugin | |||
val extension = project.extensions.getByName("kotlin") as KotlinAndroidProjectExtension | |||
val androidBase = project.extensions.getByName("android") as AndroidBaseExtension | |||
val defaultPublishName = androidBase.defaultPublishConfig ?: "release" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like defaultPublishConfig
is obsolete and recommended way to publish an application with maven-publish
plugin is not using it: https://developer.android.com/studio/build/maven-publish-plugin.
I see the alternative solution where the user explicitly states the publication name they want to verify, then, if it's missing, we can lookup defaultPublishConfig
and then fallback to release. It would be nice to have a test for that.
The project doesn't have the infrastructure for tests yet (it is coming in #28), so the most valuable contribution would be to just put a bunch of sample Android projects into the resources: with legacy maven plugin, with maven-publish
and with library flavours and I will take care of the rest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks for the comments.
I will try to look into it and since #28 is merged I will try to include some tests.
Is there any update on this PR on when it might be addressed. We are looking at using this for our android applications, but will need not only non-release support but flavor support as well. Ideally, the apiDump should support something like, apiDumpDebug, apiDumpFlavorDebug, apiDumpRelease, apiDumpFlavorRelease. |
5e1d3dc
to
d32240e
Compare
@pavelreiter @qwwdfsad Hi, are you planning to finish this PR? Or do you have any workaround? |
Hi, I am afraid that I have went with metalava for now. I will close the PR. |
I found a hacky workaround. Since I'm using flavors only for changes directly in the code
|
Fixes #24
I have prepared fix for #24 by adding compileOnly dependency on android gradle plugin (
com.android.tools.build:gradle:3.6.4
) and using android project extension to fetch defaultPublishConfig as preferred source ofcompilationName
match.