From cb20227d354b1b74ca6784d55ea75cc8b5281abd Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Tue, 7 Jul 2020 11:08:34 +0200 Subject: Implement simple cli integration test --- integration-tests/cli/build.gradle.kts | 39 ++++++++++ .../main/java/it/basic/java/SampleJavaClass.java | 17 +++++ .../it-cli/src/main/kotlin/it/basic/PublicClass.kt | 48 +++++++++++++ .../jetbrains/dokka/it/cli/CliIntegrationTest.kt | 82 ++++++++++++++++++++++ .../dokka/it/cli/AbstractCliIntegrationTest.kt | 36 ++++++++++ .../org/jetbrains/dokka/it/cli/processUtils.kt | 51 ++++++++++++++ 6 files changed, 273 insertions(+) create mode 100644 integration-tests/cli/build.gradle.kts create mode 100644 integration-tests/cli/projects/it-cli/src/main/java/it/basic/java/SampleJavaClass.java create mode 100644 integration-tests/cli/projects/it-cli/src/main/kotlin/it/basic/PublicClass.kt create mode 100644 integration-tests/cli/src/integrationTest/kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt create mode 100644 integration-tests/cli/src/main/kotlin/org/jetbrains/dokka/it/cli/AbstractCliIntegrationTest.kt create mode 100644 integration-tests/cli/src/main/kotlin/org/jetbrains/dokka/it/cli/processUtils.kt (limited to 'integration-tests/cli') diff --git a/integration-tests/cli/build.gradle.kts b/integration-tests/cli/build.gradle.kts new file mode 100644 index 00000000..c3e98d0a --- /dev/null +++ b/integration-tests/cli/build.gradle.kts @@ -0,0 +1,39 @@ +import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar + + +plugins { + id("com.github.johnrengelman.shadow") +} + +val dokka_version: String by project +evaluationDependsOn(":runners:cli") +evaluationDependsOn(":plugins:base") + +dependencies { + implementation(kotlin("stdlib")) + implementation(kotlin("test-junit")) + + val coroutines_version: String by project + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version") + +} + +/* Create a fat base plugin jar for cli tests */ +val basePluginShadow: Configuration by configurations.creating +dependencies { + basePluginShadow(project(":plugins:base")) +} +val basePluginShadowJar = tasks.create("basePluginShadowJar", ShadowJar::class) { + configurations = listOf(basePluginShadow) + archiveFileName.set("fat-base-plugin-$dokka_version.jar") + archiveClassifier.set("") +} + +tasks.integrationTest { + val cliJar = tasks.getByPath(":runners:cli:shadowJar") as ShadowJar + environment("CLI_JAR_PATH", cliJar.archiveFile.get()) + environment("BASE_PLUGIN_JAR_PATH", basePluginShadowJar.archiveFile.get()) + dependsOn(cliJar) + dependsOn(basePluginShadowJar) +} + diff --git a/integration-tests/cli/projects/it-cli/src/main/java/it/basic/java/SampleJavaClass.java b/integration-tests/cli/projects/it-cli/src/main/java/it/basic/java/SampleJavaClass.java new file mode 100644 index 00000000..23b0202c --- /dev/null +++ b/integration-tests/cli/projects/it-cli/src/main/java/it/basic/java/SampleJavaClass.java @@ -0,0 +1,17 @@ +package it.basic.java; + +import it.basic.PublicClass; + +/** + * This class is, unlike {@link PublicClass}, written in Java + */ +@SuppressWarnings("unused") +public class SampleJavaClass { + + /** + * @return Empty instance of {@link PublicClass} + */ + public PublicClass publicDocumentedFunction() { + return new PublicClass(); + } +} diff --git a/integration-tests/cli/projects/it-cli/src/main/kotlin/it/basic/PublicClass.kt b/integration-tests/cli/projects/it-cli/src/main/kotlin/it/basic/PublicClass.kt new file mode 100644 index 00000000..71bc7e63 --- /dev/null +++ b/integration-tests/cli/projects/it-cli/src/main/kotlin/it/basic/PublicClass.kt @@ -0,0 +1,48 @@ +@file:Suppress("unused") + +package it.basic + +class PublicClass { + /** + * This function is public and documented + */ + fun publicDocumentedFunction(): String = "" + + fun publicUndocumentedFunction(): String = "" + + /** + * This function is internal and documented + */ + internal fun internalDocumentedFunction(): String = "" + + internal fun internalUndocumentedFunction(): String = "" + + /** + * This function is private and documented + */ + private fun privateDocumentedFunction(): String = "" + + private fun privateUndocumentedFunction(): String = "" + + + /** + * This property is public and documented + */ + val publicDocumentedProperty: Int = 0 + + val publicUndocumentedProperty: Int = 0 + + /** + * This property internal and documented + */ + val internalDocumentedProperty: Int = 0 + + val internalUndocumentedProperty: Int = 0 + + /** + * This property private and documented + */ + private val privateDocumentedProperty: Int = 0 + + private val privateUndocumentedProperty: Int = 0 +} diff --git a/integration-tests/cli/src/integrationTest/kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt b/integration-tests/cli/src/integrationTest/kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt new file mode 100644 index 00000000..5e24c1cd --- /dev/null +++ b/integration-tests/cli/src/integrationTest/kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt @@ -0,0 +1,82 @@ +package org.jetbrains.dokka.it.cli + +import java.io.File +import kotlin.test.BeforeTest +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertTrue + +class CliIntegrationTest : AbstractCliIntegrationTest() { + + @BeforeTest + fun copyProject() { + val templateProjectDir = File("projects", "it-cli") + templateProjectDir.copyRecursively(projectDir) + } + + @Test + fun runHelp() { + val process = ProcessBuilder("java", "-jar", cliJarFile.path, "-h") + .redirectErrorStream(true) + .start() + + val result = process.awaitProcessResult() + assertEquals(0, result.exitCode, "Expected exitCode 0 (Success)") + assertTrue("Usage: " in result.output) + } + + @Test + fun runCli() { + val dokkaOutputDir = File(projectDir, "output") + assertTrue(dokkaOutputDir.mkdirs()) + val process = ProcessBuilder( + "java", "-jar", cliJarFile.path, + "-outputDir", dokkaOutputDir.path, + "-format", "html", + "-pluginsClasspath", basePluginJarFile.path, + "-sourceSet", + buildString { + append(" -moduleName it-cli") + append(" -moduleDisplayName CLI-Example") + append(" -sourceSetName cliMain") + append(" -src ${File(projectDir, "src").path}") + append(" -jdkVersion 8") + append(" -analysisPlatform jvm") + append(" -reportUndocumented") + append(" -skipDeprecated") + } + ) + .redirectErrorStream(true) + .start() + + val result = process.awaitProcessResult() + assertEquals(0, result.exitCode, "Expected exitCode 0 (Success)") + + val extensionLoadedRegex = Regex("""Extension: org\.jetbrains\.dokka\.base\.DokkaBase""") + val amountOfExtensionsLoaded = extensionLoadedRegex.findAll(result.output).count() + + assertTrue( + amountOfExtensionsLoaded > 10, + "Expected more than 10 extensions being present (found $amountOfExtensionsLoaded)" + ) + + assertTrue(dokkaOutputDir.isDirectory, "Missing dokka output directory") + + val imagesDir = File(dokkaOutputDir, "images") + assertTrue(imagesDir.isDirectory, "Missing images directory") + + val scriptsDir = File(dokkaOutputDir, "scripts") + assertTrue(scriptsDir.isDirectory, "Missing scripts directory") + + val stylesDir = File(dokkaOutputDir, "styles") + assertTrue(stylesDir.isDirectory, "Missing styles directory") + + val navigationHtml = File(dokkaOutputDir, "navigation.html") + assertTrue(navigationHtml.isFile, "Missing navigation.html") + + projectDir.allHtmlFiles().forEach { file -> + assertContainsNoErrorClass(file) + assertNoUnresolvedLInks(file) + } + } +} diff --git a/integration-tests/cli/src/main/kotlin/org/jetbrains/dokka/it/cli/AbstractCliIntegrationTest.kt b/integration-tests/cli/src/main/kotlin/org/jetbrains/dokka/it/cli/AbstractCliIntegrationTest.kt new file mode 100644 index 00000000..7f6f9433 --- /dev/null +++ b/integration-tests/cli/src/main/kotlin/org/jetbrains/dokka/it/cli/AbstractCliIntegrationTest.kt @@ -0,0 +1,36 @@ +package org.jetbrains.dokka.it.cli + +import org.jetbrains.dokka.it.AbstractIntegrationTest +import java.io.File +import kotlin.test.BeforeTest +import kotlin.test.assertTrue + +abstract class AbstractCliIntegrationTest : AbstractIntegrationTest() { + + protected val cliJarFile: File by lazy { + File(temporaryTestFolder.root, "dokka.jar") + } + + protected val basePluginJarFile: File by lazy { + File(temporaryTestFolder.root, "base-plugin.jar") + } + + @BeforeTest + fun copyJarFiles() { + val cliJarPathEnvironmentKey = "CLI_JAR_PATH" + val cliJarFile = File(System.getenv(cliJarPathEnvironmentKey)) + assertTrue( + cliJarFile.exists() && cliJarFile.isFile, + "Missing path to CLI jar System.getenv($cliJarPathEnvironmentKey)" + ) + cliJarFile.copyTo(this.cliJarFile) + + val basePluginPathEnvironmentKey = "BASE_PLUGIN_JAR_PATH" + val basePluginJarFile = File(System.getenv(basePluginPathEnvironmentKey)) + assertTrue( + basePluginJarFile.exists() && basePluginJarFile.isFile, + "Missing path to base plugin jar System.getenv($basePluginPathEnvironmentKey)" + ) + basePluginJarFile.copyTo(this.basePluginJarFile) + } +} diff --git a/integration-tests/cli/src/main/kotlin/org/jetbrains/dokka/it/cli/processUtils.kt b/integration-tests/cli/src/main/kotlin/org/jetbrains/dokka/it/cli/processUtils.kt new file mode 100644 index 00000000..d2fa3b31 --- /dev/null +++ b/integration-tests/cli/src/main/kotlin/org/jetbrains/dokka/it/cli/processUtils.kt @@ -0,0 +1,51 @@ +package org.jetbrains.dokka.it.cli + +import kotlinx.coroutines.CompletableDeferred +import kotlinx.coroutines.async +import kotlinx.coroutines.runBlocking +import kotlin.concurrent.thread + +class ProcessResult( + val exitCode: Int, + val output: String +) + +fun Process.awaitProcessResult() = runBlocking { + val exitCode = async { awaitExitCode() } + val output = async { awaitOutput() } + ProcessResult( + exitCode.await(), + output.await() + ) +} + +private suspend fun Process.awaitExitCode(): Int { + val deferred = CompletableDeferred() + thread { + try { + deferred.complete(this.waitFor()) + } catch (e: Throwable) { + deferred.completeExceptionally(e) + } + } + + return deferred.await() +} + +private suspend fun Process.awaitOutput(): String { + val deferred = CompletableDeferred() + thread { + try { + var string = "" + this.inputStream.bufferedReader().forEachLine { line -> + println(line) + string += line + System.lineSeparator() + } + deferred.complete(string) + } catch (e: Throwable) { + deferred.completeExceptionally(e) + } + } + + return deferred.await() +} -- cgit From f542ceb8014437a089175eac463e1fbf7cf520fd Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Tue, 7 Jul 2020 11:46:19 +0200 Subject: CliIntegrationTest: Add assertion for undocumented reports --- .../kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'integration-tests/cli') diff --git a/integration-tests/cli/src/integrationTest/kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt b/integration-tests/cli/src/integrationTest/kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt index 5e24c1cd..49030c73 100644 --- a/integration-tests/cli/src/integrationTest/kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt +++ b/integration-tests/cli/src/integrationTest/kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt @@ -60,6 +60,13 @@ class CliIntegrationTest : AbstractCliIntegrationTest() { "Expected more than 10 extensions being present (found $amountOfExtensionsLoaded)" ) + val undocumentedReportRegex = Regex("""Undocumented:""") + val amountOfUndocumentedReports = undocumentedReportRegex.findAll(result.output).count() + assertTrue( + amountOfUndocumentedReports > 0, + "Expected at least one report of undocumented code (found $amountOfUndocumentedReports)" + ) + assertTrue(dokkaOutputDir.isDirectory, "Missing dokka output directory") val imagesDir = File(dokkaOutputDir, "images") -- cgit From 14b9352b9b7a4084f72209ba686170e313f7863b Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Tue, 7 Jul 2020 13:12:05 +0200 Subject: Lazily configure integration test tasks --- integration-tests/build.gradle.kts | 2 +- integration-tests/cli/build.gradle.kts | 2 +- integration-tests/gradle/build.gradle.kts | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'integration-tests/cli') diff --git a/integration-tests/build.gradle.kts b/integration-tests/build.gradle.kts index 44da74cf..70b6db26 100644 --- a/integration-tests/build.gradle.kts +++ b/integration-tests/build.gradle.kts @@ -18,7 +18,7 @@ subprojects { implementation(project(":integration-tests")) } - val integrationTest = task("integrationTest") { + val integrationTest by tasks.register("integrationTest") { maxHeapSize = "2G" description = "Runs integration tests." group = "verification" diff --git a/integration-tests/cli/build.gradle.kts b/integration-tests/cli/build.gradle.kts index c3e98d0a..f825a148 100644 --- a/integration-tests/cli/build.gradle.kts +++ b/integration-tests/cli/build.gradle.kts @@ -23,7 +23,7 @@ val basePluginShadow: Configuration by configurations.creating dependencies { basePluginShadow(project(":plugins:base")) } -val basePluginShadowJar = tasks.create("basePluginShadowJar", ShadowJar::class) { +val basePluginShadowJar by tasks.register("basePluginShadowJar", ShadowJar::class) { configurations = listOf(basePluginShadow) archiveFileName.set("fat-base-plugin-$dokka_version.jar") archiveClassifier.set("") diff --git a/integration-tests/gradle/build.gradle.kts b/integration-tests/gradle/build.gradle.kts index 2c526af7..28e20cf9 100644 --- a/integration-tests/gradle/build.gradle.kts +++ b/integration-tests/gradle/build.gradle.kts @@ -6,13 +6,13 @@ dependencies { implementation(gradleTestKit()) } -val integrationTest by tasks.integrationTest -integrationTest.inputs.dir(file("projects")) - -rootProject.allprojects.forEach { otherProject -> - otherProject.invokeWhenEvaluated { evaluatedProject -> - evaluatedProject.tasks.findByName("publishToMavenLocal")?.let { publishingTask -> - integrationTest.dependsOn(publishingTask) +tasks.integrationTest { + inputs.dir(file("projects")) + rootProject.allprojects.forEach { otherProject -> + otherProject.invokeWhenEvaluated { evaluatedProject -> + evaluatedProject.tasks.findByName("publishToMavenLocal")?.let { publishingTask -> + this.dependsOn(publishingTask) + } } } } -- cgit From 90459de7b6fce28a8ba57aca5eb213575204bc3d Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Mon, 15 Jun 2020 18:13:35 +0200 Subject: Update to Kotlin 1.4 M3 --- gradle.properties | 6 +++--- integration-tests/cli/build.gradle.kts | 7 ++++++- .../org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt | 1 - .../kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt | 4 ++++ .../kotlin/org/jetbrains/dokka/analysis/EnvironmentAndFacade.kt | 7 ++----- plugins/base/build.gradle.kts | 2 +- plugins/javadoc/build.gradle.kts | 3 +++ 7 files changed, 19 insertions(+), 11 deletions(-) (limited to 'integration-tests/cli') diff --git a/gradle.properties b/gradle.properties index edd78940..f0c75c72 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,9 +2,9 @@ dokka_version_base=0.11.0 dokka_publication_channel=dokka # Kotlin compiler and plugin -kotlin_version=1.4-M2-eap-70 -kotlin_plugin_version=1.4-M2-eap-63 -coroutines_version=1.3.7-1.4-M2 +kotlin_version=1.4-M3-eap-197 +kotlin_plugin_version=1.4-M3-release-207 +coroutines_version=1.3.7-1.4-M3 idea_version=193.6494.35 language_version=1.4 diff --git a/integration-tests/cli/build.gradle.kts b/integration-tests/cli/build.gradle.kts index f825a148..5fdf0ff5 100644 --- a/integration-tests/cli/build.gradle.kts +++ b/integration-tests/cli/build.gradle.kts @@ -19,7 +19,12 @@ dependencies { } /* Create a fat base plugin jar for cli tests */ -val basePluginShadow: Configuration by configurations.creating +val basePluginShadow: Configuration by configurations.creating { + attributes { + attribute(Usage.USAGE_ATTRIBUTE, project.objects.named(Usage::class.java, "java-runtime")) + } +} + dependencies { basePluginShadow(project(":plugins:base")) } diff --git a/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt b/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt index f2dece62..2ba49a5a 100644 --- a/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt +++ b/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt @@ -42,4 +42,3 @@ abstract class AbstractGradleIntegrationTest : AbstractIntegrationTest() { .withJvmArguments("-Xmx4G", "-XX:MaxMetaspaceSize=1G") } } - diff --git a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt index 7836bde9..43bb9e48 100644 --- a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt +++ b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt @@ -633,4 +633,8 @@ class DokkaResolutionFacade( throw UnsupportedOperationException() } + override fun getResolverForProject(): ResolverForProject { + throw UnsupportedOperationException() + } + } diff --git a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/EnvironmentAndFacade.kt b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/EnvironmentAndFacade.kt index a12becee..d9a89194 100644 --- a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/EnvironmentAndFacade.kt +++ b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/EnvironmentAndFacade.kt @@ -3,10 +3,7 @@ package org.jetbrains.dokka.analysis import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.Platform import org.jetbrains.dokka.utilities.DokkaLogger -import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation -import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity -import org.jetbrains.kotlin.cli.common.messages.MessageCollector -import org.jetbrains.kotlin.cli.common.messages.MessageRenderer +import org.jetbrains.kotlin.cli.common.messages.* import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment import org.jetbrains.kotlin.utils.PathUtil import java.io.File @@ -42,7 +39,7 @@ class DokkaMessageCollector(private val logger: DokkaLogger) : MessageCollector private var seenErrors = false - override fun report(severity: CompilerMessageSeverity, message: String, location: CompilerMessageLocation?) { + override fun report(severity: CompilerMessageSeverity, message: String, location: CompilerMessageSourceLocation?) { if (severity == CompilerMessageSeverity.ERROR) { seenErrors = true } diff --git a/plugins/base/build.gradle.kts b/plugins/base/build.gradle.kts index cc34fce9..02babd4d 100644 --- a/plugins/base/build.gradle.kts +++ b/plugins/base/build.gradle.kts @@ -6,7 +6,7 @@ plugins { dependencies { val coroutines_version: String by project - // implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version") // TODO: Enable this dependency after update to 1.4-M3 + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version") api(project(":kotlin-analysis")) implementation("org.jsoup:jsoup:1.12.1") diff --git a/plugins/javadoc/build.gradle.kts b/plugins/javadoc/build.gradle.kts index 1f39c3a1..4c5c22b0 100644 --- a/plugins/javadoc/build.gradle.kts +++ b/plugins/javadoc/build.gradle.kts @@ -15,6 +15,9 @@ dependencies { implementation("org.jetbrains.kotlinx:kotlinx-html-jvm:0.6.10") implementation(project(":plugins:base")) implementation(project(":plugins:kotlin-as-java")) + + val coroutines_version: String by project + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version") } configureBintrayPublication("javadocPlugin") -- cgit From caf48e76f3bff5e9907cd094cf0719f623e528d5 Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Wed, 8 Jul 2020 10:47:05 +0200 Subject: Implement simple MavenIntegrationTest.kt --- .../src/main/kotlin/org/jetbrains/taskUtils.kt | 13 ++ integration-tests/build.gradle.kts | 3 +- integration-tests/cli/build.gradle.kts | 5 +- .../jetbrains/dokka/it/cli/CliIntegrationTest.kt | 1 + .../org/jetbrains/dokka/it/cli/processUtils.kt | 51 ------- integration-tests/gradle/build.gradle.kts | 10 +- .../it/gradle/Android0GradleIntegrationTest.kt | 14 +- integration-tests/maven/build.gradle.kts | 17 +++ integration-tests/maven/projects/it-maven/pom.xml | 170 +++++++++++++++++++++ .../main/java/it/basic/java/SampleJavaClass.java | 22 +++ .../src/main/kotlin/it/basic/PublicClass.kt | 48 ++++++ .../dokka/it/maven/MavenIntegrationTest.kt | 78 ++++++++++ .../org/jetbrains/dokka/it/environmentUtils.kt | 16 ++ .../kotlin/org/jetbrains/dokka/it/processUtils.kt | 51 +++++++ runners/maven-plugin/build.gradle.kts | 3 + runners/maven-plugin/src/main/kotlin/DokkaMojo.kt | 3 - settings.gradle.kts | 1 + 17 files changed, 428 insertions(+), 78 deletions(-) create mode 100644 buildSrc/src/main/kotlin/org/jetbrains/taskUtils.kt delete mode 100644 integration-tests/cli/src/main/kotlin/org/jetbrains/dokka/it/cli/processUtils.kt create mode 100644 integration-tests/maven/build.gradle.kts create mode 100644 integration-tests/maven/projects/it-maven/pom.xml create mode 100644 integration-tests/maven/projects/it-maven/src/main/java/it/basic/java/SampleJavaClass.java create mode 100644 integration-tests/maven/projects/it-maven/src/main/kotlin/it/basic/PublicClass.kt create mode 100644 integration-tests/maven/src/integrationTest/kotlin/org/jetbrains/dokka/it/maven/MavenIntegrationTest.kt create mode 100644 integration-tests/src/main/kotlin/org/jetbrains/dokka/it/environmentUtils.kt create mode 100644 integration-tests/src/main/kotlin/org/jetbrains/dokka/it/processUtils.kt (limited to 'integration-tests/cli') diff --git a/buildSrc/src/main/kotlin/org/jetbrains/taskUtils.kt b/buildSrc/src/main/kotlin/org/jetbrains/taskUtils.kt new file mode 100644 index 00000000..b018ba13 --- /dev/null +++ b/buildSrc/src/main/kotlin/org/jetbrains/taskUtils.kt @@ -0,0 +1,13 @@ +package org.jetbrains + +import org.gradle.api.Task + +fun Task.dependsOnMavenLocalPublication() { + project.rootProject.allprojects.forEach { otherProject -> + otherProject.invokeWhenEvaluated { evaluatedProject -> + evaluatedProject.tasks.findByName("publishToMavenLocal")?.let { publishingTask -> + this.dependsOn(publishingTask) + } + } + } +} diff --git a/integration-tests/build.gradle.kts b/integration-tests/build.gradle.kts index 70b6db26..070091a0 100644 --- a/integration-tests/build.gradle.kts +++ b/integration-tests/build.gradle.kts @@ -37,4 +37,5 @@ subprojects { dependencies { implementation(kotlin("stdlib")) implementation(kotlin("test-junit")) -} + val coroutines_version: String by project + api("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")} diff --git a/integration-tests/cli/build.gradle.kts b/integration-tests/cli/build.gradle.kts index 5fdf0ff5..60d3a298 100644 --- a/integration-tests/cli/build.gradle.kts +++ b/integration-tests/cli/build.gradle.kts @@ -12,10 +12,6 @@ evaluationDependsOn(":plugins:base") dependencies { implementation(kotlin("stdlib")) implementation(kotlin("test-junit")) - - val coroutines_version: String by project - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version") - } /* Create a fat base plugin jar for cli tests */ @@ -35,6 +31,7 @@ val basePluginShadowJar by tasks.register("basePluginShadowJar", ShadowJar::clas } tasks.integrationTest { + inputs.dir((file("projects"))) val cliJar = tasks.getByPath(":runners:cli:shadowJar") as ShadowJar environment("CLI_JAR_PATH", cliJar.archiveFile.get()) environment("BASE_PLUGIN_JAR_PATH", basePluginShadowJar.archiveFile.get()) diff --git a/integration-tests/cli/src/integrationTest/kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt b/integration-tests/cli/src/integrationTest/kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt index 49030c73..9f83c869 100644 --- a/integration-tests/cli/src/integrationTest/kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt +++ b/integration-tests/cli/src/integrationTest/kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt @@ -1,5 +1,6 @@ package org.jetbrains.dokka.it.cli +import org.jetbrains.dokka.it.awaitProcessResult import java.io.File import kotlin.test.BeforeTest import kotlin.test.Test diff --git a/integration-tests/cli/src/main/kotlin/org/jetbrains/dokka/it/cli/processUtils.kt b/integration-tests/cli/src/main/kotlin/org/jetbrains/dokka/it/cli/processUtils.kt deleted file mode 100644 index d2fa3b31..00000000 --- a/integration-tests/cli/src/main/kotlin/org/jetbrains/dokka/it/cli/processUtils.kt +++ /dev/null @@ -1,51 +0,0 @@ -package org.jetbrains.dokka.it.cli - -import kotlinx.coroutines.CompletableDeferred -import kotlinx.coroutines.async -import kotlinx.coroutines.runBlocking -import kotlin.concurrent.thread - -class ProcessResult( - val exitCode: Int, - val output: String -) - -fun Process.awaitProcessResult() = runBlocking { - val exitCode = async { awaitExitCode() } - val output = async { awaitOutput() } - ProcessResult( - exitCode.await(), - output.await() - ) -} - -private suspend fun Process.awaitExitCode(): Int { - val deferred = CompletableDeferred() - thread { - try { - deferred.complete(this.waitFor()) - } catch (e: Throwable) { - deferred.completeExceptionally(e) - } - } - - return deferred.await() -} - -private suspend fun Process.awaitOutput(): String { - val deferred = CompletableDeferred() - thread { - try { - var string = "" - this.inputStream.bufferedReader().forEachLine { line -> - println(line) - string += line + System.lineSeparator() - } - deferred.complete(string) - } catch (e: Throwable) { - deferred.completeExceptionally(e) - } - } - - return deferred.await() -} diff --git a/integration-tests/gradle/build.gradle.kts b/integration-tests/gradle/build.gradle.kts index 28e20cf9..3da416bb 100644 --- a/integration-tests/gradle/build.gradle.kts +++ b/integration-tests/gradle/build.gradle.kts @@ -1,4 +1,4 @@ -import org.jetbrains.invokeWhenEvaluated +import org.jetbrains.dependsOnMavenLocalPublication dependencies { implementation(kotlin("stdlib")) @@ -8,13 +8,7 @@ dependencies { tasks.integrationTest { inputs.dir(file("projects")) - rootProject.allprojects.forEach { otherProject -> - otherProject.invokeWhenEvaluated { evaluatedProject -> - evaluatedProject.tasks.findByName("publishToMavenLocal")?.let { publishingTask -> - this.dependsOn(publishingTask) - } - } - } + dependsOnMavenLocalPublication() } tasks.clean { diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Android0GradleIntegrationTest.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Android0GradleIntegrationTest.kt index e08dbca5..0a29555f 100644 --- a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Android0GradleIntegrationTest.kt +++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Android0GradleIntegrationTest.kt @@ -1,6 +1,8 @@ package org.jetbrains.dokka.it.gradle import org.gradle.testkit.runner.TaskOutcome +import org.jetbrains.dokka.it.isAndroidSdkInstalled +import org.jetbrains.dokka.it.isCI import org.junit.Assume import org.junit.runners.Parameterized.Parameters import java.io.File @@ -28,20 +30,10 @@ class Android0GradleIntegrationTest(override val versions: BuildVersions) : Abst @BeforeTest fun assumeAndroidInstallation() { - val isCI = System.getenv("CI") != null if (isCI) { return } - - val androidSdkRoot = System.getenv("ANDROID_SDK_ROOT") - val androidHome = System.getenv("ANDROID_HOME") - - val isAndroidSdkInstalled = androidSdkRoot != null || androidHome != null - - Assume.assumeTrue( - "Missing ANDROID_SDK_ROOT", - isAndroidSdkInstalled - ) + Assume.assumeTrue("Missing ANDROID_SDK_ROOT", isAndroidSdkInstalled) } @BeforeTest diff --git a/integration-tests/maven/build.gradle.kts b/integration-tests/maven/build.gradle.kts new file mode 100644 index 00000000..b0187b13 --- /dev/null +++ b/integration-tests/maven/build.gradle.kts @@ -0,0 +1,17 @@ +import org.jetbrains.dependsOnMavenLocalPublication + +evaluationDependsOn(":runners:maven-plugin") + +dependencies { + implementation(kotlin("stdlib")) + implementation(kotlin("test-junit")) +} + +tasks.integrationTest { + dependsOnMavenLocalPublication() + dependsOn(":runners:maven-plugin:setupMaven") + + val dokka_version: String by project + environment("DOKKA_VERSION", dokka_version) + environment("MVN_BINARY_PATH", project(":runners:maven-plugin").extra["MVN_BINARY_PATH"].toString()) +} diff --git a/integration-tests/maven/projects/it-maven/pom.xml b/integration-tests/maven/projects/it-maven/pom.xml new file mode 100644 index 00000000..47bd633c --- /dev/null +++ b/integration-tests/maven/projects/it-maven/pom.xml @@ -0,0 +1,170 @@ + + 4.0.0 + + org.jetbrains.dokka + it-maven + 1.0-SNAPSHOT + + + 1.3.72 + + + + + org.jetbrains.kotlin + kotlin-maven-plugin + ${kotlin.version} + + + compile + + compile + + + + ${project.basedir}/src/main/kotlin + ${project.basedir}/src/main/java + + + + + test-compile + + test-compile + + + + ${project.basedir}/src/test/kotlin + ${project.basedir}/src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.5.1 + + + + default-compile + none + + + + default-testCompile + none + + + java-compile + compile + + compile + + + + java-test-compile + test-compile + + testCompile + + + + + + org.jetbrains.dokka + dokka-maven-plugin + $dokka_version + + + pre-site + + dokka + + + + + + + false + + + Maven Integration Test Module + + + html + + ${project.basedir}/output + + + + default + + + + 8 + + + false + + true + + true + + + + ${project.basedir}/src/main/kotlin + ${project.basedir}/src/main/java + + + + + false + + + false + + + + + + kotlin + + + false + + true + false + + + + + + ${project.basedir}/src/main/kotlin + ${project.basedir}/src/test/kotlin + + + + + kotlin-dev + https://dl.bintray.com/kotlin/kotlin-dev/ + + + jcenter + JCenter + https://jcenter.bintray.com/ + + + + + + org.jetbrains.kotlin + kotlin-stdlib + ${kotlin.version} + + + + + diff --git a/integration-tests/maven/projects/it-maven/src/main/java/it/basic/java/SampleJavaClass.java b/integration-tests/maven/projects/it-maven/src/main/java/it/basic/java/SampleJavaClass.java new file mode 100644 index 00000000..e08bb66a --- /dev/null +++ b/integration-tests/maven/projects/it-maven/src/main/java/it/basic/java/SampleJavaClass.java @@ -0,0 +1,22 @@ +package it.basic.java; + +import it.basic.PublicClass; + +/** + * This class is, unlike {@link PublicClass}, written in Java + */ +@SuppressWarnings("unused") +public class SampleJavaClass { + + /** + * @return Empty instance of {@link PublicClass} + */ + public PublicClass publicDocumentedFunction() { + return new PublicClass(); + } + + + public PublicClass publicUndocumentedFunction() { + return new PublicClass(); + } +} diff --git a/integration-tests/maven/projects/it-maven/src/main/kotlin/it/basic/PublicClass.kt b/integration-tests/maven/projects/it-maven/src/main/kotlin/it/basic/PublicClass.kt new file mode 100644 index 00000000..71bc7e63 --- /dev/null +++ b/integration-tests/maven/projects/it-maven/src/main/kotlin/it/basic/PublicClass.kt @@ -0,0 +1,48 @@ +@file:Suppress("unused") + +package it.basic + +class PublicClass { + /** + * This function is public and documented + */ + fun publicDocumentedFunction(): String = "" + + fun publicUndocumentedFunction(): String = "" + + /** + * This function is internal and documented + */ + internal fun internalDocumentedFunction(): String = "" + + internal fun internalUndocumentedFunction(): String = "" + + /** + * This function is private and documented + */ + private fun privateDocumentedFunction(): String = "" + + private fun privateUndocumentedFunction(): String = "" + + + /** + * This property is public and documented + */ + val publicDocumentedProperty: Int = 0 + + val publicUndocumentedProperty: Int = 0 + + /** + * This property internal and documented + */ + val internalDocumentedProperty: Int = 0 + + val internalUndocumentedProperty: Int = 0 + + /** + * This property private and documented + */ + private val privateDocumentedProperty: Int = 0 + + private val privateUndocumentedProperty: Int = 0 +} diff --git a/integration-tests/maven/src/integrationTest/kotlin/org/jetbrains/dokka/it/maven/MavenIntegrationTest.kt b/integration-tests/maven/src/integrationTest/kotlin/org/jetbrains/dokka/it/maven/MavenIntegrationTest.kt new file mode 100644 index 00000000..e52debf4 --- /dev/null +++ b/integration-tests/maven/src/integrationTest/kotlin/org/jetbrains/dokka/it/maven/MavenIntegrationTest.kt @@ -0,0 +1,78 @@ +package org.jetbrains.dokka.it.maven + +import org.jetbrains.dokka.it.AbstractIntegrationTest +import org.jetbrains.dokka.it.awaitProcessResult +import java.io.File +import kotlin.test.BeforeTest +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertTrue + +class MavenIntegrationTest : AbstractIntegrationTest() { + + val currentDokkaVersion: String = checkNotNull(System.getenv("DOKKA_VERSION")) + + val mavenBinaryFile: File = File(checkNotNull(System.getenv("MVN_BINARY_PATH"))) + + @BeforeTest + fun prepareProjectFiles() { + val templateProjectDir = File("projects", "it-maven") + templateProjectDir.copyRecursively(projectDir) + val pomXml = File(projectDir, "pom.xml") + assertTrue(pomXml.isFile) + pomXml.apply { + writeText(readText().replace("\$dokka_version", currentDokkaVersion)) + } + } + + @Test + fun run() { + val result = ProcessBuilder().directory(projectDir) + .command(mavenBinaryFile.absolutePath, "dokka:dokka", "-U", "-e").start().awaitProcessResult() + + assertEquals(0, result.exitCode, "Expected exitCode 0 (Success)") + + val extensionLoadedRegex = Regex("""Extension: org\.jetbrains\.dokka\.base\.DokkaBase""") + val amountOfExtensionsLoaded = extensionLoadedRegex.findAll(result.output).count() + + assertTrue( + amountOfExtensionsLoaded > 10, + "Expected more than 10 extensions being present (found $amountOfExtensionsLoaded)" + ) + + val undocumentedReportRegex = Regex("""Undocumented:""") + val amountOfUndocumentedReports = undocumentedReportRegex.findAll(result.output).count() + assertTrue( + amountOfUndocumentedReports > 0, + "Expected at least one report of undocumented code (found $amountOfUndocumentedReports)" + ) + + val undocumentedJavaReportRegex = Regex("""Undocumented: it\.basic\.java""") + val amountOfUndocumentedJavaReports = undocumentedJavaReportRegex.findAll(result.output).count() + assertTrue( + amountOfUndocumentedJavaReports > 0, + "Expected at least one report of undocumented java code (found $amountOfUndocumentedJavaReports)" + ) + + val dokkaOutputDir = File(projectDir, "output") + assertTrue(dokkaOutputDir.isDirectory, "Missing dokka output directory") + + val imagesDir = File(dokkaOutputDir, "images") + assertTrue(imagesDir.isDirectory, "Missing images directory") + + val scriptsDir = File(dokkaOutputDir, "scripts") + assertTrue(scriptsDir.isDirectory, "Missing scripts directory") + + val stylesDir = File(dokkaOutputDir, "styles") + assertTrue(stylesDir.isDirectory, "Missing styles directory") + + val navigationHtml = File(dokkaOutputDir, "navigation.html") + assertTrue(navigationHtml.isFile, "Missing navigation.html") + + projectDir.allHtmlFiles().forEach { file -> + assertContainsNoErrorClass(file) + assertNoUnresolvedLInks(file) + } + + } +} diff --git a/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/environmentUtils.kt b/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/environmentUtils.kt new file mode 100644 index 00000000..eadf5a8c --- /dev/null +++ b/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/environmentUtils.kt @@ -0,0 +1,16 @@ +package org.jetbrains.dokka.it + +import java.io.File + +/** + * Indicating whether or not the current machine executing the test is a CI + */ +val isCI: Boolean get() = System.getenv("CI") == "true" + +val isAndroidSdkInstalled: Boolean = System.getenv("ANDROID_SDK_ROOT") != null || + System.getenv("ANDROID_HOME") != null + +val isMavenInstalled: Boolean = System.getenv("PATH").orEmpty() + .split(File.pathSeparator) + .flatMap { pathElement -> File(pathElement).listFiles().orEmpty().toList() } + .any { pathElement -> "mvn" == pathElement.name } diff --git a/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/processUtils.kt b/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/processUtils.kt new file mode 100644 index 00000000..d2c048ac --- /dev/null +++ b/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/processUtils.kt @@ -0,0 +1,51 @@ +package org.jetbrains.dokka.it + +import kotlinx.coroutines.CompletableDeferred +import kotlinx.coroutines.async +import kotlinx.coroutines.runBlocking +import kotlin.concurrent.thread + +class ProcessResult( + val exitCode: Int, + val output: String +) + +fun Process.awaitProcessResult() = runBlocking { + val exitCode = async { awaitExitCode() } + val output = async { awaitOutput() } + ProcessResult( + exitCode.await(), + output.await() + ) +} + +private suspend fun Process.awaitExitCode(): Int { + val deferred = CompletableDeferred() + thread { + try { + deferred.complete(this.waitFor()) + } catch (e: Throwable) { + deferred.completeExceptionally(e) + } + } + + return deferred.await() +} + +private suspend fun Process.awaitOutput(): String { + val deferred = CompletableDeferred() + thread { + try { + var string = "" + this.inputStream.bufferedReader().forEachLine { line -> + println(line) + string += line + System.lineSeparator() + } + deferred.complete(string) + } catch (e: Throwable) { + deferred.completeExceptionally(e) + } + } + + return deferred.await() +} diff --git a/runners/maven-plugin/build.gradle.kts b/runners/maven-plugin/build.gradle.kts index d9fc4f6f..8e412b43 100644 --- a/runners/maven-plugin/build.gradle.kts +++ b/runners/maven-plugin/build.gradle.kts @@ -1,5 +1,6 @@ import org.jetbrains.configureBintrayPublication import org.jetbrains.CrossPlatformExec + /** * [mavenBin] configuration is used to download Maven Plugin Plugin * for generating plugin-help.xml and plugin.xml files @@ -30,6 +31,7 @@ dependencies { val mavenBinDir = "$buildDir/maven-bin" val mavenBuildDir = "$buildDir/maven" val mvn = File(mavenBinDir, "apache-maven-$mavenVersion/bin/mvn") +extra.set("MVN_BINARY_PATH", mvn.absolutePath) tasks.named("clean") { delete(mavenBinDir) @@ -48,6 +50,7 @@ val setupMaven by tasks.registering(Sync::class) { */ val generatePom by tasks.registering(Copy::class) { val dokka_version: String by project + inputs.property("dokka_version", dokka_version) from("$projectDir/pom.tpl.xml") { rename("(.*).tpl.xml", "$1.xml") diff --git a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt index 8160ab87..aa92516f 100644 --- a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt +++ b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt @@ -87,9 +87,6 @@ abstract class AbstractDokkaMojo : AbstractMojo() { @Parameter(required = true, defaultValue = "\${project.compileSourceRoots}") var sourceDirectories: List = emptyList() - @Parameter - var sourceRoots: List = emptyList() - @Parameter var samples: List = emptyList() diff --git a/settings.gradle.kts b/settings.gradle.kts index 409dca88..ecee8020 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -21,6 +21,7 @@ include("plugins:javadoc") include("integration-tests") include("integration-tests:gradle") include("integration-tests:cli") +include("integration-tests:maven") pluginManagement { val kotlin_version: String by settings -- cgit From 4ba7ec9facb26c5ae0b0dd434e07c4af728f277a Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Wed, 8 Jul 2020 18:17:46 +0200 Subject: maven-integration-test: Fix style issues --- buildSrc/src/main/kotlin/org/jetbrains/SetupMaven.kt | 1 - buildSrc/src/main/kotlin/org/jetbrains/taskUtils.kt | 10 +++++----- integration-tests/build.gradle.kts | 2 +- integration-tests/cli/build.gradle.kts | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) (limited to 'integration-tests/cli') diff --git a/buildSrc/src/main/kotlin/org/jetbrains/SetupMaven.kt b/buildSrc/src/main/kotlin/org/jetbrains/SetupMaven.kt index 519eea13..4ef26a73 100644 --- a/buildSrc/src/main/kotlin/org/jetbrains/SetupMaven.kt +++ b/buildSrc/src/main/kotlin/org/jetbrains/SetupMaven.kt @@ -1,6 +1,5 @@ package org.jetbrains -import org.gradle.api.DefaultTask import org.gradle.api.artifacts.Configuration import org.gradle.api.tasks.Input import org.gradle.api.tasks.Internal diff --git a/buildSrc/src/main/kotlin/org/jetbrains/taskUtils.kt b/buildSrc/src/main/kotlin/org/jetbrains/taskUtils.kt index b018ba13..ef9c5e6a 100644 --- a/buildSrc/src/main/kotlin/org/jetbrains/taskUtils.kt +++ b/buildSrc/src/main/kotlin/org/jetbrains/taskUtils.kt @@ -3,11 +3,11 @@ package org.jetbrains import org.gradle.api.Task fun Task.dependsOnMavenLocalPublication() { - project.rootProject.allprojects.forEach { otherProject -> - otherProject.invokeWhenEvaluated { evaluatedProject -> - evaluatedProject.tasks.findByName("publishToMavenLocal")?.let { publishingTask -> - this.dependsOn(publishingTask) - } + project.rootProject.allprojects.forEach { otherProject -> + otherProject.invokeWhenEvaluated { evaluatedProject -> + evaluatedProject.tasks.findByName("publishToMavenLocal")?.let { publishingTask -> + this.dependsOn(publishingTask) } } + } } diff --git a/integration-tests/build.gradle.kts b/integration-tests/build.gradle.kts index 070091a0..8458f1fe 100644 --- a/integration-tests/build.gradle.kts +++ b/integration-tests/build.gradle.kts @@ -38,4 +38,4 @@ dependencies { implementation(kotlin("stdlib")) implementation(kotlin("test-junit")) val coroutines_version: String by project - api("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")} + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")} diff --git a/integration-tests/cli/build.gradle.kts b/integration-tests/cli/build.gradle.kts index 60d3a298..d9961f8f 100644 --- a/integration-tests/cli/build.gradle.kts +++ b/integration-tests/cli/build.gradle.kts @@ -31,7 +31,7 @@ val basePluginShadowJar by tasks.register("basePluginShadowJar", ShadowJar::clas } tasks.integrationTest { - inputs.dir((file("projects"))) + inputs.dir(file("projects")) val cliJar = tasks.getByPath(":runners:cli:shadowJar") as ShadowJar environment("CLI_JAR_PATH", cliJar.archiveFile.get()) environment("BASE_PLUGIN_JAR_PATH", basePluginShadowJar.archiveFile.get()) -- cgit From 71497c5561afd62c1a4296bd0d0beb689dfd8e51 Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Fri, 10 Jul 2020 07:41:24 +0200 Subject: Introduce dokkaKdoc task --- .../kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt | 1 - .../src/main/kotlin/org/jetbrains/dokka/gradle/main.kt | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'integration-tests/cli') diff --git a/integration-tests/cli/src/integrationTest/kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt b/integration-tests/cli/src/integrationTest/kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt index 9f83c869..cfa752d6 100644 --- a/integration-tests/cli/src/integrationTest/kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt +++ b/integration-tests/cli/src/integrationTest/kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt @@ -33,7 +33,6 @@ class CliIntegrationTest : AbstractCliIntegrationTest() { val process = ProcessBuilder( "java", "-jar", cliJarFile.path, "-outputDir", dokkaOutputDir.path, - "-format", "html", "-pluginsClasspath", basePluginJarFile.path, "-sourceSet", buildString { 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 3e2c51f4..df854cd9 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 @@ -7,7 +7,13 @@ import java.io.File open class DokkaPlugin : Plugin { override fun apply(project: Project) { - project.createDokkaTasks("dokka") + project.createDokkaTasks("dokka") { + doFirst { + logger.warn(":dokka task is deprecated in favor of :dokkaKdoc") + } + } + + project.createDokkaTasks("dokkaKdoc") project.createDokkaTasks("dokkaJavadoc") { plugins.dependencies.add(project.dokkaArtifacts.javadocPlugin) -- cgit