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 compilation on Windows #77

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package dev.romainguy.kotlin.explorer.build

import dev.romainguy.kotlin.explorer.ToolPaths
import dev.romainguy.kotlin.explorer.isWindows
import dev.romainguy.kotlin.explorer.process
import java.nio.file.Path

Expand All @@ -34,7 +35,7 @@ class KotlinCompiler(private val toolPaths: ToolPaths, private val outputDirecto
toolPaths.kotlinc.toString(),
"-Xmulti-platform",
"-classpath",
(toolPaths.kotlinLibs + listOf(toolPaths.platform)).joinToString(":") { jar -> jar.toString() }
(toolPaths.kotlinLibs + listOf(toolPaths.platform)).joinToString(if (isWindows) ";" else ":") { jar -> jar.toString() }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A better solution is to use File.pathSeparator or (pathSeparatorChar): https://docs.oracle.com/javase/8/docs/api/java/io/File.html#pathSeparator

).apply {
if (kotlinOnlyConsumers) {
this += "-Xno-param-assertions"
Expand Down