From 01eb31a3e0051a8faa2b3aa5cbf6ff8895ed1385 Mon Sep 17 00:00:00 2001 From: Matthew Haughton <3flex@users.noreply.github.com> Date: Fri, 27 May 2022 02:45:21 +1000 Subject: Fix some integration tests on Windows (#2507) --- .../org/jetbrains/dokka/it/cli/CliIntegrationTest.kt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'integration-tests/cli/src/integrationTest/kotlin/org') 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 b94df32a..424c229c 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 @@ -267,9 +267,10 @@ class CliIntegrationTest : AbstractCliIntegrationTest() { fun `should accept json as input configuration`() { val dokkaOutputDir = File(projectDir, "output") assertTrue(dokkaOutputDir.mkdirs()) - val jsonPath = javaClass.getResource("/my-file.json")?.path ?: throw IllegalStateException("No JSON found!") + val resourcePath = javaClass.getResource("/my-file.json")?.toURI() ?: throw IllegalStateException("No JSON found!") + val jsonPath = File(resourcePath).absolutePath PrintWriter(jsonPath).run { - write(jsonBuilder(dokkaOutputDir.path, basePluginJarFile.path, File(projectDir, "src").path, reportUndocumented = true)) + write(jsonBuilder(dokkaOutputDir.invariantSeparatorsPath, basePluginJarFile.invariantSeparatorsPath, File(projectDir, "src").invariantSeparatorsPath, reportUndocumented = true)) close() } @@ -306,13 +307,14 @@ class CliIntegrationTest : AbstractCliIntegrationTest() { fun `global settings should overwrite package options in configuration`() { val dokkaOutputDir = File(projectDir, "output") assertTrue(dokkaOutputDir.mkdirs()) - val jsonPath = javaClass.getResource("/my-file.json")?.path ?: throw IllegalStateException("No JSON found!") + val resourcePath = javaClass.getResource("/my-file.json")?.toURI() ?: throw IllegalStateException("No JSON found!") + val jsonPath = File(resourcePath).absolutePath PrintWriter(jsonPath).run { write( jsonBuilder( - outputPath = dokkaOutputDir.path, - pluginsClasspath = basePluginJarFile.path, - projectPath = File(projectDir, "src").path, + outputPath = dokkaOutputDir.invariantSeparatorsPath, + pluginsClasspath = basePluginJarFile.invariantSeparatorsPath, + projectPath = File(projectDir, "src").invariantSeparatorsPath, globalSourceLinks = """ { "localDirectory": "/home/Vadim.Mishenev/dokka/examples/cli/src/main/kotlin", -- cgit