Pill: Replace most of the hardcoded library coordinates with info from Gradle

This commit is contained in:
Yan Zhulanow
2018-02-28 00:12:57 +03:00
parent 6e65a4810e
commit 6950c256ce
7 changed files with 71 additions and 70 deletions
@@ -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)
}
}