Disable publication of test fixture artifacts

Thanks to @melix for providing the code snippet necessary to achieve
this with Gradle 5.6.x.

See gh-23550
This commit is contained in:
Sam Brannen 2020-01-02 15:21:40 +01:00
parent c91dd02905
commit d5f0bb23ae
1 changed files with 8 additions and 0 deletions

View File

@ -55,6 +55,14 @@ task javadocJar(type: Jar) {
publishing {
publications {
mavenJava(MavenPublication) {
// Disable publication of test fixture artifacts.
//
// Once we upgrade to Gradle 6.x, we will need to delete the following line ...
components.java.variants.removeAll { it.outgoingConfiguration.name.startsWith("testFixtures") }
// ... and uncomment the following two lines.
// components.java.withVariantsFromConfiguration(configurations.testFixturesApiElements) { skip() }
// components.java.withVariantsFromConfiguration(configurations.testFixturesRuntimeElements) { skip() }
from components.java
artifact sourcesJar
artifact javadocJar