wupdigital / android-maven-publish

Modification of the standard Maven Publish plugin to be compatible with android-library projects (aar).
Apache License 2.0
326 stars 39 forks source link

Support for Gradle-Metadata #37

Closed esial closed 4 years ago

esial commented 5 years ago

Is there any way to add variants and custom attributes in file.module file generated for gradle-metadata in android library?

trevjonez commented 5 years ago

requires a whole different set of components be registered with the publishing api's. I did a POC last year that does it. needs to be brought up to date but worked fine with the version I used at the time.

https://github.com/trevjonez/android-components-plugin

required a slew of internal API's be used, so very fragile at best.

esial commented 5 years ago

It seems to work with most variants, but there is still problem with recognize some configurations at consumer side. Here is consumer config:

android {
    buildTypes {
        release {}
        debug {}
    }

    flavorDimensions 'brand'
    productFlavors {
        flaA {
            dimension 'brand'
        }
        flaB {
            dimension 'brand'
        }
}

All test and simple configurations like flaARelease or flaBDebug don't have any attributes so they try to use default variant, which not match. I get errror like this where com.test:app_flaA_debug:1.0. is default variant at producer side. ERROR: Unable to resolve dependency for ':app@flaARelease/compileClasspath': Could not resolve com.test:app_flaA_debug:1.0.

Any sugestions?

jjohannes commented 4 years ago

Unfortunately, this plugin does not work well with Gradle 6: https://issuetracker.google.com/issues/144240061#comment11

Android 3.6.0 has been released. It now officially supports maven-publish with Gradle Metadata: https://developer.android.com/studio/releases/gradle-plugin#maven-publish

Maybe users of 3.6.0 won't need this plugin anymore and you can add a note about that to the readme?

warnyul commented 4 years ago

I have read AGP release notes, so yes I can. Thanks for the information.