Skip to content

Commit 80c48f2

Browse files
committed
Windows Bugfix
1 parent 5ad43e0 commit 80c48f2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

java/gradle/src/main/kotlin/ProcessingPlugin.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ class ProcessingPlugin @Inject constructor(private val objectFactory: ObjectFact
2626
val workingDir = project.findProperty("processing.workingDir") as String?
2727
val debugPort = project.findProperty("processing.debugPort") as String?
2828

29+
val osName = System.getProperty("os.name").lowercase()
30+
2931
// Grab the settings from the most likely location if not defined
3032
var settingsFolder = (project.findProperty("processing.settings") as String?)?.let { File(it) }
3133
if(settingsFolder == null) {
32-
val osName = System.getProperty("os.name").lowercase()
3334
if (osName.contains("win")) {
3435
settingsFolder = File(System.getenv("APPDATA"), "Processing")
3536
} else if (osName.contains("mac")) {
@@ -53,6 +54,11 @@ class ProcessingPlugin @Inject constructor(private val objectFactory: ObjectFact
5354
?: prefs.getProperty("sketchbook.path.four")
5455
?: ("${System.getProperty("user.home")}/.processing")
5556

57+
// Replace slashes with backslashes on Windows
58+
if (osName.contains("win")) {
59+
sketchbook.replace("/", "\\")
60+
}
61+
5662
// Apply the Java plugin to the Project
5763
project.plugins.apply(JavaPlugin::class.java)
5864

0 commit comments

Comments
 (0)