From 27fba64bccc936ef69514a425781827817b6509c Mon Sep 17 00:00:00 2001 From: IgnatBeresnev Date: Wed, 18 Oct 2023 16:16:00 +0200 Subject: [PATCH] Address minor review comments --- .../dokka/analysis/test/api/analysis/TestProjectAnalyzer.kt | 6 +++--- .../test/api/configuration/TestDokkaConfigurationBuilder.kt | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/subprojects/analysis-kotlin-api/src/testFixtures/kotlin/org/jetbrains/dokka/analysis/test/api/analysis/TestProjectAnalyzer.kt b/subprojects/analysis-kotlin-api/src/testFixtures/kotlin/org/jetbrains/dokka/analysis/test/api/analysis/TestProjectAnalyzer.kt index 54ebd7b9c5..1668b53f92 100644 --- a/subprojects/analysis-kotlin-api/src/testFixtures/kotlin/org/jetbrains/dokka/analysis/test/api/analysis/TestProjectAnalyzer.kt +++ b/subprojects/analysis-kotlin-api/src/testFixtures/kotlin/org/jetbrains/dokka/analysis/test/api/analysis/TestProjectAnalyzer.kt @@ -99,7 +99,7 @@ object TestProjectAnalyzer { private fun TestProject.initialize(outputDirectory: File): Pair { analysisLogger.progress("Initializing and verifying project $this") this.verify() - require(outputDirectory.exists() && outputDirectory.isDirectory) { + require(outputDirectory.isDirectory) { "outputDirectory has to exist and be a directory: $outputDirectory" } this.initializeTestFiles(relativeToDir = outputDirectory) @@ -128,9 +128,9 @@ object TestProjectAnalyzer { throw IllegalStateException("Unable to create dirs \"${testDataFile.parentFile}\"", e) } - analysisLogger.debug("Creating \"${testDataFile.absoluteFile}\"") + analysisLogger.debug("Creating \"${testDataFile.absolutePath}\"") check(testDataFile.createNewFile()) { - "Unable to create a test file: ${testDataFile.absoluteFile}" + "Unable to create a test file: ${testDataFile.absolutePath}" } testDataFile.writeText(it.getContents(), Charsets.UTF_8) } diff --git a/subprojects/analysis-kotlin-api/src/testFixtures/kotlin/org/jetbrains/dokka/analysis/test/api/configuration/TestDokkaConfigurationBuilder.kt b/subprojects/analysis-kotlin-api/src/testFixtures/kotlin/org/jetbrains/dokka/analysis/test/api/configuration/TestDokkaConfigurationBuilder.kt index dec8c791ed..b6563fb7d0 100644 --- a/subprojects/analysis-kotlin-api/src/testFixtures/kotlin/org/jetbrains/dokka/analysis/test/api/configuration/TestDokkaConfigurationBuilder.kt +++ b/subprojects/analysis-kotlin-api/src/testFixtures/kotlin/org/jetbrains/dokka/analysis/test/api/configuration/TestDokkaConfigurationBuilder.kt @@ -102,7 +102,9 @@ abstract class BaseTestDokkaSourceSetBuilder { verifyFilePathStartsWithSlash("additionalSourceRoots", it) } additionalClasspath.forEach { - verifyFileExtension("additionalClasspath", it, ".jar") // should it include .klib? + // this check can be extended to accept .klib, .class or other files + // as the need for it arises, as long as Dokka supports it + verifyFileExtension("additionalClasspath", it, ".jar") } includes.forEach { verifyFilePathStartsWithSlash("includes", it)