Build: Remove artifact configuration out of lazy lambda

It may not be executed leading to misconfiguration
This commit is contained in:
Vyacheslav Gerasimov
2020-04-23 14:27:42 +03:00
parent b43ff7fbf9
commit 410c5f3e69
3 changed files with 27 additions and 13 deletions
@@ -54,7 +54,7 @@ if (deployVersion != null) {
noDefaultJar()
tasks.register<ShadowJar>("shadowJar") {
val shadowJar = tasks.register<ShadowJar>("shadowJar") {
callGroovy("manifestAttributes", manifest, project)
manifest.attributes["Implementation-Version"] = version
@@ -62,12 +62,10 @@ tasks.register<ShadowJar>("shadowJar") {
exclude("**/*.proto")
configurations = listOf(shadows)
relocate("org.jetbrains.kotlin", "kotlinx.metadata.internal")
val artifactRef = outputs.files.singleFile
runtimeJarArtifactBy(this, artifactRef)
addArtifact("runtime", this, artifactRef)
}
runtimeJarArtifactBy(shadowJar, shadowJar)
val test by tasks
test.dependsOn("shadowJar")
@@ -44,7 +44,7 @@ if (deployVersion != null) {
noDefaultJar()
tasks.register<ShadowJar>("shadowJar") {
val shadowJar = tasks.register<ShadowJar>("shadowJar") {
callGroovy("manifestAttributes", manifest, project)
manifest.attributes["Implementation-Version"] = version
@@ -52,12 +52,10 @@ tasks.register<ShadowJar>("shadowJar") {
exclude("**/*.proto")
configurations = listOf(shadows)
relocate("org.jetbrains.kotlin", "kotlinx.metadata.internal")
val artifactRef = outputs.files.singleFile
runtimeJarArtifactBy(this, artifactRef)
addArtifact("runtime", this, artifactRef)
}
runtimeJarArtifactBy(shadowJar, shadowJar)
sourcesJar {
for (dependency in shadows.dependencies) {
if (dependency is ProjectDependency) {