Remove old Gradle-based new_project_wizards from the Kotlin group

This commit is contained in:
Anton Yalyshev
2020-05-14 21:16:38 +03:00
parent 82d81d5223
commit f0ff4b066e
21 changed files with 0 additions and 1997 deletions
@@ -1,106 +0,0 @@
/*
* Copyright 2010-2018 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.ide.konan.gradle
import com.intellij.openapi.vfs.VirtualFile
import org.jetbrains.kotlin.ide.konan.KotlinGradleNativeBundle
import org.jetbrains.kotlin.idea.KotlinIcons
import org.jetbrains.kotlin.idea.configuration.KotlinGradleAbstractMultiplatformModuleBuilder
import org.jetbrains.kotlin.konan.target.presetName
import javax.swing.Icon
class KotlinGradleNativeMultiplatformModuleBuilder : KotlinGradleAbstractMultiplatformModuleBuilder() {
private val nativePresetName = defaultNativeTarget.presetName
private val nativeTargetName = defaultNativeTarget.userTargetName
private val nativeSourceName get() = "$nativeTargetName$productionSuffix"
val nativeTestName get() = "$nativeTargetName$testSuffix"
private val nativeReleaseExecutableRunTaskame get() = ":runReleaseExecutable${nativeTargetName.capitalize()}"
private val nativeDebugExecutableRunTaskame get() = ":runDebugExecutable${nativeTargetName.capitalize()}"
override fun getNodeIcon(): Icon = KotlinIcons.NATIVE
override fun getBuilderId() = "kotlin.gradle.multiplatform.native"
override fun getPresentableName() = KotlinGradleNativeBundle.message("native.gradle.name")
override fun getDescription() = KotlinGradleNativeBundle.message("native.gradle.description")
override val notImportedCommonSourceSets = true
override fun createProjectSkeleton(rootDir: VirtualFile) {
val src = rootDir.createChildDirectory(this, "src")
// Main module:
src.createKotlinSampleFileWriter(nativeSourceName, nativeTargetName).use {
it.write(
"""
package sample
fun hello(): String = "Hello, Kotlin/Native!"
fun main() {
println(hello())
}
""".trimIndent()
)
}
// Test module:
src.createKotlinSampleFileWriter(nativeTestName, fileName = "SampleTests.kt").use {
it.write(
"""
package sample
import kotlin.test.Test
import kotlin.test.assertTrue
class SampleTests {
@Test
fun testHello() {
assertTrue("Kotlin/Native" in hello())
}
}
""".trimIndent()
)
}
}
override fun buildMultiPlatformPart(): String {
return """
kotlin {
// For ARM, should be changed to iosArm32 or iosArm64
// For Linux, should be changed to e.g. linuxX64
// For MacOS, should be changed to e.g. macosX64
// For Windows, should be changed to e.g. mingwX64
$nativePresetName("$nativeTargetName") {
binaries {
executable {
// Change to specify fully qualified name of your application's entry point:
entryPoint = 'sample.main'
// Specify command-line arguments, if necessary:
//runTask?.args('arg1', 'arg2', 'arg3')
}
}
}
sourceSets {
// Note: To enable common source sets please comment out 'kotlin.import.noCommonSourceSets' property
// in gradle.properties file and re-import your project in IDE.
$nativeSourceName {
}
$nativeTestName {
}
}
}
// Use the following Gradle tasks to run your application:
// $nativeReleaseExecutableRunTaskame - without debug symbols
// $nativeDebugExecutableRunTaskame - with debug symbols
""".trimIndent()
}
}
@@ -1,214 +0,0 @@
/*
* Copyright 2010-2019 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.idea.configuration
import com.intellij.ide.util.projectWizard.ModuleWizardStep
import com.intellij.ide.util.projectWizard.WizardContext
import com.intellij.openapi.externalSystem.ExternalSystemModulePropertyManager
import com.intellij.openapi.externalSystem.model.ProjectSystemId
import com.intellij.openapi.externalSystem.model.project.ModuleData
import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil
import com.intellij.openapi.module.Module
import com.intellij.openapi.vfs.VfsUtil
import com.intellij.openapi.vfs.VirtualFile
import org.jetbrains.kotlin.idea.KotlinIcons
import org.jetbrains.kotlin.idea.util.rootManager
import org.jetbrains.kotlin.konan.target.HostManager
import org.jetbrains.kotlin.konan.target.KonanTarget
import org.jetbrains.kotlin.konan.target.TargetSupportException
import org.jetbrains.plugins.gradle.frameworkSupport.BuildScriptDataBuilder
import org.jetbrains.plugins.gradle.service.project.wizard.GradleModuleBuilder
import org.jetbrains.plugins.gradle.settings.DistributionType
import com.intellij.openapi.externalSystem.model.project.ProjectData
import com.intellij.openapi.externalSystem.service.project.wizard.ExternalModuleSettingsStep
import com.intellij.openapi.roots.ui.configuration.ModulesProvider
import org.jetbrains.kotlin.idea.statistics.NewProjectWizardsFUSCollector
import org.jetbrains.plugins.gradle.service.settings.GradleProjectSettingsControl
import javax.swing.Icon
abstract class KotlinGradleAbstractMultiplatformModuleBuilder(
val mppInApplication: Boolean = false
) : GradleModuleBuilder() {
var explicitPluginVersion: String? = null
val mppDirName = "app"
override fun getNodeIcon(): Icon = KotlinIcons.MPP
/*
This overriding is a temporary workaround of a problem with how we use GradleModuleBuilder().
IDEA implies that we will create new GradleModuleBuilder every time we call Kotlin New Project Wizard.
But we create it once for every kind of GradleModuleBuilder-based New Project Wizard and the just reuse it.
How the problem looks for a user: KT-34229
Ticket that should properly fix it: KT-34591
*/
override fun cleanup() {
super.cleanup()
this.name = null
this.contentEntryPath = null
this.moduleFilePath = null
}
override fun createWizardSteps(wizardContext: WizardContext, modulesProvider: ModulesProvider): Array<ModuleWizardStep> {
super.createWizardSteps(wizardContext, modulesProvider) // initializes GradleModuleBuilder.myWizardContext
return arrayOf(
// Let us have to edit project name only
ExternalModuleSettingsStep(wizardContext, this, GradleProjectSettingsControl(externalProjectSettings))
)
}
private fun setupMppModule(module: Module, parentDir: VirtualFile): VirtualFile? {
val moduleDir = parentDir.createChildDirectory(this, mppDirName)
val buildGradle = moduleDir.createChildData(null, "build.gradle")
val builder = BuildScriptDataBuilder(buildGradle)
builder.setupAdditionalDependenciesForApplication()
GradleKotlinMPPFrameworkSupportProvider().addSupport(
builder,
module,
sdk = null,
specifyPluginVersionIfNeeded = true,
explicitPluginVersion = explicitPluginVersion
)
VfsUtil.saveText(buildGradle, builder.buildConfigurationPart() + builder.buildMainPart() + buildMultiPlatformPart())
return moduleDir
}
private fun enableGradleMetadataPreview(rootDir: VirtualFile) {
val settingsGradle = rootDir.findOrCreateChildData(null, "settings.gradle")
val previousText = settingsGradle.inputStream.bufferedReader().use { it.readText() }
settingsGradle.bufferedWriter().use {
it.write(previousText)
if (previousText.isNotEmpty()) {
it.newLine()
}
it.write("enableFeaturePreview('GRADLE_METADATA')")
it.newLine()
}
}
override fun setupModule(module: Module) {
try {
NewProjectWizardsFUSCollector.log(this.presentableName, "Kotlin", false)
module.gradleModuleBuilder = this
super.setupModule(module)
val rootDir = module.rootManager.contentRoots.firstOrNull() ?: return
val buildGradle = rootDir.findOrCreateChildData(null, "build.gradle")
if (mppInApplication) {
setupMppModule(module, rootDir)
}
val builder = BuildScriptDataBuilder(buildGradle)
builder.setupAdditionalDependencies()
if (shouldEnableGradleMetadataPreview) {
enableGradleMetadataPreview(rootDir)
}
val buildGradleText = if (!mppInApplication) {
GradleKotlinMPPFrameworkSupportProvider().addSupport(
builder,
module,
sdk = null,
specifyPluginVersionIfNeeded = true,
explicitPluginVersion = explicitPluginVersion
)
builder.buildConfigurationPart() + builder.buildMainPart() + buildMultiPlatformPart()
} else {
builder.buildConfigurationPart() + builder.buildMainPart()
}
VfsUtil.saveText(buildGradle, buildGradleText)
if (mppInApplication) {
updateSettingsScript(module) {
it.addIncludedModules(listOf(":$mppDirName"))
}
}
createProjectSkeleton(rootDir)
if (externalProjectSettings.distributionType == DistributionType.DEFAULT_WRAPPED) {
setGradleWrapperToUseVersion(rootDir, "6.3")
}
if (notImportedCommonSourceSets) GradlePropertiesFileFacade.forProject(module.project).addNotImportedCommonSourceSetsProperty()
// Ensure project root path is set
val propertyManager = ExternalSystemModulePropertyManager.getInstance(module)
val path = externalProjectSettings.externalProjectPath
val externalSystemId = propertyManager.getExternalSystemId()
if (ExternalSystemApiUtil.getExternalRootProjectPath(module) == null && externalSystemId != null) {
val projectSystemId = ProjectSystemId(externalSystemId)
val projectData = ProjectData(projectSystemId, module.name, path, path)
val moduleData = ModuleData(
propertyManager.getLinkedProjectId() ?: "",
projectSystemId,
propertyManager.getExternalModuleType() ?: "",
module.name,
path,
path
)
propertyManager.setExternalOptions(projectSystemId, moduleData, projectData)
}
} finally {
flushSettingsGradleCopy(module)
}
}
private fun setGradleWrapperToUseVersion(rootDir: VirtualFile, version: String) {
val wrapperDir = rootDir.createChildDirectory(null, "gradle").createChildDirectory(null, "wrapper")
val wrapperProperties = wrapperDir.createChildData(null, "gradle-wrapper.properties").bufferedWriter()
wrapperProperties.use {
it.write(
"""
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-$version-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
""".trimIndent()
)
}
}
protected abstract fun buildMultiPlatformPart(): String
protected open fun BuildScriptDataBuilder.setupAdditionalDependencies() {}
protected open fun BuildScriptDataBuilder.setupAdditionalDependenciesForApplication() {}
protected fun VirtualFile.bufferedWriter() = getOutputStream(this).bufferedWriter()
protected fun VirtualFile.createKotlinSampleFileWriter(
sourceRootName: String,
platformName: String = "",
languageName: String = "kotlin",
fileName: String = "Sample${platformName.capitalize()}.kt"
) = createChildDirectory(this, sourceRootName)
.createChildDirectory(this, languageName)
.createChildDirectory(this, "sample")
.createChildData(this, fileName)
.bufferedWriter()
protected open fun createProjectSkeleton(rootDir: VirtualFile) {}
protected open val notImportedCommonSourceSets = false
protected open val shouldEnableGradleMetadataPreview = false
protected val defaultNativeTarget by lazy {
try {
HostManager.host
} catch (e: TargetSupportException) {
KonanTarget.IOS_X64
}
}
// Examples: ios_x64 -> ios, macos_x64 -> macos, wasm32 -> wasm.
protected val KonanTarget.userTargetName: String
get() {
val index = name.indexOfAny("_0123456789".toCharArray())
return if (index > 0) name.substring(0, index) else name
}
companion object {
const val productionSuffix = "Main"
const val testSuffix = "Test"
}
}
@@ -1,200 +0,0 @@
/*
* Copyright 2010-2019 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.idea.configuration
import com.intellij.ide.util.projectWizard.ModuleWizardStep
import com.intellij.ide.util.projectWizard.WizardContext
import com.intellij.openapi.externalSystem.ExternalSystemModulePropertyManager
import com.intellij.openapi.externalSystem.model.ProjectSystemId
import com.intellij.openapi.externalSystem.model.project.ModuleData
import com.intellij.openapi.externalSystem.service.project.wizard.ExternalModuleSettingsStep
import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil
import com.intellij.openapi.module.Module
import com.intellij.openapi.roots.ui.configuration.ModulesProvider
import com.intellij.openapi.vfs.VfsUtil
import com.intellij.openapi.vfs.VirtualFile
import org.jetbrains.kotlin.idea.KotlinIcons
import org.jetbrains.kotlin.idea.util.rootManager
import org.jetbrains.kotlin.konan.target.HostManager
import org.jetbrains.kotlin.konan.target.KonanTarget
import org.jetbrains.kotlin.konan.target.TargetSupportException
import org.jetbrains.plugins.gradle.frameworkSupport.BuildScriptDataBuilder
import org.jetbrains.plugins.gradle.service.project.wizard.GradleModuleBuilder
import org.jetbrains.plugins.gradle.service.settings.GradleProjectSettingsControl
import org.jetbrains.plugins.gradle.settings.DistributionType
import com.intellij.openapi.externalSystem.model.project.ProjectData
import org.jetbrains.kotlin.idea.statistics.NewProjectWizardsFUSCollector
import javax.swing.Icon
abstract class KotlinGradleAbstractMultiplatformModuleBuilder(
val mppInApplication: Boolean = false
) : GradleModuleBuilder() {
var explicitPluginVersion: String? = null
val mppDirName = "app"
override fun getNodeIcon(): Icon = KotlinIcons.MPP
override fun createWizardSteps(wizardContext: WizardContext, modulesProvider: ModulesProvider): Array<ModuleWizardStep> {
super.createWizardSteps(wizardContext, modulesProvider) // initializes GradleModuleBuilder.myWizardContext
return arrayOf(
// Let us have to edit project name only
ExternalModuleSettingsStep(wizardContext, this, GradleProjectSettingsControl(externalProjectSettings))
)
}
private fun setupMppModule(module: Module, parentDir: VirtualFile): VirtualFile? {
val moduleDir = parentDir.createChildDirectory(this, mppDirName)
val buildGradle = moduleDir.createChildData(null, "build.gradle")
val builder = BuildScriptDataBuilder(buildGradle)
builder.setupAdditionalDependenciesForApplication()
GradleKotlinMPPFrameworkSupportProvider().addSupport(
builder,
module,
sdk = null,
specifyPluginVersionIfNeeded = true,
explicitPluginVersion = explicitPluginVersion
)
VfsUtil.saveText(buildGradle, builder.buildConfigurationPart() + builder.buildMainPart() + buildMultiPlatformPart())
return moduleDir
}
private fun enableGradleMetadataPreview(rootDir: VirtualFile) {
val settingsGradle = rootDir.findOrCreateChildData(null, "settings.gradle")
val previousText = settingsGradle.inputStream.bufferedReader().use { it.readText() }
settingsGradle.bufferedWriter().use {
it.write(previousText)
if (previousText.isNotEmpty()) {
it.newLine()
}
it.write("enableFeaturePreview('GRADLE_METADATA')")
it.newLine()
}
}
override fun setupModule(module: Module) {
try {
NewProjectWizardsFUSCollector.log(this.presentableName, "Kotlin", false)
module.gradleModuleBuilder = this
super.setupModule(module)
val rootDir = module.rootManager.contentRoots.firstOrNull() ?: return
val buildGradle = rootDir.findOrCreateChildData(null, "build.gradle")
if (mppInApplication) {
setupMppModule(module, rootDir)
}
val builder = BuildScriptDataBuilder(buildGradle)
builder.setupAdditionalDependencies()
if (shouldEnableGradleMetadataPreview) {
enableGradleMetadataPreview(rootDir)
}
val buildGradleText = if (!mppInApplication) {
GradleKotlinMPPFrameworkSupportProvider().addSupport(
builder,
module,
sdk = null,
specifyPluginVersionIfNeeded = true,
explicitPluginVersion = explicitPluginVersion
)
builder.buildConfigurationPart() + builder.buildMainPart() + buildMultiPlatformPart()
} else {
builder.buildConfigurationPart() + builder.buildMainPart()
}
VfsUtil.saveText(buildGradle, buildGradleText)
if (mppInApplication) {
updateSettingsScript(module) {
it.addIncludedModules(listOf(":$mppDirName"))
}
}
createProjectSkeleton(rootDir)
if (externalProjectSettings.distributionType == DistributionType.DEFAULT_WRAPPED) {
setGradleWrapperToUseVersion(rootDir, "6.3")
}
if (notImportedCommonSourceSets) GradlePropertiesFileFacade.forProject(module.project).addNotImportedCommonSourceSetsProperty()
// Ensure project root path is set
val propertyManager = ExternalSystemModulePropertyManager.getInstance(module)
val path = externalProjectSettings.externalProjectPath
val externalSystemId = propertyManager.getExternalSystemId()
if (ExternalSystemApiUtil.getExternalRootProjectPath(module) == null && externalSystemId != null) {
val projectSystemId = ProjectSystemId(externalSystemId)
val projectData = ProjectData(projectSystemId, module.name, path, path)
val moduleData = ModuleData(
propertyManager.getLinkedProjectId() ?: "",
projectSystemId,
propertyManager.getExternalModuleType() ?: "",
module.name,
path,
path
)
propertyManager.setExternalOptions(projectSystemId, moduleData, projectData)
}
} finally {
flushSettingsGradleCopy(module)
}
}
private fun setGradleWrapperToUseVersion(rootDir: VirtualFile, version: String) {
val wrapperDir = rootDir.createChildDirectory(null, "gradle").createChildDirectory(null, "wrapper")
val wrapperProperties = wrapperDir.createChildData(null, "gradle-wrapper.properties").bufferedWriter()
wrapperProperties.use {
it.write(
"""
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-$version-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
""".trimIndent()
)
}
}
protected abstract fun buildMultiPlatformPart(): String
protected open fun BuildScriptDataBuilder.setupAdditionalDependencies() {}
protected open fun BuildScriptDataBuilder.setupAdditionalDependenciesForApplication() {}
protected fun VirtualFile.bufferedWriter() = getOutputStream(this).bufferedWriter()
protected fun VirtualFile.createKotlinSampleFileWriter(
sourceRootName: String,
platformName: String = "",
languageName: String = "kotlin",
fileName: String = "Sample${platformName.capitalize()}.kt"
) = createChildDirectory(this, sourceRootName)
.createChildDirectory(this, languageName)
.createChildDirectory(this, "sample")
.createChildData(this, fileName)
.bufferedWriter()
protected open fun createProjectSkeleton(rootDir: VirtualFile) {}
protected open val notImportedCommonSourceSets = false
protected open val shouldEnableGradleMetadataPreview = false
protected val defaultNativeTarget by lazy {
try {
HostManager.host
} catch (e: TargetSupportException) {
KonanTarget.IOS_X64
}
}
// Examples: ios_x64 -> ios, macos_x64 -> macos, wasm32 -> wasm.
protected val KonanTarget.userTargetName: String
get() {
val index = name.indexOfAny("_0123456789".toCharArray())
return if (index > 0) name.substring(0, index) else name
}
companion object {
const val productionSuffix = "Main"
const val testSuffix = "Test"
}
}
@@ -1,383 +0,0 @@
/*
* Copyright 2010-2019 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.idea.configuration
import com.intellij.openapi.vfs.VirtualFile
import org.jetbrains.kotlin.idea.KotlinIdeaGradleBundle
import org.jetbrains.kotlin.idea.configuration.xcode.XcodeProjectConfigurator
import org.jetbrains.plugins.gradle.frameworkSupport.BuildScriptDataBuilder
import java.io.BufferedWriter
class KotlinGradleMobileMultiplatformModuleBuilder :
KotlinGradleAbstractMultiplatformModuleBuilder(mppInApplication = true) {
private val commonName: String = "common"
private var jvmTargetName: String = "android"
private var nativeTargetName: String = "ios"
private val androidAppName = mppDirName
private val commonSourceName get() = "$commonName$productionSuffix"
private val commonTestName get() = "$commonName$testSuffix"
private val jvmSourceName get() = "$jvmTargetName$productionSuffix"
private val jvmTestName get() = "$jvmTargetName$testSuffix"
private val nativeSourceName get() = "$nativeTargetName$productionSuffix"
private val nativeTestName get() = "$nativeTargetName$testSuffix"
private val mainSourceName get() = productionSuffix.toLowerCase()
private val mainTestName get() = testSuffix.toLowerCase()
override fun getBuilderId() = "kotlin.gradle.multiplatform.mobile"
override fun getPresentableName() = KotlinIdeaGradleBundle.message("presentable.text.mobile.android.ios.gradle")
override fun getDescription() = KotlinIdeaGradleBundle.message(
"description.text.multiplatform.gradle.project.allowing.reuse.of.the.same.kotlin.code.between.android.and.ios.mobile.platforms"
)
override fun BuildScriptDataBuilder.setupAdditionalDependencies() {
addBuildscriptDependencyNotation("classpath 'com.android.tools.build:gradle:3.6.3'")
addBuildscriptRepositoriesDefinition("google()")
addBuildscriptRepositoriesDefinition("jcenter()")
addRepositoriesDefinition("google()")
addRepositoriesDefinition("jcenter()")
}
override fun BuildScriptDataBuilder.setupAdditionalDependenciesForApplication() {
addRepositoriesDefinition("google()")
addRepositoriesDefinition("jcenter()")
}
override fun createProjectSkeleton(rootDir: VirtualFile) {
val appDir = rootDir.findChild(androidAppName)!!
val src = appDir.createChildDirectory(this, "src")
val commonMain = src.createKotlinSampleFileWriter(commonSourceName)
val commonTest = src.createKotlinSampleFileWriter(commonTestName, fileName = "SampleTests.kt")
val androidMain = src.createKotlinSampleFileWriter(mainSourceName, jvmTargetName, languageName = "java")
val androidTest = src.createKotlinSampleFileWriter(mainTestName, languageName = "java", fileName = "SampleTestsAndroid.kt")
val appInfo = appDir.createChildData(appDir,"Info.plist").bufferedWriter()
val androidLocalProperties = rootDir.createChildData(this, "local.properties").bufferedWriter()
val androidRoot = src.findChild(mainSourceName)!!
val androidManifest = androidRoot.createChildData(this, "AndroidManifest.xml").bufferedWriter()
val androidResources = androidRoot.createChildDirectory(this, "res")
val androidValues = androidResources.createChildDirectory(this, "values")
val androidLayout = androidResources.createChildDirectory(this, "layout")
val androidStrings = androidValues.createChildData(this, "strings.xml").bufferedWriter()
val androidStyles = androidValues.createChildData(this, "styles.xml").bufferedWriter()
val androidActivityMain = androidLayout.createChildData(this, "activity_main.xml").bufferedWriter()
val nativeMain = src.createKotlinSampleFileWriter(nativeSourceName, nativeTargetName)
val nativeTest = src.createKotlinSampleFileWriter(nativeTestName, fileName = "SampleTestsIOS.kt")
val xcodeConfigurator = XcodeProjectConfigurator()
try {
commonMain.write(
"""
package sample
expect class Sample() {
fun checkMe(): Int
}
expect object Platform {
val name: String
}
fun hello(): String = "Hello from ${"$"}{Platform.name}"
class Proxy {
fun proxyHello() = hello()
}
fun main() {
println(hello())
}
""".trimIndent()
)
androidMain.write(
"""
package sample
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.widget.TextView
actual class Sample {
actual fun checkMe() = 44
}
actual object Platform {
actual val name: String = "Android"
}
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Sample().checkMe()
setContentView(R.layout.activity_main)
findViewById<TextView>(R.id.main_text).text = hello()
}
}
""".trimIndent()
)
nativeMain.write(
"""
package sample
actual class Sample {
actual fun checkMe() = 7
}
actual object Platform {
actual val name: String = "iOS"
}
""".trimIndent()
)
commonTest.write(
"""
package sample
import kotlin.test.Test
import kotlin.test.assertTrue
class SampleTests {
@Test
fun testMe() {
assertTrue(Sample().checkMe() > 0)
}
@Test
fun testProxy() {
assertTrue(Proxy().proxyHello().isNotEmpty())
}
}
""".trimIndent()
)
androidTest.write(
"""
package sample
import kotlin.test.Test
import kotlin.test.assertTrue
class SampleTestsAndroid {
@Test
fun testHello() {
assertTrue("Android" in hello())
}
}
""".trimIndent()
)
nativeTest.write(
"""
package sample
import kotlin.test.Test
import kotlin.test.assertTrue
class SampleTestsIOS {
@Test
fun testHello() {
assertTrue("iOS" in hello())
}
}
""".trimIndent()
)
androidLocalProperties.write(
"""
## This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=PleaseSpecifyAndroidSdkPathHere
""".trimIndent()
)
androidManifest.write(
"""
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="sample">
<application
android:allowBackup="true"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name="sample.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
""".trimIndent()
)
androidStrings.write(
"""
<resources>
<string name="app_name">android-app</string>
</resources>
""".trimIndent()
)
androidStyles.write(
"""
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
</resources>
""".trimIndent()
)
androidActivityMain.write(
"""
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:id="@+id/main_text"
android:textSize="42sp"
android:layout_margin="5sp"
android:textAlignment="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
""".trimIndent()
)
appInfo.write(xcodeConfigurator.templatePlist("""<key>CFBundlePackageType</key>
<string>FMWK</string>"""))
} finally {
listOf(
commonMain, commonTest, androidMain, androidTest, nativeMain, nativeTest, appInfo,
androidLocalProperties, androidManifest, androidStrings, androidStyles, androidActivityMain
).forEach(BufferedWriter::close)
}
xcodeConfigurator.createSkeleton(rootDir)
}
override fun buildMultiPlatformPart(): String {
return """
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 28
defaultConfig {
applicationId 'org.jetbrains.kotlin.mpp_app_android'
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName '1.0'
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
minifyEnabled false
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
}
kotlin {
android("$jvmTargetName")
// This is for iPhone emulator
// Switch here to iosArm64 (or iosArm32) to build library for iPhone device
iosX64("$nativeTargetName") {
binaries {
framework()
}
}
sourceSets {
$commonSourceName {
dependencies {
implementation kotlin('stdlib-common')
}
}
$commonTestName {
dependencies {
implementation kotlin('test-common')
implementation kotlin('test-annotations-common')
}
}
$jvmSourceName {
dependencies {
implementation kotlin('stdlib')
}
}
$jvmTestName {
dependencies {
implementation kotlin('test')
implementation kotlin('test-junit')
}
}
$nativeSourceName {
}
$nativeTestName {
}
}
}
// This task attaches native framework built from ios module to Xcode project
// (see iosApp directory). Don't run this task directly,
// Xcode runs this task itself during its build process.
// Before opening the project from iosApp directory in Xcode,
// make sure all Gradle infrastructure exists (gradle.wrapper, gradlew).
task copyFramework {
def buildType = project.findProperty('kotlin.build.type') ?: 'DEBUG'
def target = project.findProperty('kotlin.target') ?: 'ios'
dependsOn kotlin.targets."${"$"}target".binaries.getFramework(buildType).linkTask
doLast {
def srcFile = kotlin.targets."${"$"}target".binaries.getFramework(buildType).outputFile
def targetDir = getProperty('configuration.build.dir')
copy {
from srcFile.parent
into targetDir
include '$androidAppName.framework/**'
include '$androidAppName.framework.dSYM'
}
}
}
""".trimIndent()
}
}
@@ -1,193 +0,0 @@
/*
* Copyright 2010-2018 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.idea.configuration
import com.intellij.openapi.vfs.VirtualFile
import org.jetbrains.kotlin.idea.KotlinIdeaGradleBundle
import java.io.BufferedWriter
class KotlinGradleMobileSharedMultiplatformModuleBuilder : KotlinGradleAbstractMultiplatformModuleBuilder() {
private val commonName: String = "common"
private var jvmTargetName: String = "jvm"
private var nativeTargetName: String = "ios"
private val commonSourceName get() = "$commonName$productionSuffix"
private val commonTestName get() = "$commonName$testSuffix"
private val jvmSourceName get() = "$jvmTargetName$productionSuffix"
private val jvmTestName get() = "$jvmTargetName$testSuffix"
private val nativeSourceName get() = "$nativeTargetName$productionSuffix"
val nativeTestName get() = "$nativeTargetName$testSuffix"
override val shouldEnableGradleMetadataPreview: Boolean = true
override fun getBuilderId() = "kotlin.gradle.multiplatform.mobileshared"
override fun getPresentableName() = KotlinIdeaGradleBundle.message("presentable.text.mobile.shared.library.gradle")
override fun getDescription() = KotlinIdeaGradleBundle.message(
"description.text.multiplatform.gradle.project.allowing.reuse.of.the.same.kotlin.code.between.two.mobile.platforms.jvm.android.and.native"
)
override fun createProjectSkeleton(rootDir: VirtualFile) {
val src = rootDir.createChildDirectory(this, "src")
val commonMain = src.createKotlinSampleFileWriter(commonSourceName)
val commonTest = src.createKotlinSampleFileWriter(commonTestName, fileName = "SampleTests.kt")
val jvmMain = src.createKotlinSampleFileWriter(jvmSourceName, jvmTargetName)
val jvmTest = src.createKotlinSampleFileWriter(jvmTestName, fileName = "SampleTestsJVM.kt")
val nativeMain = src.createKotlinSampleFileWriter(nativeSourceName, nativeTargetName)
val nativeTest = src.createKotlinSampleFileWriter(nativeTestName, fileName = "SampleTestsNative.kt")
try {
commonMain.write(
"""
package sample
expect class Sample() {
fun checkMe(): Int
}
expect object Platform {
fun name(): String
}
fun hello(): String = "Hello from ${"$"}{Platform.name()}"
""".trimIndent()
)
jvmMain.write(
"""
package sample
actual class Sample {
actual fun checkMe() = 42
}
actual object Platform {
actual fun name(): String = "JVM"
}
""".trimIndent()
)
nativeMain.write(
"""
package sample
actual class Sample {
actual fun checkMe() = 7
}
actual object Platform {
actual fun name(): String = "iOS"
}
""".trimIndent()
)
commonTest.write(
"""
package sample
import kotlin.test.Test
import kotlin.test.assertTrue
class SampleTests {
@Test
fun testMe() {
assertTrue(Sample().checkMe() > 0)
}
}
""".trimIndent()
)
jvmTest.write(
"""
package sample
import kotlin.test.Test
import kotlin.test.assertTrue
class SampleTestsJVM {
@Test
fun testHello() {
assertTrue("JVM" in hello())
}
}
""".trimIndent()
)
nativeTest.write(
"""
package sample
import kotlin.test.Test
import kotlin.test.assertTrue
class SampleTestsNative {
@Test
fun testHello() {
assertTrue("iOS" in hello())
}
}
""".trimIndent()
)
} finally {
listOf(commonMain, commonTest, jvmMain, jvmTest, nativeMain, nativeTest).forEach(BufferedWriter::close)
}
}
override fun buildMultiPlatformPart(): String {
return """
group '${projectId?.groupId ?: "com.example"}'
version '${projectId?.version ?: "0.0.1"}'
apply plugin: 'maven-publish'
kotlin {
jvm()
// This is for iPhone simulator
// Switch here to iosArm64 (or iosArm32) to build library for iPhone device
iosX64("$nativeTargetName") {
binaries {
framework()
}
}
sourceSets {
$commonSourceName {
dependencies {
implementation kotlin('stdlib-common')
}
}
$commonTestName {
dependencies {
implementation kotlin('test-common')
implementation kotlin('test-annotations-common')
}
}
$jvmSourceName {
dependencies {
implementation kotlin('stdlib')
}
}
$jvmTestName {
dependencies {
implementation kotlin('test')
implementation kotlin('test-junit')
}
}
$nativeSourceName {
}
$nativeTestName {
}
}
}
configurations {
compileClasspath
}
""".trimIndent()
}
}
@@ -1,238 +0,0 @@
/*
* Copyright 2010-2018 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.idea.configuration
import com.intellij.openapi.vfs.VirtualFile
import org.jetbrains.kotlin.idea.KotlinIdeaGradleBundle
import org.jetbrains.kotlin.konan.target.presetName
import java.io.BufferedWriter
class KotlinGradleSharedMultiplatformModuleBuilder : KotlinGradleAbstractMultiplatformModuleBuilder() {
private val commonName: String = "common"
private var jvmTargetName: String = "jvm"
private var jsTargetName: String = "js"
private var nativeTargetName: String = defaultNativeTarget.userTargetName
private val commonSourceName get() = "$commonName$productionSuffix"
private val commonTestName get() = "$commonName$testSuffix"
private val jvmSourceName get() = "$jvmTargetName$productionSuffix"
private val jvmTestName get() = "$jvmTargetName$testSuffix"
private val jsSourceName get() = "$jsTargetName$productionSuffix"
private val jsTestName get() = "$jsTargetName$testSuffix"
private val nativeSourceName get() = "$nativeTargetName$productionSuffix"
val nativeTestName get() = "$nativeTargetName$testSuffix"
override val shouldEnableGradleMetadataPreview: Boolean = true
override fun getBuilderId() = "kotlin.gradle.multiplatform.shared"
override fun getPresentableName() = KotlinIdeaGradleBundle.message("presentable.text.multiplatform.library.gradle")
override fun getDescription() =
KotlinIdeaGradleBundle.message("description.text.multiplatform.jvm.js.native")
override fun createProjectSkeleton(rootDir: VirtualFile) {
val src = rootDir.createChildDirectory(this, "src")
val commonMain = src.createKotlinSampleFileWriter(commonSourceName)
val commonTest = src.createKotlinSampleFileWriter(commonTestName, fileName = "SampleTests.kt")
val jvmMain = src.createKotlinSampleFileWriter(jvmSourceName, jvmTargetName)
val jvmTest = src.createKotlinSampleFileWriter(jvmTestName, fileName = "SampleTestsJVM.kt")
val jsMain = src.createKotlinSampleFileWriter(jsSourceName, jsTargetName)
val jsTest = src.createKotlinSampleFileWriter(jsTestName, fileName = "SampleTestsJS.kt")
val nativeMain = src.createKotlinSampleFileWriter(nativeSourceName, nativeTargetName)
val nativeTest = src.createKotlinSampleFileWriter(nativeTestName, fileName = "SampleTestsNative.kt")
try {
commonMain.write(
"""
package sample
expect class Sample() {
fun checkMe(): Int
}
expect object Platform {
val name: String
}
fun hello(): String = "Hello from ${"$"}{Platform.name}"
""".trimIndent()
)
jvmMain.write(
"""
package sample
actual class Sample {
actual fun checkMe() = 42
}
actual object Platform {
actual val name: String = "JVM"
}
""".trimIndent()
)
jsMain.write(
"""
package sample
actual class Sample {
actual fun checkMe() = 12
}
actual object Platform {
actual val name: String = "JS"
}
""".trimIndent()
)
nativeMain.write(
"""
package sample
actual class Sample {
actual fun checkMe() = 7
}
actual object Platform {
actual val name: String = "Native"
}
""".trimIndent()
)
commonTest.write(
"""
package sample
import kotlin.test.Test
import kotlin.test.assertTrue
class SampleTests {
@Test
fun testMe() {
assertTrue(Sample().checkMe() > 0)
}
}
""".trimIndent()
)
jvmTest.write(
"""
package sample
import kotlin.test.Test
import kotlin.test.assertTrue
class SampleTestsJVM {
@Test
fun testHello() {
assertTrue("JVM" in hello())
}
}
""".trimIndent()
)
jsTest.write(
"""
package sample
import kotlin.test.Test
import kotlin.test.assertTrue
class SampleTestsJS {
@Test
fun testHello() {
assertTrue("JS" in hello())
}
}
""".trimIndent()
)
nativeTest.write(
"""
package sample
import kotlin.test.Test
import kotlin.test.assertTrue
class SampleTestsNative {
@Test
fun testHello() {
assertTrue("Native" in hello())
}
}
""".trimIndent()
)
} finally {
listOf(commonMain, commonTest, jvmMain, jvmTest, jsMain, jsTest, nativeMain, nativeTest).forEach(BufferedWriter::close)
}
}
override fun buildMultiPlatformPart(): String {
return """
group '${projectId?.groupId ?: "com.example"}'
version '${projectId?.version ?: "0.0.1"}'
apply plugin: 'maven-publish'
kotlin {
jvm()
js {
browser {
}
nodejs {
}
}
// For ARM, should be changed to iosArm32 or iosArm64
// For Linux, should be changed to e.g. linuxX64
// For MacOS, should be changed to e.g. macosX64
// For Windows, should be changed to e.g. mingwX64
${defaultNativeTarget.presetName}("${defaultNativeTarget.userTargetName}")
sourceSets {
$commonSourceName {
dependencies {
implementation kotlin('stdlib-common')
}
}
$commonTestName {
dependencies {
implementation kotlin('test-common')
implementation kotlin('test-annotations-common')
}
}
$jvmSourceName {
dependencies {
implementation kotlin('stdlib-jdk8')
}
}
$jvmTestName {
dependencies {
implementation kotlin('test')
implementation kotlin('test-junit')
}
}
$jsSourceName {
dependencies {
implementation kotlin('stdlib-js')
}
}
$jsTestName {
dependencies {
implementation kotlin('test-js')
}
}
$nativeSourceName {
}
$nativeTestName {
}
}
}
""".trimIndent()
}
}
@@ -1,282 +0,0 @@
/*
* Copyright 2010-2018 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.idea.configuration
import com.intellij.openapi.vfs.VirtualFile
import org.jetbrains.kotlin.idea.KotlinIdeaGradleBundle
import org.jetbrains.plugins.gradle.frameworkSupport.BuildScriptDataBuilder
import java.io.BufferedWriter
class KotlinGradleWebMultiplatformModuleBuilder : KotlinGradleAbstractMultiplatformModuleBuilder() {
private val commonName: String = "common"
private var jvmTargetName: String = "jvm"
private var jsTargetName: String = "js"
private val commonSourceName get() = "$commonName$productionSuffix"
private val commonTestName get() = "$commonName$testSuffix"
private val jvmSourceName get() = "$jvmTargetName$productionSuffix"
private val jvmTestName get() = "$jvmTargetName$testSuffix"
private val jsSourceName get() = "$jsTargetName$productionSuffix"
private val jsTestName get() = "$jsTargetName$testSuffix"
override fun getBuilderId() = "kotlin.gradle.multiplatform.web"
override fun getPresentableName() = KotlinIdeaGradleBundle.message("presentable.text.js.client.and.jvm.server.gradle")
override fun getDescription() = KotlinIdeaGradleBundle.message(
"description.text.multiplatform.gradle.project.allowing.reuse.of.the.same.kotlin.code.between.js.client.and.jvm.server"
)
override fun BuildScriptDataBuilder.setupAdditionalDependencies() {
addBuildscriptRepositoriesDefinition("jcenter()")
addRepositoriesDefinition("maven { url \"https://dl.bintray.com/kotlin/ktor\" }")
addRepositoriesDefinition("jcenter()")
}
override fun createProjectSkeleton(rootDir: VirtualFile) {
val src = rootDir.createChildDirectory(this, "src")
val commonMain = src.createKotlinSampleFileWriter(commonSourceName)
val commonTest = src.createKotlinSampleFileWriter(commonTestName, fileName = "SampleTests.kt")
val jvmMain = src.createKotlinSampleFileWriter(jvmSourceName, jvmTargetName)
val jvmTest = src.createKotlinSampleFileWriter(jvmTestName, fileName = "SampleTestsJVM.kt")
val jsMain = src.createKotlinSampleFileWriter(jsSourceName, jsTargetName)
val jsTest = src.createKotlinSampleFileWriter(jsTestName, fileName = "SampleTestsJS.kt")
val jvmRoot = src.findChild(jvmSourceName)!!
val jvmResources = jvmRoot.createChildDirectory(this, "resources")
val logBack = jvmResources.createChildData(this, "logback.xml").bufferedWriter()
try {
commonMain.write(
"""
package sample
expect class Sample() {
fun checkMe(): Int
}
expect object Platform {
val name: String
}
fun hello(): String = "Hello from ${"$"}{Platform.name}"
""".trimIndent()
)
jvmMain.write(
"""
package sample
import io.ktor.application.*
import io.ktor.html.*
import io.ktor.http.content.*
import io.ktor.routing.*
import io.ktor.server.engine.*
import io.ktor.server.netty.*
import kotlinx.html.*
import java.io.*
actual class Sample {
actual fun checkMe() = 42
}
actual object Platform {
actual val name: String = "JVM"
}
fun main() {
embeddedServer(Netty, port = 8080, host = "127.0.0.1") {
routing {
get("/") {
call.respondHtml {
head {
title("Hello from Ktor!")
}
body {
+"${'$'}{hello()} from Ktor. Check me value: ${'$'}{Sample().checkMe()}"
div {
id = "js-response"
+"Loading..."
}
script(src = "/static/$name.js") {}
}
}
}
static("/static") {
resource("$name.js")
}
}
}.start(wait = true)
}
""".trimIndent()
)
logBack.write(
"""
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="STDOUT"/>
</root>
</configuration>
""".trimIndent()
)
jsMain.write(
"""
package sample
import kotlin.browser.*
actual class Sample {
actual fun checkMe() = 12
}
actual object Platform {
actual val name: String = "JS"
}
@Suppress("unused")
@JsName("helloWorld")
fun helloWorld(salutation: String) {
val message = "${"$"}salutation from Kotlin.JS ${"$"}{hello()}, check me value: ${"$"}{Sample().checkMe()}"
document.getElementById("js-response")?.textContent = message
}
fun main() {
document.addEventListener("DOMContentLoaded", {
helloWorld("Hi!")
})
}
""".trimIndent()
)
commonTest.write(
"""
package sample
import kotlin.test.Test
import kotlin.test.assertTrue
class SampleTests {
@Test
fun testMe() {
assertTrue(Sample().checkMe() > 0)
}
}
""".trimIndent()
)
jvmTest.write(
"""
package sample
import kotlin.test.Test
import kotlin.test.assertTrue
class SampleTestsJVM {
@Test
fun testHello() {
assertTrue("JVM" in hello())
}
}
""".trimIndent()
)
jsTest.write(
"""
package sample
import kotlin.test.Test
import kotlin.test.assertTrue
class SampleTestsJS {
@Test
fun testHello() {
assertTrue("JS" in hello())
}
}
""".trimIndent()
)
} finally {
listOf(commonMain, commonTest, jvmMain, jvmTest, jsMain, jsTest, logBack).forEach(BufferedWriter::close)
}
}
override fun buildMultiPlatformPart(): String {
//language=Gradle
return """
def ktor_version = '1.3.2'
def logback_version = '1.2.3'
kotlin {
jvm()
js {
browser {
}
binaries.executable()
}
sourceSets {
$commonSourceName {
dependencies {
implementation kotlin('stdlib-common')
}
}
$commonTestName {
dependencies {
implementation kotlin('test-common')
implementation kotlin('test-annotations-common')
}
}
$jvmSourceName {
dependencies {
implementation kotlin('stdlib-jdk8')
implementation "io.ktor:ktor-server-netty:${"$"}ktor_version"
implementation "io.ktor:ktor-html-builder:${"$"}ktor_version"
implementation "ch.qos.logback:logback-classic:${"$"}logback_version"
}
}
$jvmTestName {
dependencies {
implementation kotlin('test')
implementation kotlin('test-junit')
}
}
$jsSourceName {
dependencies {
implementation kotlin('stdlib-js')
}
}
$jsTestName {
dependencies {
implementation kotlin('test-js')
}
}
}
}
jvmJar {
dependsOn(jsBrowserProductionWebpack)
from(jsBrowserProductionWebpack.outputFile)
}
task run(type: JavaExec, dependsOn: [jvmJar]) {
group = "application"
main = "sample.SampleJvmKt"
classpath(configurations.jvmRuntimeClasspath, jvmJar)
args = []
}
""".trimIndent()
}
}
@@ -1,271 +0,0 @@
/*
* Copyright 2010-2018 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.gradle
import com.intellij.ide.projectWizard.NewProjectWizard
import com.intellij.ide.projectWizard.ProjectTypeStep
import com.intellij.ide.projectWizard.ProjectWizardTestCase
import com.intellij.ide.util.newProjectWizard.AbstractProjectWizard
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.application.Result
import com.intellij.openapi.application.WriteAction
import com.intellij.openapi.components.ServiceManager
import com.intellij.openapi.externalSystem.importing.ImportSpecBuilder
import com.intellij.openapi.externalSystem.model.DataNode
import com.intellij.openapi.externalSystem.model.project.ProjectData
import com.intellij.openapi.externalSystem.service.execution.ProgressExecutionMode
import com.intellij.openapi.externalSystem.service.project.ExternalProjectRefreshCallback
import com.intellij.openapi.externalSystem.service.project.ProjectDataManager
import com.intellij.openapi.externalSystem.settings.ExternalProjectSettings
import com.intellij.openapi.externalSystem.settings.ExternalSystemSettingsListenerAdapter
import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil
import com.intellij.openapi.externalSystem.util.ExternalSystemUtil
import com.intellij.openapi.fileTypes.FileTypeManager
import com.intellij.openapi.module.ModuleManager
import com.intellij.openapi.project.Project
import com.intellij.openapi.project.ProjectManager
import com.intellij.openapi.projectRoots.SimpleJavaSdkType
import com.intellij.openapi.roots.ModuleRootManager
import com.intellij.openapi.roots.ProjectRootManager
import com.intellij.openapi.roots.ui.configuration.ModulesProvider
import com.intellij.openapi.util.Couple
import com.intellij.openapi.util.Ref
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.util.text.StringUtil
import com.intellij.openapi.vfs.LocalFileSystem
import com.intellij.openapi.vfs.VfsUtilCore
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.testFramework.IdeaTestUtil
import com.intellij.testFramework.UsefulTestCase
import com.intellij.util.containers.ContainerUtil
import com.intellij.util.containers.ContainerUtilRt
import junit.framework.TestCase
import org.jetbrains.kotlin.idea.codeInsight.gradle.ExternalSystemImportingTestCase.LATEST_STABLE_GRADLE_PLUGIN_VERSION
import org.jetbrains.kotlin.idea.codeInsight.gradle.GradleImportingTestCase
import org.jetbrains.kotlin.idea.configuration.KotlinGradleAbstractMultiplatformModuleBuilder
import org.jetbrains.kotlin.idea.util.getProjectJdkTableSafe
import org.jetbrains.kotlin.test.isIgnoredInDatabaseWithLog
import org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper
import org.jetbrains.plugins.gradle.settings.DistributionType
import org.jetbrains.plugins.gradle.settings.GradleExecutionSettings
import org.jetbrains.plugins.gradle.settings.GradleProjectSettings
import org.jetbrains.plugins.gradle.settings.GradleSettings
import org.jetbrains.plugins.gradle.util.GradleConstants
import org.jetbrains.plugins.groovy.GroovyFileType
import java.io.File
import java.io.IOException
abstract class AbstractGradleMultiplatformWizardTest : ProjectWizardTestCase<AbstractProjectWizard>() {
private val pluginVersion = LATEST_STABLE_GRADLE_PLUGIN_VERSION
override fun createWizard(project: Project?, directory: File): AbstractProjectWizard {
return NewProjectWizard(project, ModulesProvider.EMPTY_MODULES_PROVIDER, directory.path)
}
private fun Project.reconfigureGradleSettings(f: GradleProjectSettings.() -> Unit) {
val systemSettings = ExternalSystemApiUtil.getSettings(
this,
externalSystemId
)
val projectSettings = GradleProjectSettings()
projectSettings.f()
val projects = ContainerUtilRt.newHashSet<Any>(systemSettings.getLinkedProjectsSettings())
projects.remove(projectSettings)
projects.add(projectSettings)
systemSettings.setLinkedProjectsSettings(projects)
}
protected fun testImportFromBuilder(
builder: KotlinGradleAbstractMultiplatformModuleBuilder,
vararg testClassNames: String,
metadataInside: Boolean = false,
performImport: Boolean = true,
useQualifiedModuleNames: Boolean = false
): Project {
val project = createProject { step ->
if (step is ProjectTypeStep) {
TestCase.assertTrue(step.setSelectedTemplate("Kotlin", builder.presentableName))
val steps = myWizard.sequence.selectedSteps
TestCase.assertEquals(4, steps.size)
val projectBuilder = myWizard.projectBuilder
UsefulTestCase.assertInstanceOf(projectBuilder, builder::class.java)
with(projectBuilder as KotlinGradleAbstractMultiplatformModuleBuilder) {
explicitPluginVersion = pluginVersion
}
myProject.reconfigureGradleSettings {
distributionType = DistributionType.DEFAULT_WRAPPED
}
}
}
val modules = ModuleManager.getInstance(project).modules
TestCase.assertEquals(1, modules.size)
val module = modules[0]
TestCase.assertTrue(ModuleRootManager.getInstance(module).isSdkInherited)
val root = ProjectRootManager.getInstance(project).contentRoots[0]
val settingsScript = VfsUtilCore.findRelativeFile("settings.gradle", root)
TestCase.assertNotNull(settingsScript)
val settingsScriptText = StringUtil.convertLineSeparators(VfsUtilCore.loadText(settingsScript!!))
TestCase.assertTrue("rootProject.name = " in settingsScriptText)
if (metadataInside) {
TestCase.assertTrue("enableFeaturePreview('GRADLE_METADATA')" in settingsScriptText)
}
File(root.canonicalPath).assertNoEmptyChildren()
val buildScript = VfsUtilCore.findRelativeFile("build.gradle", root)!!
val buildScriptText = StringUtil.convertLineSeparators(VfsUtilCore.loadText(buildScript))
println(buildScriptText)
if (!performImport) return project
doImportProject(project, useQualifiedModuleNames)
if (testClassNames.isNotEmpty()) {
doTestProject(project, *testClassNames)
}
return project
}
private fun File.assertNoEmptyChildren() {
for (file in walkTopDown()) {
if (!file.isDirectory) {
var empty = true
file.forEachLine {
if (it.isNotEmpty()) {
empty = false
return@forEachLine
}
}
TestCase.assertFalse("Generated file ${file.path} is empty", empty)
}
}
}
@Throws(IOException::class)
private fun Project.createProjectSubFile(relativePath: String): VirtualFile {
val f = File(basePath!!, relativePath)
FileUtil.ensureExists(f.parentFile)
FileUtil.ensureCanCreateFile(f)
val created = f.createNewFile()
if (!created) {
throw AssertionError("Unable to create the project sub file: " + f.absolutePath)
}
return LocalFileSystem.getInstance().refreshAndFindFileByIoFile(f)!!
}
private fun runWrite(f: () -> Unit) {
object : WriteAction<Any>() {
override fun run(result: Result<Any>) {
f()
}
}.execute()
}
private fun doImportProject(project: Project, useQualifiedModuleNames: Boolean = false) {
ExternalSystemApiUtil.subscribe(
project,
GradleConstants.SYSTEM_ID,
object : ExternalSystemSettingsListenerAdapter<ExternalProjectSettings>() {
override fun onProjectsLinked(settings: Collection<ExternalProjectSettings>) {
val item = ContainerUtil.getFirstItem<Any>(settings)
if (item is GradleProjectSettings) {
item.gradleJvm = DEFAULT_SDK
}
}
})
GradleSettings.getInstance(project).gradleVmOptions = "-Xmx256m -XX:MaxPermSize=64m"
val wrapperJarFrom = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(GradleImportingTestCase.wrapperJar())!!
val wrapperJarFromTo = project.createProjectSubFile("gradle/wrapper/gradle-wrapper.jar")
runWrite {
wrapperJarFromTo.setBinaryContent(wrapperJarFrom.contentsToByteArray())
}
project.reconfigureGradleSettings {
distributionType = DistributionType.DEFAULT_WRAPPED
externalProjectPath = project.basePath!!
gradleJvm = DEFAULT_SDK
isUseQualifiedModuleNames = useQualifiedModuleNames
}
val error = Ref.create<Couple<String>>()
ExternalSystemUtil.refreshProjects(
ImportSpecBuilder(project, externalSystemId)
.use(ProgressExecutionMode.MODAL_SYNC)
.callback(object : ExternalProjectRefreshCallback {
override fun onSuccess(externalProject: DataNode<ProjectData>?) {
if (externalProject == null) {
val errorMessage = "Got null External project after import"
System.err.println(errorMessage)
error.set(Couple.of(errorMessage, null))
return
}
ServiceManager.getService(ProjectDataManager::class.java).importData(externalProject, project, true)
println("External project was successfully imported")
}
override fun onFailure(errorMessage: String, errorDetails: String?) {
error.set(Couple.of(errorMessage, errorDetails))
}
})
.forceWhenUptodate()
)
if (!error.isNull) {
var failureMsg = "Import failed: " + error.get().first
if (StringUtil.isNotEmpty(error.get().second)) {
failureMsg += "\nError details: \n" + error.get().second
}
TestCase.fail(failureMsg)
}
}
private fun doTestProject(project: Project, vararg testClassNames: String) {
val settings = GradleExecutionSettings(null, null, DistributionType.DEFAULT_WRAPPED, false)
println("Running project tests: ${testClassNames.toList()}")
GradleExecutionHelper().execute(project.basePath!!, settings) {
// TODO: --no-daemon should be here, unfortunately it does not work for TestLauncher
val testLauncher = it.newTestLauncher()
testLauncher.withJvmTestClasses(*testClassNames).run()
}
}
protected fun runTaskInProject(project: Project, taskName: String) {
val settings = GradleExecutionSettings(null, null, DistributionType.DEFAULT_WRAPPED, false)
println("Running project task: $taskName")
GradleExecutionHelper().execute(project.basePath!!, settings) {
it.newBuild().forTasks(taskName).run()
}
}
override fun setUp() {
super.setUp()
val javaHome = IdeaTestUtil.requireRealJdkHome()
ApplicationManager.getApplication().runWriteAction {
val defaultJDK = SimpleJavaSdkType().createJdk(DEFAULT_SDK, javaHome)
addSdk(defaultJDK)
addSdk(SimpleJavaSdkType().createJdk("_other", javaHome))
ProjectRootManager.getInstance(ProjectManager.getInstance().defaultProject).projectSdk = defaultJDK
println("ProjectWizardTestCase.configureJdk:")
println(listOf(*getProjectJdkTableSafe().allJdks))
FileTypeManager.getInstance().associateExtension(GroovyFileType.GROOVY_FILE_TYPE, "gradle")
}
}
override fun shouldRunTest(): Boolean {
return super.shouldRunTest() && !isIgnoredInDatabaseWithLog(this)
}
companion object {
val externalSystemId = GradleConstants.SYSTEM_ID
}
}
@@ -1,71 +0,0 @@
/*
* Copyright 2010-2018 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.gradle
import org.jetbrains.kotlin.ide.konan.gradle.KotlinGradleNativeMultiplatformModuleBuilder
import org.jetbrains.kotlin.idea.configuration.KotlinGradleMobileMultiplatformModuleBuilder
import org.jetbrains.kotlin.idea.configuration.KotlinGradleMobileSharedMultiplatformModuleBuilder
import org.jetbrains.kotlin.idea.configuration.KotlinGradleSharedMultiplatformModuleBuilder
import org.jetbrains.kotlin.idea.configuration.KotlinGradleWebMultiplatformModuleBuilder
import org.jetbrains.kotlin.idea.test.KotlinSdkCreationChecker
import org.jetbrains.kotlin.konan.target.HostManager
import org.jetbrains.kotlin.test.JUnit3WithIdeaConfigurationRunner
import org.jetbrains.kotlin.test.runTest
import org.junit.runner.RunWith
@RunWith(JUnit3WithIdeaConfigurationRunner::class)
class GradleMultiplatformWizardTest : AbstractGradleMultiplatformWizardTest() {
lateinit var sdkCreationChecker: KotlinSdkCreationChecker
override fun setUp() {
super.setUp()
sdkCreationChecker = KotlinSdkCreationChecker()
}
override fun tearDown() {
sdkCreationChecker.removeNewKotlinSdk()
super.tearDown()
}
fun testMobile() {
// TODO: add import & tests here when we will be able to locate Android SDK automatically (see KT-27635)
testImportFromBuilder(KotlinGradleMobileMultiplatformModuleBuilder(), performImport = false)
}
fun testMobileShared() {
val builder = KotlinGradleMobileSharedMultiplatformModuleBuilder()
val project = testImportFromBuilder(builder, "SampleTests", "SampleTestsJVM", metadataInside = true)
// Native tests can be run on Mac only
if (HostManager.hostIsMac) {
runTaskInProject(project, builder.nativeTestName)
}
}
fun testNative() {
val builder = KotlinGradleNativeMultiplatformModuleBuilder()
val project = testImportFromBuilder(builder)
runTaskInProject(project, builder.nativeTestName)
}
fun testShared() {
val builder = KotlinGradleSharedMultiplatformModuleBuilder()
val project = testImportFromBuilder(builder, "SampleTests", "SampleTestsJVM", "SampleTestsNative", metadataInside = true)
runTaskInProject(project, builder.nativeTestName)
}
fun testSharedWithQualifiedName() {
val builder = KotlinGradleSharedMultiplatformModuleBuilder()
val project = testImportFromBuilder(builder, "SampleTests", "SampleTestsJVM", "SampleTestsNative", metadataInside = true, useQualifiedModuleNames = true)
runTaskInProject(project, builder.nativeTestName)
}
fun testWeb() {
runTest {
testImportFromBuilder(KotlinGradleWebMultiplatformModuleBuilder(), "SampleTests", "SampleTestsJVM")
}
}
}
-5
View File
@@ -63,10 +63,5 @@
<scriptAdditionalIdeaDependenciesProvider
implementation="org.jetbrains.kotlin.idea.scripting.gradle.GradleScriptAdditionalIdeaDependenciesProvider"/>
<moduleBuilder implementation="org.jetbrains.kotlin.ide.konan.gradle.KotlinGradleNativeMultiplatformModuleBuilder"/>
<moduleBuilder implementation="org.jetbrains.kotlin.idea.configuration.KotlinGradleSharedMultiplatformModuleBuilder"/>
<moduleBuilder implementation="org.jetbrains.kotlin.idea.configuration.KotlinGradleWebMultiplatformModuleBuilder"/>
<moduleBuilder implementation="org.jetbrains.kotlin.idea.configuration.KotlinGradleMobileMultiplatformModuleBuilder"/>
<moduleBuilder implementation="org.jetbrains.kotlin.idea.configuration.KotlinGradleMobileSharedMultiplatformModuleBuilder"/>
</extensions>
</idea-plugin>
@@ -51,10 +51,5 @@
<scriptDefinitionContributor implementation="org.jetbrains.kotlin.idea.scripting.gradle.GradleScriptDefinitionsContributor" order="first"/>
<scriptAdditionalIdeaDependenciesProvider implementation="org.jetbrains.kotlin.idea.scripting.gradle.GradleScriptAdditionalIdeaDependenciesProvider"/>
<moduleBuilder implementation="org.jetbrains.kotlin.ide.konan.gradle.KotlinGradleNativeMultiplatformModuleBuilder"/>
<moduleBuilder implementation="org.jetbrains.kotlin.idea.configuration.KotlinGradleSharedMultiplatformModuleBuilder"/>
<moduleBuilder implementation="org.jetbrains.kotlin.idea.configuration.KotlinGradleWebMultiplatformModuleBuilder"/>
<moduleBuilder implementation="org.jetbrains.kotlin.idea.configuration.KotlinGradleMobileMultiplatformModuleBuilder"/>
<moduleBuilder implementation="org.jetbrains.kotlin.idea.configuration.KotlinGradleMobileSharedMultiplatformModuleBuilder"/>
</extensions>
</idea-plugin>
@@ -57,10 +57,5 @@
<scriptDefinitionContributor implementation="org.jetbrains.kotlin.idea.scripting.gradle.GradleScriptDefinitionsContributor" order="first"/>
<scriptAdditionalIdeaDependenciesProvider implementation="org.jetbrains.kotlin.idea.scripting.gradle.GradleScriptAdditionalIdeaDependenciesProvider"/>
<moduleBuilder implementation="org.jetbrains.kotlin.ide.konan.gradle.KotlinGradleNativeMultiplatformModuleBuilder"/>
<moduleBuilder implementation="org.jetbrains.kotlin.idea.configuration.KotlinGradleSharedMultiplatformModuleBuilder"/>
<moduleBuilder implementation="org.jetbrains.kotlin.idea.configuration.KotlinGradleWebMultiplatformModuleBuilder"/>
<moduleBuilder implementation="org.jetbrains.kotlin.idea.configuration.KotlinGradleMobileMultiplatformModuleBuilder"/>
<moduleBuilder implementation="org.jetbrains.kotlin.idea.configuration.KotlinGradleMobileSharedMultiplatformModuleBuilder"/>
</extensions>
</idea-plugin>
-1
View File
@@ -5,7 +5,6 @@ org.jetbrains.kotlin.checkers.JavaAgainstKotlinSourceCheckerTestGenerated.JavaAg
org.jetbrains.kotlin.checkers.JavaAgainstKotlinSourceCheckerWithoutUltraLightTestGenerated.JavaAgainstKotlin.testExtendingMutableInterfaces, KT-34105,,
org.jetbrains.kotlin.checkers.JavaAgainstKotlinSourceCheckerWithoutUltraLightTestGenerated.JavaAgainstKotlin.testUsingMutableInterfaces,,, FLAKY
org.jetbrains.kotlin.checkers.JavaAgainstKotlinSourceCheckerWithoutUltraLightTestGenerated.JavaAgainstKotlin.testUsingReadOnlyInterfaces,,, FLAKY
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testWeb, KT-35095,,
"org.jetbrains.kotlin.gradle.NewMultiplatformProjectImportingTest.testSingleAndroidTarget[1: Gradle-4.9, KotlinGradlePlugin-latest stable]", Stable on windows,,
"org.jetbrains.kotlin.gradle.NewMultiplatformProjectImportingTest.testSingleAndroidTarget[3: Gradle-5.6.4, KotlinGradlePlugin-latest stable]", Stable on windows,,
org.jetbrains.kotlin.idea.caches.resolve.MultiPlatformHighlightingTestGenerated.testJvmKotlinReferencesCommonKotlinThroughJavaDifferentJvmImpls, Always red,,
1 Test key Issue State (optional: MUTE or FAIL) Status (optional: FLAKY)
5 org.jetbrains.kotlin.checkers.JavaAgainstKotlinSourceCheckerWithoutUltraLightTestGenerated.JavaAgainstKotlin.testExtendingMutableInterfaces KT-34105
6 org.jetbrains.kotlin.checkers.JavaAgainstKotlinSourceCheckerWithoutUltraLightTestGenerated.JavaAgainstKotlin.testUsingMutableInterfaces FLAKY
7 org.jetbrains.kotlin.checkers.JavaAgainstKotlinSourceCheckerWithoutUltraLightTestGenerated.JavaAgainstKotlin.testUsingReadOnlyInterfaces FLAKY
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testWeb KT-35095
8 org.jetbrains.kotlin.gradle.NewMultiplatformProjectImportingTest.testSingleAndroidTarget[1: Gradle-4.9, KotlinGradlePlugin-latest stable] Stable on windows
9 org.jetbrains.kotlin.gradle.NewMultiplatformProjectImportingTest.testSingleAndroidTarget[3: Gradle-5.6.4, KotlinGradlePlugin-latest stable] Stable on windows
10 org.jetbrains.kotlin.idea.caches.resolve.MultiPlatformHighlightingTestGenerated.testJvmKotlinReferencesCommonKotlinThroughJavaDifferentJvmImpls Always red
-4
View File
@@ -4,10 +4,6 @@ org.jetbrains.kotlin.checkers.JavaAgainstKotlinBinariesCheckerTestGenerated.test
org.jetbrains.kotlin.findUsages.KotlinFindUsagesWithLibraryTestGenerated.KotlinLibrary.testLibraryClassUsages, KT-34542, FAIL,
org.jetbrains.kotlin.findUsages.KotlinFindUsagesWithLibraryTestGenerated.KotlinLibrary.testLibraryNestedClassUsages, KT-34542, FAIL,
org.jetbrains.kotlin.findUsages.KotlinFindUsagesWithLibraryTestGenerated.KotlinLibrary.testLibraryObjectUsages, KT-34542, FAIL,
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testMobileShared, IDEA-225878,,
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testNative, IDEA-225878,,
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testShared, IDEA-225878,,
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testSharedWithQualifiedName, IDEA-225878,,
"org.jetbrains.kotlin.gradle.ImportAndCheckHighlighting.testMultiplatformLibrary[1: Gradle-4.9, KotlinGradlePlugin-latest stable]", KT-35631,,
"org.jetbrains.kotlin.gradle.ImportAndCheckHighlighting.testMultiplatformLibrary[3: Gradle-5.6.4, KotlinGradlePlugin-latest stable]", KT-35631,,
org.jetbrains.kotlin.gradle.MultiplatformProjectImportingTest.simpleAndroidAppWithCommonModule, KT-35225,,
1 Test key Issue State (optional: MUTE or FAIL) Status (optional: FLAKY)
4 org.jetbrains.kotlin.findUsages.KotlinFindUsagesWithLibraryTestGenerated.KotlinLibrary.testLibraryClassUsages KT-34542 FAIL
5 org.jetbrains.kotlin.findUsages.KotlinFindUsagesWithLibraryTestGenerated.KotlinLibrary.testLibraryNestedClassUsages KT-34542 FAIL
6 org.jetbrains.kotlin.findUsages.KotlinFindUsagesWithLibraryTestGenerated.KotlinLibrary.testLibraryObjectUsages KT-34542 FAIL
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testMobileShared IDEA-225878
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testNative IDEA-225878
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testShared IDEA-225878
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testSharedWithQualifiedName IDEA-225878
7 org.jetbrains.kotlin.gradle.ImportAndCheckHighlighting.testMultiplatformLibrary[1: Gradle-4.9, KotlinGradlePlugin-latest stable] KT-35631
8 org.jetbrains.kotlin.gradle.ImportAndCheckHighlighting.testMultiplatformLibrary[3: Gradle-5.6.4, KotlinGradlePlugin-latest stable] KT-35631
9 org.jetbrains.kotlin.gradle.MultiplatformProjectImportingTest.simpleAndroidAppWithCommonModule KT-35225
-5
View File
@@ -1,11 +1,6 @@
Test key, Issue, State (optional: MUTE or FAIL), Status (optional: FLAKY)
org.jetbrains.kotlin.checkers.JavaAgainstKotlinBinariesCheckerTestGenerated.testClassObjects, ERROR: Access to tree elements not allowed.,,
org.jetbrains.kotlin.checkers.JavaAgainstKotlinBinariesCheckerTestGenerated.testUsingKotlinPackageDeclarations, ERROR: Access to tree elements not allowed.,,
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testMobile, KT-35368,,
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testMobileShared, KT-35368,,
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testNative, KT-35368,,
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testShared, KT-35368,,
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testSharedWithQualifiedName, KT-35368,,
org.jetbrains.kotlin.idea.codeInsight.gradle.GradleFacetImportTest.testAndroidGradleJsDetection, NPE during import,,
org.jetbrains.kotlin.idea.codeInsight.gradle.GradleFacetImportTest.testKotlinAndroidPluginDetection, NPE during import,,
org.jetbrains.kotlin.idea.completion.test.JvmBasicCompletionTestGenerated.Common.StaticMembers.testJavaStaticMethodsFromImports, KT-32919,,
-5
View File
@@ -4,11 +4,6 @@ org.jetbrains.kotlin.checkers.JavaAgainstKotlinBinariesCheckerTestGenerated.test
org.jetbrains.kotlin.findUsages.KotlinFindUsagesWithLibraryTestGenerated.KotlinLibrary.testLibraryClassUsages, KT-34542, FAIL,
org.jetbrains.kotlin.findUsages.KotlinFindUsagesWithLibraryTestGenerated.KotlinLibrary.testLibraryNestedClassUsages, KT-34542, FAIL,
org.jetbrains.kotlin.findUsages.KotlinFindUsagesWithLibraryTestGenerated.KotlinLibrary.testLibraryObjectUsages, KT-34542, FAIL,
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testMobile, Leaked SDK,,
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testMobileShared, IDEA-225878,,
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testNative, IDEA-225878,,
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testShared, IDEA-225878,,
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testSharedWithQualifiedName, IDEA-225878,,
org.jetbrains.kotlin.gradle.HierarchicalMultiplatformProjectImportingTest.testImportHMPPFlag, KT-37125,,
org.jetbrains.kotlin.gradle.HierarchicalMultiplatformProjectImportingTest.testImportIntermediateModules, KT-37125,,
"org.jetbrains.kotlin.gradle.HierarchicalMultiplatformProjectImportingTest.testJvmWithJavaOnHMPP[1: Gradle-4.9, KotlinGradlePlugin-latest stable]", No module dependency found,,
-5
View File
@@ -1,11 +1,6 @@
Test key, Issue, State (optional: MUTE or FAIL), Status (optional: FLAKY)
org.jetbrains.kotlin.checkers.JavaAgainstKotlinBinariesCheckerTestGenerated.testClassObjects, ERROR: Access to tree elements not allowed.,,
org.jetbrains.kotlin.checkers.JavaAgainstKotlinBinariesCheckerTestGenerated.testUsingKotlinPackageDeclarations, ERROR: Access to tree elements not allowed.,,
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testMobile, KT-35368,,
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testMobileShared, KT-35368,,
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testNative, KT-35368,,
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testShared, KT-35368,,
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testSharedWithQualifiedName, KT-35368,,
org.jetbrains.kotlin.idea.codeInsight.gradle.GradleFacetImportTest.testAndroidGradleJsDetection, NPE during import,,
org.jetbrains.kotlin.idea.codeInsight.gradle.GradleFacetImportTest.testKotlinAndroidPluginDetection, NPE during import,,
org.jetbrains.kotlin.idea.codeInsight.gradle.GradleMigrateTest.testMigrateStdlib, Can't get migration information,,
-4
View File
@@ -4,10 +4,6 @@ org.jetbrains.kotlin.checkers.JavaAgainstKotlinBinariesCheckerTestGenerated.test
org.jetbrains.kotlin.findUsages.KotlinFindUsagesWithLibraryTestGenerated.KotlinLibrary.testLibraryClassUsages, KT-34542, FAIL,
org.jetbrains.kotlin.findUsages.KotlinFindUsagesWithLibraryTestGenerated.KotlinLibrary.testLibraryNestedClassUsages, KT-34542, FAIL,
org.jetbrains.kotlin.findUsages.KotlinFindUsagesWithLibraryTestGenerated.KotlinLibrary.testLibraryObjectUsages, KT-34542, FAIL,
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testMobileShared, IDEA-225878,,
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testNative, IDEA-225878,,
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testShared, IDEA-225878,,
org.jetbrains.kotlin.gradle.GradleMultiplatformWizardTest.testSharedWithQualifiedName, IDEA-225878,,
"org.jetbrains.kotlin.gradle.ImportAndCheckHighlighting.testMultiplatformLibrary[1: Gradle-4.9, KotlinGradlePlugin-latest stable]", KT-35631,,
"org.jetbrains.kotlin.gradle.ImportAndCheckHighlighting.testMultiplatformLibrary[3: Gradle-5.6.4, KotlinGradlePlugin-latest stable]", KT-35631,,
org.jetbrains.kotlin.gradle.MultiplatformProjectImportingTest.simpleAndroidAppWithCommonModule, KT-35225,,