diff --git a/idea/idea-gradle/tests/org/jetbrains/kotlin/gradle/NewMultiplatformProjectImportingTest.kt b/idea/idea-gradle/tests/org/jetbrains/kotlin/gradle/NewMultiplatformProjectImportingTest.kt index cb741415e9e..c8c53b914a3 100644 --- a/idea/idea-gradle/tests/org/jetbrains/kotlin/gradle/NewMultiplatformProjectImportingTest.kt +++ b/idea/idea-gradle/tests/org/jetbrains/kotlin/gradle/NewMultiplatformProjectImportingTest.kt @@ -479,6 +479,23 @@ class NewMultiplatformProjectImportingTest : MultiplePluginVersionGradleImportin } } + @Test + fun testDetectAndroidSources() { + configureByFiles() + createProjectSubFile( + "local.properties", + "sdk.dir=/${KotlinTestUtils.getAndroidSdkSystemIndependentPath()}" + ) + importProject(true) + checkProjectStructure(exhaustiveModuleList = false, exhaustiveDependencyList = false, exhaustiveSourceSourceRootList = false) { + module("multiplatformb") { + sourceFolder("multiplatformb/src/androidMain/kotlin", JavaSourceRootType.SOURCE) + + + } + } + } + /** * This test is inherited form testPlatformToCommonExpectedByInComposite and actually tests * dependencies in multiplatform project included in composite build diff --git a/idea/testData/gradle/newMultiplatformImport/detectAndroidSources/build.gradle b/idea/testData/gradle/newMultiplatformImport/detectAndroidSources/build.gradle new file mode 100644 index 00000000000..d23ccec482f --- /dev/null +++ b/idea/testData/gradle/newMultiplatformImport/detectAndroidSources/build.gradle @@ -0,0 +1,32 @@ +buildscript { + apply from: "include.gradle" + def kotlinVersion = gradleKotlinPluginVersion('1.3.21') + + + ext.kotlin_version = "$kotlinVersion" + repositories { + maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' } + + google() + jcenter() + } + + dependencies { + classpath 'com.android.tools.build:gradle:3.2.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' } + + google() + jcenter() + + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/idea/testData/gradle/newMultiplatformImport/detectAndroidSources/multiplatformb/build.gradle b/idea/testData/gradle/newMultiplatformImport/detectAndroidSources/multiplatformb/build.gradle new file mode 100644 index 00000000000..7982df9d045 --- /dev/null +++ b/idea/testData/gradle/newMultiplatformImport/detectAndroidSources/multiplatformb/build.gradle @@ -0,0 +1,39 @@ +plugins { + id 'kotlin-multiplatform' +} + +apply plugin: 'com.android.library' + +android { + compileSdkVersion 26 + defaultConfig { + minSdkVersion 15 + targetSdkVersion 26 + versionCode 1 + versionName "1.0" + + } +} + +kotlin { + android("android") + jvm("jvm") + + sourceSets { + commonMain { + dependencies { + implementation kotlin('stdlib-common') + } + } + androidMain { + dependencies { + implementation kotlin('stdlib') + } + } + jvmMain { + dependencies { + implementation kotlin('stdlib') + } + } + } +} diff --git a/idea/testData/gradle/newMultiplatformImport/detectAndroidSources/settings.gradle b/idea/testData/gradle/newMultiplatformImport/detectAndroidSources/settings.gradle new file mode 100644 index 00000000000..48f9c3103c7 --- /dev/null +++ b/idea/testData/gradle/newMultiplatformImport/detectAndroidSources/settings.gradle @@ -0,0 +1 @@ +include(":multiplatformb")