Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some tests on Windows #2507

Merged
merged 1 commit into from May 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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