Updated dokka plugin

This commit is contained in:
Alexander Nozik 2019-11-01 22:06:41 +03:00
parent 7b45e253b4
commit 1f03951cff
6 changed files with 20 additions and 28 deletions

View File

@ -7,7 +7,7 @@ plugins {
}
group = "scientifik"
version = "0.2.1"
version = "0.2.2"
repositories {
gradlePluginPortal()
@ -23,16 +23,17 @@ dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
implementation("org.jetbrains.kotlin:kotlin-serialization:$kotlinVersion")
implementation("org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.1.0")
implementation("org.jetbrains.kotlinx:atomicfu-gradle-plugin:0.12.10")
implementation("org.jetbrains.kotlinx:atomicfu-gradle-plugin:0.13.2")
implementation("com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4")
implementation("org.jetbrains.dokka:dokka-gradle-plugin:0.9.18")
implementation("org.jetbrains.dokka:dokka-gradle-plugin:0.10.0")
implementation("org.jfrog.buildinfo:build-info-extractor-gradle:4.10.0")
}
gradlePlugin {
plugins {
create("scientifik-publish") {
id = "scientifik.publish"
description = "The publication plugin for bintray and bitbucket"
description = "The publication plugin for bintray and github"
implementationClass = "scientifik.ScientifikPublishPlugin"
}

View File

@ -28,6 +28,7 @@ open class ScientifikJVMPlugin : Plugin<Project> {
}
configure<KotlinJvmProjectExtension> {
val sourceSet = sourceSets["main"].apply {
languageSettings.applySettings()
dependencies {
@ -35,6 +36,14 @@ open class ScientifikJVMPlugin : Plugin<Project> {
}
}
sourceSets["test"].apply {
languageSettings.applySettings()
dependencies {
implementation(kotlin("test"))
implementation(kotlin("test-junit"))
}
}
val sourcesJar by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSet.kotlin.srcDirs.first())
@ -54,7 +63,6 @@ open class ScientifikJVMPlugin : Plugin<Project> {
val dokka by tasks.getting(DokkaTask::class) {
outputFormat = "html"
outputDirectory = "$buildDir/javadoc"
jdkVersion = 8
}
val kdocJar by tasks.registering(Jar::class) {

View File

@ -82,25 +82,9 @@ open class ScientifikMPPlugin : Plugin<Project> {
val dokka by tasks.getting(DokkaTask::class) {
outputFormat = "html"
outputDirectory = "$buildDir/javadoc"
jdkVersion = 8
multiplatform{
kotlinTasks {
// dokka fails to retrieve sources from MPP-tasks so we only define the jvm task
listOf(tasks.getByPath("compileKotlinJvm"))
}
sourceRoot {
// assuming only single source dir
path = sourceSets["commonMain"].kotlin.srcDirs.first().toString()
platforms = listOf("Common")
}
// although the JVM sources are now taken from the task,
// we still define the jvm source root to get the JVM marker in the generated html
sourceRoot {
// assuming only single source dir
path = sourceSets["jvmMain"].kotlin.srcDirs.first().toString()
platforms = listOf("JVM")
}
}
val kdocJar by tasks.registering(Jar::class) {

View File

@ -19,10 +19,8 @@ class ScientifikNativePlugin : Plugin<Project> {
dependsOn(commonMain)
dependencies {
api(kotlin("native"))
//TODO add stdlib here
target.afterEvaluate {
//TODO add optional libraries here
}
}
}

View File

@ -79,6 +79,7 @@ open class ScientifikPublishPlugin : Plugin<Project> {
username = githubUser
password = githubToken
}
}
val githubPublishTasks = publications.filterIsInstance<MavenPublication>().map { publication ->