From ac4d4db037930e266a1a6d27996cd16928395eb1 Mon Sep 17 00:00:00 2001 From: Kamil Doległo Date: Tue, 18 Jun 2019 17:44:12 +0200 Subject: Fix NotSerializableException --- .../src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt | 6 +++--- .../org/jetbrains/dokka/gradle/configurationImplementations.kt | 6 +++--- .../src/main/kotlin/org/jetbrains/dokka/gradle/main.kt | 3 +-- 3 files changed, 7 insertions(+), 8 deletions(-) (limited to 'runners/gradle-plugin') 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 7d8fd309..d15cf932 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 @@ -68,14 +68,14 @@ open class DokkaTask : DefaultTask() { @Input var cacheRoot: String? = null - var multiplatform: NamedDomainObjectContainer + var multiplatform: Set @Suppress("UNCHECKED_CAST") - @Input get() = DslObject(this).extensions.getByName(MULTIPLATFORM_EXTENSION_NAME) as NamedDomainObjectContainer + @Input get() = (DslObject(this).extensions.getByName(MULTIPLATFORM_EXTENSION_NAME) as NamedDomainObjectContainer).toSet() internal set(value) = DslObject(this).extensions.add(MULTIPLATFORM_EXTENSION_NAME, value) var configuration: GradlePassConfigurationImpl @Suppress("UNCHECKED_CAST") - @Input get() = DslObject(this).extensions.getByName(CONFIGURATION_EXTENSION_NAME) as GradlePassConfigurationImpl + @Input get() = DslObject(this).extensions.getByType(GradlePassConfigurationImpl::class.java) internal set(value) = DslObject(this).extensions.add(CONFIGURATION_EXTENSION_NAME, value) protected var externalDocumentationLinks: MutableList = mutableListOf() 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 7fec7d24..09183858 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 @@ -92,13 +92,13 @@ open class GradlePassConfigurationImpl(@Transient val name: String = ""): PassCo } } -class GradleSourceLinkDefinitionImpl : SourceLinkDefinition { +class GradleSourceLinkDefinitionImpl : SourceLinkDefinition, Serializable { override var path: String = "" override var url: String = "" override var lineSuffix: String? = null } -class GradleExternalDocumentationLinkImpl : ExternalDocumentationLink { +class GradleExternalDocumentationLinkImpl : ExternalDocumentationLink, Serializable { override var url: URL = URL("http://") override var packageListUrl: URL = URL("http://") } @@ -112,7 +112,7 @@ class GradleDokkaConfigurationImpl: DokkaConfiguration { override var passesConfigurations: List = emptyList() } -class GradlePackageOptionsImpl: PackageOptions { +class GradlePackageOptionsImpl: PackageOptions, Serializable { override var prefix: String = "" override val includeNonPublic: Boolean = false override val reportUndocumented: Boolean = true diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/main.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/main.kt index a87b803c..24fe9df1 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/main.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/main.kt @@ -34,8 +34,7 @@ open class DokkaPlugin : Plugin { } project.tasks.withType(DokkaTask::class.java) { task -> - val passConfiguration = project.container(GradlePassConfigurationImpl::class.java) - task.multiplatform = passConfiguration + task.multiplatform = project.container(GradlePassConfigurationImpl::class.java) task.configuration = GradlePassConfigurationImpl() task.dokkaRuntime = dokkaRuntimeConfiguration task.defaultDokkaRuntime = defaultDokkaRuntimeConfiguration -- cgit