Pill: Replace most of the hardcoded library coordinates with info from Gradle
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
import java.io.File
|
||||
|
||||
apply { plugin("base") }
|
||||
|
||||
val baseProtobuf by configurations.creating
|
||||
val baseProtobufSources by configurations.creating
|
||||
|
||||
val resultsCfg = configurations.create("default")
|
||||
val resultsCfg = configurations.getByName("default")
|
||||
val resultsSourcesCfg = configurations.create("sources")
|
||||
|
||||
val protobufVersion = rootProject.extra["versions.protobuf-java"] as String
|
||||
@@ -13,6 +16,10 @@ val renamedSources = "$buildDir/renamedSrc/"
|
||||
val outputJarsPath = "$buildDir/libs"
|
||||
val artifactBaseName = "protobuf-java-relocated"
|
||||
|
||||
val jpsLibraryPath by extra(outputJarsPath)
|
||||
|
||||
setProperty("archivesBaseName", "$artifactBaseName-$protobufVersion")
|
||||
|
||||
dependencies {
|
||||
baseProtobuf("com.google.protobuf:protobuf-java:$protobufVersion")
|
||||
baseProtobufSources("com.google.protobuf:protobuf-java:$protobufVersion:sources")
|
||||
@@ -47,8 +54,4 @@ val prepareSources by task<Jar> {
|
||||
from(relocateSources)
|
||||
project.addArtifact("archives", this, this)
|
||||
addArtifact(resultsSourcesCfg.name, this, this)
|
||||
}
|
||||
|
||||
val clean by task<Delete> {
|
||||
delete(buildDir)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user