Remove noShadowPublish (#3426)

This commit is contained in:
Anuraag Agrawal 2021-06-29 16:55:53 +09:00 committed by GitHub
parent 47c8a9bfa5
commit d53e62b4dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 14 deletions

View File

@ -1,5 +1,3 @@
import com.github.jengelman.gradle.plugins.shadow.ShadowExtension
plugins {
`maven-publish`
signing
@ -8,18 +6,11 @@ plugins {
publishing {
publications {
register<MavenPublication>("maven") {
if (tasks.names.contains("shadowJar") && findProperty("noShadowPublish") != true) {
the<ShadowExtension>().component(this)
// These two are here just to satisfy Maven Central
artifact(tasks["sourcesJar"])
artifact(tasks["javadocJar"])
} else {
plugins.withId("java-platform") {
from(components["javaPlatform"])
}
plugins.withId("java-library") {
from(components["java"])
}
plugins.withId("java-platform") {
from(components["javaPlatform"])
}
plugins.withId("java-library") {
from(components["java"])
}
versionMapping {

View File

@ -41,3 +41,12 @@ jar {
dependsOn shadowJar
}
// Because shadow does not use default configurations
publishing {
publications {
maven {
project.shadow.component(it)
}
}
}

View File

@ -53,6 +53,7 @@ CopySpec isolateSpec(Collection<Project> projectsWithShadowJar) {
//Includes everything needed for OOTB experience
shadowJar {
archiveClassifier.set("all")
def projectsWithShadowJar = [project(':instrumentation'), project(":javaagent-exporters")]
projectsWithShadowJar.each {
dependsOn("${it.path}:shadowJar")
@ -62,11 +63,15 @@ shadowJar {
//Includes instrumentations, but not exporters
task lightShadow(type: ShadowJar) {
archiveClassifier.set("")
dependsOn ':instrumentation:shadowJar'
def projectsWithShadowJar = [project(':instrumentation')]
with isolateSpec(projectsWithShadowJar)
}
// lightShadow is the default classifier we publish so disable the default jar.
jar.enabled = false
publishing {
publications {
maven(MavenPublication) {

View File

@ -76,3 +76,12 @@ afterEvaluate {
dependsOn shadowJar
}
}
// Because shadow does not use default configurations
publishing {
publications {
maven {
project.shadow.component(it)
}
}
}