aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2019-04-29 11:29:23 +0200
committerKamil Doległo <kamilok1965@interia.pl>2019-04-29 11:31:26 +0200
commit2bab59fee39cd60ad80327d528771015a5903639 (patch)
tree56395a99ba22930af2dc7a6b7bd504b96aef51cf
parent06af978842577ad19639b827cf33c4514347afa4 (diff)
downloaddokka-2bab59fee39cd60ad80327d528771015a5903639.tar.gz
dokka-2bab59fee39cd60ad80327d528771015a5903639.tar.bz2
dokka-2bab59fee39cd60ad80327d528771015a5903639.zip
Fix for analysis platform
-rw-r--r--README.md4
-rw-r--r--integration/src/main/kotlin/org/jetbrains/dokka/configuration.kt2
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt6
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/configurationImplementations.kt1
4 files changed, 11 insertions, 2 deletions
diff --git a/README.md b/README.md
index 8540eda8..564dbe79 100644
--- a/README.md
+++ b/README.md
@@ -96,6 +96,8 @@ dokka {
targets = ["JVM"] // See platforms section of documentation
+ platform = "JVM" // Platform used for code analysis
+
// Manual adding files to classpath
// This property not overrides classpath collected from kotlinTasks but appends to it
classpath = [new File("$buildDir/other.jar")]
@@ -175,6 +177,7 @@ dokka {
multiplatform {
js { // the name here is arbitrary
targets = ["JS"]
+ platform = "js"
sourceRoot {
path = kotlin.sourceSets.jsMain.kotlin.srcDirs[0]
}
@@ -185,6 +188,7 @@ dokka {
jvm { // the name here is arbitrary
targets = ["JVM"]
+ platform = "jvm"
sourceRoot {
path = kotlin.sourceSets.jvmMain.kotlin.srcDirs[0]
}
diff --git a/integration/src/main/kotlin/org/jetbrains/dokka/configuration.kt b/integration/src/main/kotlin/org/jetbrains/dokka/configuration.kt
index 49481089..7c6753d4 100644
--- a/integration/src/main/kotlin/org/jetbrains/dokka/configuration.kt
+++ b/integration/src/main/kotlin/org/jetbrains/dokka/configuration.kt
@@ -18,7 +18,7 @@ enum class Platform(val key: String) {
js.key -> js
native.key -> native
common.key -> common
- else -> TODO("write normal exception")
+ else -> throw IllegalArgumentException("Unrecognized platform: $key")
}
}
}
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt
index b7e859e1..f7999f59 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt
@@ -14,6 +14,7 @@ import org.gradle.api.tasks.compile.AbstractCompile
import org.jetbrains.dokka.DokkaBootstrap
import org.jetbrains.dokka.DokkaConfiguration
import org.jetbrains.dokka.DokkaConfiguration.SourceRoot
+import org.jetbrains.dokka.Platform
import org.jetbrains.dokka.ReflectDsl
import org.jetbrains.dokka.ReflectDsl.isNotInstance
import java.io.File
@@ -241,11 +242,14 @@ open class DokkaTask : DefaultTask() {
passConfig.collectInheritedExtensionsFromLibraries = collectInheritedExtensionsFromLibraries
passConfig.suppressedFiles = collectSuppressedFiles(passConfig.sourceRoots)
passConfig.externalDocumentationLinks.addAll(externalDocumentationLinks)
+ if(passConfig.platform.isNotEmpty()){
+ passConfig.analysisPlatform = Platform.fromString(passConfig.platform)
+ }
return passConfig
}
- private fun collectSourceRoots(): List<DokkaConfiguration.SourceRoot> {
+ private fun collectSourceRoots(): List<SourceRoot> {
val sourceDirs = when {
sourceDirs.any() -> {
logger.info("Dokka: Taking source directories provided by the user")
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/configurationImplementations.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/configurationImplementations.kt
index 50412734..887e4d9b 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/configurationImplementations.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/configurationImplementations.kt
@@ -41,6 +41,7 @@ open class GradlePassConfigurationImpl(@Transient val name: String = ""): PassCo
override var suppressedFiles: List<String> = emptyList()
override var collectInheritedExtensionsFromLibraries: Boolean = false
override var analysisPlatform: Platform = Platform.DEFAULT
+ var platform: String = ""
override var targets: List<String> = emptyList()
override var sinceKotlin: String = "1.0"