Fixed jvm build

This commit is contained in:
Alexander Nozik 2019-07-21 18:51:49 +03:00
parent ae7d31bd30
commit 9d19dc7159
2 changed files with 12 additions and 3 deletions

View File

@ -52,7 +52,6 @@ open class ScientifikJVMPlugin : Plugin<Project> {
}
}
}
}
}

View File

@ -194,6 +194,12 @@ open class ScientifikPublishPlugin : Plugin<Project> {
extensions.findByType<KotlinJvmProjectExtension>()?.apply {
val sourcesJar by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets["main"].kotlin.srcDirs.first())
}
val dokka by tasks.getting(DokkaTask::class) {
outputFormat = "html"
outputDirectory = "$buildDir/javadoc"
@ -208,8 +214,12 @@ open class ScientifikPublishPlugin : Plugin<Project> {
}
configure<PublishingExtension> {
publications.filterIsInstance<MavenPublication>().forEach { publication ->
publication.artifact(kdocJar.get())
publications {
register("jvm", MavenPublication::class) {
from(components["java"])
artifact(sourcesJar.get())
artifact(kdocJar.get())
}
}
}
}