Skip to content

Commit

Permalink
Fix some integration tests on Windows (#2507)
Browse files Browse the repository at this point in the history
  • Loading branch information
3flex committed May 26, 2022
1 parent 4ea32c0 commit 01eb31a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
Expand Up @@ -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()
}

Expand Down Expand Up @@ -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",
Expand Down
Expand Up @@ -60,5 +60,5 @@ tasks.withType<DokkaTask> {
}
suppressObviousFunctions.set(false)

pluginsMapConfiguration.set(mapOf(DokkaBase::class.qualifiedName to """{ "customStyleSheets": ["${file("../customResources/logo-styles.css")}", "${file("../customResources/custom-style-to-add.css")}"], "customAssets" : ["${file("../customResources/custom-resource.svg")}"] }"""))
pluginsMapConfiguration.set(mapOf(DokkaBase::class.qualifiedName to """{ "customStyleSheets": ["${file("../customResources/logo-styles.css").invariantSeparatorsPath}", "${file("../customResources/custom-style-to-add.css").invariantSeparatorsPath}"], "customAssets" : ["${file("../customResources/custom-resource.svg").invariantSeparatorsPath}"] }"""))
}
Expand Up @@ -29,7 +29,7 @@ abstract class AbstractGradleCachingIntegrationTest(override val versions: Build
buildCache {
local {
// Set local build cache directory.
directory = File("${projectDir.absolutePath}", "build-cache")
directory = File("${projectDir.invariantSeparatorsPath}", "build-cache")
}
}
""".trimIndent()
Expand All @@ -40,7 +40,7 @@ abstract class AbstractGradleCachingIntegrationTest(override val versions: Build
buildCache {
local<DirectoryBuildCache> {
// Set local build cache directory.
directory = File("${projectDir.absolutePath}", "build-cache")
directory = File("${projectDir.invariantSeparatorsPath}", "build-cache")
}
}
""".trimIndent()
Expand Down

0 comments on commit 01eb31a

Please sign in to comment.