Disable stubsJar publication by default. (#1464)

Fixes gh-1168.
This commit is contained in:
Shannon Pamperl
2020-08-07 09:01:53 -05:00
committed by GitHub
parent 0644d7af1c
commit ba22c687c8
6 changed files with 62 additions and 18 deletions

View File

@@ -15,6 +15,7 @@ following sections:
* <<gradle-single-base-class>>
* <<gradle-different-base-classes>>
* <<gradle-invoking-generated-tests>>
* <<gradle-publishing-stubs-to-artifact-repo>>
* <<gradle-pushing-stubs-to-scm>>
* <<gradle-consumer>>
@@ -251,25 +252,12 @@ tasks.create(type: Jar, name: 'verifierStubsJar', dependsOn: 'generateClientStub
from contractVerifier.stubsOutputDir
}
project.artifacts {
archives task
}
tasks.create(type: Copy, name: 'copyContracts') {
from contracts.contractsDslDir
into contracts.stubsOutputDir
}
verifierStubsJar.dependsOn 'copyContracts'
publishing {
publications {
stubs(MavenPublication) {
artifactId project.name
artifact verifierStubsJar
}
}
}
----
====
@@ -446,6 +434,35 @@ the following command:
----
====
[[gradle-publishing-stubs-to-artifact-repo]]
== Publishing Stubs to Artifact Repository
If you use an binary artifact repository to keep the stubs,
you will need to configure the publishing section for Gradle to
include the `verifierStubsJar`. To do that, you can use the
example configuration below:
====
[source,groovy,indent=0]
----
apply plugin: 'maven-publish'
publishing {
publications {
maven(MavenPublication) {
// other configuration
artifact verifierStubsJar
}
}
}
----
====
Since 3.0.0, the internal stubs publication has been deprecated
and disabled by default. It is recommended to include the
`verifierStubsJar` with one of your own publications.
[[gradle-pushing-stubs-to-scm]]
== Pushing Stubs to SCM