diff --git a/libraries/tools/new-project-wizard/src/org/jetbrains/kotlin/tools/projectWizard/core/utils.kt b/libraries/tools/new-project-wizard/src/org/jetbrains/kotlin/tools/projectWizard/core/utils.kt index f5d2802fe9d..5eb2138f586 100644 --- a/libraries/tools/new-project-wizard/src/org/jetbrains/kotlin/tools/projectWizard/core/utils.kt +++ b/libraries/tools/new-project-wizard/src/org/jetbrains/kotlin/tools/projectWizard/core/utils.kt @@ -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 safe(operation: () -> T): TaskResult = try { Success(operation()) diff --git a/libraries/tools/new-project-wizard/src/org/jetbrains/kotlin/tools/projectWizard/ir/buildsystem/gradle/AndroidIR.kt b/libraries/tools/new-project-wizard/src/org/jetbrains/kotlin/tools/projectWizard/ir/buildsystem/gradle/AndroidIR.kt index fe7a96b6a12..769730d1805 100644 --- a/libraries/tools/new-project-wizard/src/org/jetbrains/kotlin/tools/projectWizard/ir/buildsystem/gradle/AndroidIR.kt +++ b/libraries/tools/new-project-wizard/src/org/jetbrains/kotlin/tools/projectWizard/ir/buildsystem/gradle/AndroidIR.kt @@ -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()