Fixed deploy to bintray and dokka configuration

This commit is contained in:
Alexander Nozik 2019-11-01 22:57:53 +03:00
parent 1f03951cff
commit af1e79ddba
3 changed files with 46 additions and 38 deletions

View File

@ -17,7 +17,6 @@ open class ScientifikJVMPlugin : Plugin<Project> {
with(project) {
plugins.apply("org.jetbrains.kotlin.jvm")
plugins.apply("maven-publish")
repositories.applyRepos()
@ -49,6 +48,8 @@ open class ScientifikJVMPlugin : Plugin<Project> {
from(sourceSet.kotlin.srcDirs.first())
}
pluginManager.withPlugin("maven-publish") {
configure<PublishingExtension> {
publications {
register("jvm", MavenPublication::class) {
@ -57,7 +58,6 @@ open class ScientifikJVMPlugin : Plugin<Project> {
}
}
}
}
pluginManager.withPlugin("org.jetbrains.dokka") {
val dokka by tasks.getting(DokkaTask::class) {
@ -81,6 +81,10 @@ open class ScientifikJVMPlugin : Plugin<Project> {
}
}
}
}
}
}

View File

@ -94,6 +94,7 @@ open class ScientifikMPPlugin : Plugin<Project> {
from("$buildDir/javadoc")
}
pluginManager.withPlugin("maven-publish") {
configure<PublishingExtension> {
targets.all {
@ -105,6 +106,7 @@ open class ScientifikMPPlugin : Plugin<Project> {
}
}
}
}

View File

@ -120,7 +120,7 @@ open class ScientifikPublishPlugin : Plugin<Project> {
if (bintrayRepo == null) {
project.logger.warn("[${project.name}] Bintray repository not defined")
} else {
project.logger.info("Adding bintray publishing to project [${project.name}]")
project.configure<PublishingExtension> {
repositories {
maven("https://bintray.com/mipt-npm/$bintrayRepo")
@ -143,16 +143,18 @@ open class ScientifikPublishPlugin : Plugin<Project> {
setLicenses("Apache-2.0")
vcsUrl = vcs
version.apply {
name = project.version.toString()
vcsTag = project.version.toString()
released = java.util.Date().toString()
this.name = project.version.toString()
this.vcsTag = project.version.toString()
this.released = java.util.Date().toString()
}
}
//workaround bintray bug
afterEvaluate {
setPublications(*project.extensions.findByType<PublishingExtension>()!!.publications.names.toTypedArray())
}
}
}
}
}
}