diff --git a/idea/idea-new-project-wizard/tests/org/jetbrains/kotlin/tools/projectWizard/wizard/AbstractNewWizardProjectImportTest.kt b/idea/idea-new-project-wizard/tests/org/jetbrains/kotlin/tools/projectWizard/wizard/AbstractNewWizardProjectImportTest.kt index 9c231295c98..965bd30d5fd 100644 --- a/idea/idea-new-project-wizard/tests/org/jetbrains/kotlin/tools/projectWizard/wizard/AbstractNewWizardProjectImportTest.kt +++ b/idea/idea-new-project-wizard/tests/org/jetbrains/kotlin/tools/projectWizard/wizard/AbstractNewWizardProjectImportTest.kt @@ -86,7 +86,7 @@ abstract class AbstractNewWizardProjectImportTest : PlatformTestCase() { wizard.apply(projectDependentServices, GenerationPhase.ALL).assertSuccess() } - private fun prepareGradleBuildSystem(directory: Path) { + protected fun prepareGradleBuildSystem(directory: Path) { com.intellij.openapi.components.ServiceManager.getService(project, GradleSettings::class.java)?.apply { isOfflineWork = GradleEnvironment.Headless.GRADLE_OFFLINE?.toBoolean() ?: isOfflineWork serviceDirectoryPath = GradleEnvironment.Headless.GRADLE_SERVICE_DIRECTORY ?: serviceDirectoryPath diff --git a/libraries/tools/new-project-wizard/src/org/jetbrains/kotlin/tools/projectWizard/core/service/FileSystemWizardService.kt b/libraries/tools/new-project-wizard/src/org/jetbrains/kotlin/tools/projectWizard/core/service/FileSystemWizardService.kt index 1d30d1ca132..45cd99ed315 100644 --- a/libraries/tools/new-project-wizard/src/org/jetbrains/kotlin/tools/projectWizard/core/service/FileSystemWizardService.kt +++ b/libraries/tools/new-project-wizard/src/org/jetbrains/kotlin/tools/projectWizard/core/service/FileSystemWizardService.kt @@ -1,5 +1,11 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + package org.jetbrains.kotlin.tools.projectWizard.core.service +import org.jetbrains.kotlin.tools.projectWizard.core.Success import org.jetbrains.kotlin.tools.projectWizard.core.TaskResult import org.jetbrains.kotlin.tools.projectWizard.core.computeM import org.jetbrains.kotlin.tools.projectWizard.core.safe @@ -13,6 +19,7 @@ interface FileSystemWizardService : WizardService { class OsFileSystemWizardService : FileSystemWizardService, IdeaIndependentWizardService { override fun createFile(path: Path, text: String) = computeM { + if (path.toFile().exists()) return@computeM Success(Unit) createDirectory(path.parent).ensure() safe { Files.createFile(path.normalize()).toFile().writeText(text) } }