gradle-scripts icon indicating copy to clipboard operation
gradle-scripts copied to clipboard

testFixtures publication is broken

Open mauhiz opened this issue 3 years ago • 4 comments

And maybe more since gradle module metadata is not published. This worked up to this change https://github.com/line/gradle-scripts/pull/70/files#diff-ffb34903ae12e60a09d22b96a91acec88a6e037db610be204900722d6903767eR105-R108

Well, can't we just enable publishing module metadata? Or, make it configurable?

mauhiz avatar Nov 07 '22 06:11 mauhiz

I don't remember correctly, it seems like we disabled it because it doesn't work properly with the shading Jars. We replace the Jar files with the shading ones which emits the error: Cannot publish module metadata where component artifacts are modified. https://github.com/line/armeria/blob/1be52b2a6fe9fe08d282206c506a489aea13db87/gradle/scripts/lib/java-publish.gradle#L18-L36 Having said this, if we are not using shade and relocate flags we can just enable it in the module's Gradle build file.

tasks.withType(GenerateModuleMetadata) {
    enabled = true
}

Are you using the flags? Anyway, we definitely need to fix this.

minwoox avatar Nov 07 '22 08:11 minwoox

No, I am not using these flags. Until the fix, is there a workaround? Would pasting the above snippet in my build.gradle be enough? (not sure who wins..

mauhiz avatar Nov 08 '22 06:11 mauhiz

Would pasting the above snippet in my build.gradle be enough?

At least, it worked for me. Could you try that and see if the metadata is correctly created? FYI, we can create the metadata via ./gradlew generateMetadataFileForJarPublication

minwoox avatar Nov 08 '22 12:11 minwoox

Oh, I forgot to follow up here. Yes, the workaround works

mauhiz avatar Mar 25 '23 05:03 mauhiz