Add test for KMM Wizard
This commit is contained in:
+1
-1
@@ -86,7 +86,7 @@ abstract class AbstractNewWizardProjectImportTest : PlatformTestCase() {
|
|||||||
wizard.apply(projectDependentServices, GenerationPhase.ALL).assertSuccess()
|
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 {
|
com.intellij.openapi.components.ServiceManager.getService(project, GradleSettings::class.java)?.apply {
|
||||||
isOfflineWork = GradleEnvironment.Headless.GRADLE_OFFLINE?.toBoolean() ?: isOfflineWork
|
isOfflineWork = GradleEnvironment.Headless.GRADLE_OFFLINE?.toBoolean() ?: isOfflineWork
|
||||||
serviceDirectoryPath = GradleEnvironment.Headless.GRADLE_SERVICE_DIRECTORY ?: serviceDirectoryPath
|
serviceDirectoryPath = GradleEnvironment.Headless.GRADLE_SERVICE_DIRECTORY ?: serviceDirectoryPath
|
||||||
|
|||||||
+7
@@ -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
|
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.TaskResult
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.core.computeM
|
import org.jetbrains.kotlin.tools.projectWizard.core.computeM
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.core.safe
|
import org.jetbrains.kotlin.tools.projectWizard.core.safe
|
||||||
@@ -13,6 +19,7 @@ interface FileSystemWizardService : WizardService {
|
|||||||
|
|
||||||
class OsFileSystemWizardService : FileSystemWizardService, IdeaIndependentWizardService {
|
class OsFileSystemWizardService : FileSystemWizardService, IdeaIndependentWizardService {
|
||||||
override fun createFile(path: Path, text: String) = computeM {
|
override fun createFile(path: Path, text: String) = computeM {
|
||||||
|
if (path.toFile().exists()) return@computeM Success(Unit)
|
||||||
createDirectory(path.parent).ensure()
|
createDirectory(path.parent).ensure()
|
||||||
safe { Files.createFile(path.normalize()).toFile().writeText(text) }
|
safe { Files.createFile(path.normalize()).toFile().writeText(text) }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user