mirror of
https://gitee.com/zhangsken/AndroidIDE.git
synced 2026-10-16 07:49:44 +08:00
build(termux-bootstrap): escape backslashes in paths when writing termux-bootstrap.S on Windows
This commit is contained in:
+13
-3
@@ -20,6 +20,7 @@ package com.itsaky.androidide.plugins
|
||||
import com.itsaky.androidide.plugins.util.DownloadUtils
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.internal.os.OperatingSystem
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
@@ -74,11 +75,11 @@ class TerminalBootstrapPackagesPlugin : Plugin<Project> {
|
||||
.section .rodata
|
||||
blob:
|
||||
#if defined __aarch64__
|
||||
.incbin "${files["aarch64"]!!.absolutePath}"
|
||||
.incbin "${escapePathOnWindows(files["aarch64"]!!.absolutePath)}"
|
||||
#elif defined __arm__
|
||||
.incbin "${files["arm"]!!.absolutePath}"
|
||||
.incbin "${escapePathOnWindows(files["arm"]!!.absolutePath)}"
|
||||
#elif defined __x86_64__
|
||||
.incbin "${files["x86_64"]!!.absolutePath}"
|
||||
.incbin "${escapePathOnWindows(files["x86_64"]!!.absolutePath)}"
|
||||
#else
|
||||
# error Unsupported arch
|
||||
#endif
|
||||
@@ -90,4 +91,13 @@ class TerminalBootstrapPackagesPlugin : Plugin<Project> {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private fun escapePathOnWindows(path: String): String {
|
||||
if (OperatingSystem.current().isWindows) {
|
||||
// escape backslashes when building on Windows
|
||||
return path.replace("\\", "\\\\")
|
||||
}
|
||||
|
||||
return path
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user