Moved deploy configuration to afterEvaluate
This commit is contained in:
parent
cd9bf6adc2
commit
404bcfd28a
@ -8,7 +8,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "scientifik"
|
group = "scientifik"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
|
@ -38,11 +38,14 @@ open class ScientifikPublishPlugin : Plugin<Project> {
|
|||||||
project.plugins.apply("maven-publish")
|
project.plugins.apply("maven-publish")
|
||||||
val extension = project.extensions.create<ScientifikExtension>("scientifik")
|
val extension = project.extensions.create<ScientifikExtension>("scientifik")
|
||||||
|
|
||||||
|
project.afterEvaluate {
|
||||||
|
|
||||||
val bintrayRepo = project.bintrayRepo
|
val bintrayRepo = project.bintrayRepo
|
||||||
val vcs = project.vcs
|
val vcs = project.vcs
|
||||||
|
|
||||||
if (bintrayRepo == null || vcs == null) {
|
if (bintrayRepo == null || vcs == null) {
|
||||||
project.logger.warn("[${project.name}] Missing deployment configuration. Skipping publish.")
|
project.logger.warn("[${project.name}] Missing deployment configuration. Skipping publish.")
|
||||||
|
return@afterEvaluate
|
||||||
}
|
}
|
||||||
|
|
||||||
project.configure<PublishingExtension> {
|
project.configure<PublishingExtension> {
|
||||||
@ -85,7 +88,7 @@ open class ScientifikPublishPlugin : Plugin<Project> {
|
|||||||
if (extension.kdoc) {
|
if (extension.kdoc) {
|
||||||
project.plugins.apply("org.jetbrains.dokka")
|
project.plugins.apply("org.jetbrains.dokka")
|
||||||
|
|
||||||
project.afterEvaluate {
|
|
||||||
extensions.findByType<KotlinMultiplatformExtension>()?.apply {
|
extensions.findByType<KotlinMultiplatformExtension>()?.apply {
|
||||||
val dokka by tasks.getting(DokkaTask::class) {
|
val dokka by tasks.getting(DokkaTask::class) {
|
||||||
outputFormat = "html"
|
outputFormat = "html"
|
||||||
@ -165,7 +168,7 @@ open class ScientifikPublishPlugin : Plugin<Project> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
project.plugins.apply("com.jfrog.bintray")
|
project.plugins.apply("com.jfrog.bintray")
|
||||||
@ -193,9 +196,9 @@ open class ScientifikPublishPlugin : Plugin<Project> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//workaround bintray bug
|
//workaround bintray bug
|
||||||
project.afterEvaluate {
|
|
||||||
setPublications(*project.extensions.findByType<PublishingExtension>()!!.publications.names.toTypedArray())
|
setPublications(*project.extensions.findByType<PublishingExtension>()!!.publications.names.toTypedArray())
|
||||||
}
|
|
||||||
|
|
||||||
// project.tasks.figetByPath("bintrayUpload") {
|
// project.tasks.figetByPath("bintrayUpload") {
|
||||||
// dependsOn(publishToMavenLocal)
|
// dependsOn(publishToMavenLocal)
|
||||||
@ -231,3 +234,4 @@ open class ScientifikPublishPlugin : Plugin<Project> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user