diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2019-06-18 17:44:12 +0200 |
---|---|---|
committer | Kamil Doległo <kamilok1965@interia.pl> | 2019-06-18 17:44:12 +0200 |
commit | ac4d4db037930e266a1a6d27996cd16928395eb1 (patch) | |
tree | 4e200ba1fa883715778a63fbf1bb3493f3aac5e9 | |
parent | 77cc7997ee93eef9b307984b49895220be355aea (diff) | |
download | dokka-ac4d4db037930e266a1a6d27996cd16928395eb1.tar.gz dokka-ac4d4db037930e266a1a6d27996cd16928395eb1.tar.bz2 dokka-ac4d4db037930e266a1a6d27996cd16928395eb1.zip |
Fix NotSerializableException
6 files changed, 18 insertions, 23 deletions
diff --git a/runners/android-gradle-plugin/src/main/kotlin/mainAndroid.kt b/runners/android-gradle-plugin/src/main/kotlin/mainAndroid.kt index 5646a75f..d26f136e 100644 --- a/runners/android-gradle-plugin/src/main/kotlin/mainAndroid.kt +++ b/runners/android-gradle-plugin/src/main/kotlin/mainAndroid.kt @@ -13,24 +13,24 @@ open class DokkaAndroidPlugin : DokkaPlugin() { val dokkaRuntimeConfiguration = project.configurations.create("dokkaRuntime") val defaultDokkaRuntimeConfiguration = project.configurations.create("defaultDokkaRuntime") + val taskName = "dokka" defaultDokkaRuntimeConfiguration.defaultDependencies{ dependencies -> dependencies.add(project.dependencies.create("org.jetbrains.dokka:dokka-fatjar:${DokkaVersion.version}")) } if(GradleVersion.current() >= GradleVersion.version("4.10")) { - project.tasks.register("dokka", DokkaAndroidTask::class.java).configure { + project.tasks.register(taskName, DokkaAndroidTask::class.java).configure { it.moduleName = project.name - it.outputDirectory = File(project.buildDir, "dokka").absolutePath + it.outputDirectory = File(project.buildDir, taskName).absolutePath } } else { - project.tasks.create("dokka", DokkaAndroidTask::class.java).apply { + project.tasks.create(taskName, DokkaAndroidTask::class.java).apply { moduleName = project.name - outputDirectory = File(project.buildDir, "dokka").absolutePath + outputDirectory = File(project.buildDir, taskName).absolutePath } } project.tasks.withType(DokkaAndroidTask::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 diff --git a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/BasicTest.kt b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/BasicTest.kt index ebaf1653..2e1a0d41 100644 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/BasicTest.kt +++ b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/BasicTest.kt @@ -37,10 +37,6 @@ class BasicTest : AbstractDokkaGradleTest() { """<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html"><span class="identifier">String</span></a>""") } - @Test fun `test kotlin 1_1_2 and gradle 3_5`() { - doTest("3.5", "1.1.2") - } - @Test fun `test kotlin 1_0_7 and gradle 2_14_1`() { doTest("2.14.1", "1.0.7") } diff --git a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/RebuildAfterSourceChangeTest.kt b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/RebuildAfterSourceChangeTest.kt index f712998c..8b2db560 100644 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/RebuildAfterSourceChangeTest.kt +++ b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/RebuildAfterSourceChangeTest.kt @@ -30,7 +30,7 @@ class RebuildAfterSourceChangeTest : AbstractDokkaGradleTest() { } - configure(gradleVersion, kotlinVersion, arguments = arrayOf("dokka", "--stacktrace")).build().let { result -> + configure(gradleVersion, kotlinVersion, arguments = arrayOf("dokka", "-i", "--stacktrace")).build().let { result -> println(result.output) assertEquals(TaskOutcome.UP_TO_DATE, result.task(":dokka")?.outcome) @@ -53,13 +53,13 @@ class RebuildAfterSourceChangeTest : AbstractDokkaGradleTest() { @Test - fun `test kotlin 1_1_2 and gradle 3_5`() { - doTest("3.5", "1.1.2") + fun `test kotlin 1_0_7 and gradle 2_14_1`() { + doTest("2.14.1", "1.0.7") } @Test - fun `test kotlin 1_0_7 and gradle 2_14_1`() { - doTest("2.14.1", "1.0.7") + fun `test kotlin 1_1_2 and gradle 3_5`() { + doTest("3.5", "1.1.2") } @Test 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<GradlePassConfigurationImpl> + var multiplatform: Set<GradlePassConfigurationImpl> @Suppress("UNCHECKED_CAST") - @Input get() = DslObject(this).extensions.getByName(MULTIPLATFORM_EXTENSION_NAME) as NamedDomainObjectContainer<GradlePassConfigurationImpl> + @Input get() = (DslObject(this).extensions.getByName(MULTIPLATFORM_EXTENSION_NAME) as NamedDomainObjectContainer<GradlePassConfigurationImpl>).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<DokkaConfiguration.ExternalDocumentationLink> = 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<GradlePassConfigurationImpl> = 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> { } 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 |