Wizard: fix invalid path in generated buildscript on windows
This commit is contained in:
+2
@@ -45,6 +45,8 @@ operator fun @receiver:NonNls String.div(@NonNls other: String): Path =
|
||||
|
||||
fun @receiver:NonNls String.asPath(): Path = Paths.get(this)
|
||||
|
||||
fun Path.asStringWithUnixSlashes() = toString().replace('\\', '/')
|
||||
|
||||
fun <T : Any> safe(operation: () -> T): TaskResult<T> =
|
||||
try {
|
||||
Success(operation())
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
package org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.gradle
|
||||
|
||||
import org.jetbrains.kotlin.tools.projectWizard.core.asStringWithUnixSlashes
|
||||
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.FreeIR
|
||||
import org.jetbrains.kotlin.tools.projectWizard.plugins.printer.GradlePrinter
|
||||
import org.jetbrains.kotlin.tools.projectWizard.settings.JavaPackage
|
||||
@@ -15,10 +16,10 @@ data class AndroidConfigIR(val javaPackage: JavaPackage?, val newManifestPath: P
|
||||
if (newManifestPath != null) {
|
||||
when (dsl) {
|
||||
GradlePrinter.GradleDsl.KOTLIN -> {
|
||||
+"""sourceSets["main"].manifest.srcFile("$newManifestPath")"""
|
||||
+"""sourceSets["main"].manifest.srcFile("${newManifestPath.asStringWithUnixSlashes()}")"""
|
||||
}
|
||||
GradlePrinter.GradleDsl.GROOVY -> {
|
||||
+"""sourceSets.main.manifest.srcFile('$newManifestPath')"""
|
||||
+"""sourceSets.main.manifest.srcFile('${newManifestPath.asStringWithUnixSlashes()}')"""
|
||||
}
|
||||
}
|
||||
nlIndented()
|
||||
|
||||
Reference in New Issue
Block a user