Create android source root test added

This commit is contained in:
Andrey Uskov
2019-03-26 19:43:22 +03:00
parent dc84e8fce5
commit ff488bb871
4 changed files with 89 additions and 0 deletions
@@ -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
@@ -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
}
@@ -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')
}
}
}
}
@@ -0,0 +1 @@
include(":multiplatformb")