aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2019-04-08 17:22:04 +0200
committerKamil Doległo <kamilok1965@interia.pl>2019-04-08 17:22:04 +0200
commit49800d9c8276ec8851bcc3b181563cd6e0f8f4b9 (patch)
tree16462fc1425e5d53cbc53fcd4d0bacd3435fde5c /core
parent9975b7209f55edfe7e2f1a48e8d1f8b3c522e71a (diff)
downloaddokka-49800d9c8276ec8851bcc3b181563cd6e0f8f4b9.tar.gz
dokka-49800d9c8276ec8851bcc3b181563cd6e0f8f4b9.tar.bz2
dokka-49800d9c8276ec8851bcc3b181563cd6e0f8f4b9.zip
Implement Gradle Pass Configuration
Diffstat (limited to 'core')
-rw-r--r--core/build.gradle1
-rw-r--r--core/src/main/kotlin/DokkaBootstrapImpl.kt11
2 files changed, 6 insertions, 6 deletions
diff --git a/core/build.gradle b/core/build.gradle
index 0008bfd7..4c140df3 100644
--- a/core/build.gradle
+++ b/core/build.gradle
@@ -47,6 +47,7 @@ dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.jetbrains.kotlin', name: 'kotlin-test-junit', version: kotlin_version
testCompile "com.nhaarman:mockito-kotlin-kt1.1:1.5.0"
+ implementation 'com.google.code.gson:gson:2.8.5'
testCompile ideaRT()
} \ No newline at end of file
diff --git a/core/src/main/kotlin/DokkaBootstrapImpl.kt b/core/src/main/kotlin/DokkaBootstrapImpl.kt
index 2077458a..b48b62d4 100644
--- a/core/src/main/kotlin/DokkaBootstrapImpl.kt
+++ b/core/src/main/kotlin/DokkaBootstrapImpl.kt
@@ -1,8 +1,6 @@
package org.jetbrains.dokka
-import com.intellij.openapi.util.Pass
-import kotlinx.serialization.*
-import kotlinx.serialization.json.Json
+import com.google.gson.Gson
import org.jetbrains.dokka.DokkaConfiguration.PackageOptions
import java.util.function.BiConsumer
@@ -41,9 +39,7 @@ class DokkaBootstrapImpl : DokkaBootstrap {
}
lateinit var generator: DokkaGenerator
-
- override fun configure(logger: BiConsumer<String, String>, serializedConfigurationJSON: String)
- = configure(DokkaProxyLogger(logger), Json.parse(DokkaConfigurationImpl.serializer(), serializedConfigurationJSON))
+ val gson = Gson()
fun configure(logger: DokkaLogger, configuration: DokkaConfigurationImpl) = with(configuration) {
@@ -73,5 +69,8 @@ class DokkaBootstrapImpl : DokkaBootstrap {
generator = DokkaGenerator(configurationWithLinks, logger)
}
+ override fun configure(logger: BiConsumer<String, String>, serializedConfigurationJSON: String)
+ = configure(DokkaProxyLogger(logger), gson.fromJson(serializedConfigurationJSON, DokkaConfigurationImpl::class.java))
+
override fun generate() = generator.generate()
}