Rewrite MultiplatformProjectImportingTest to use testData directory
This commit is contained in:
+18
-703
@@ -52,47 +52,7 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testPlatformToCommonDependency() {
|
fun testPlatformToCommonDependency() {
|
||||||
createProjectSubFile("settings.gradle", "include ':common', ':jvm', ':js'")
|
val files = configureByFiles()
|
||||||
val commonTestFile = createProjectSubFile("common/src/test/kotlin/test.kt", "")
|
|
||||||
createProjectSubFile("jvm/src/test/kotlin/test.kt", "")
|
|
||||||
createProjectSubFile("js/src/test/kotlin/test.kt", "")
|
|
||||||
|
|
||||||
val kotlinVersion = "1.1.0"
|
|
||||||
|
|
||||||
createProjectSubFile(
|
|
||||||
"build.gradle", """
|
|
||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('common') {
|
|
||||||
apply plugin: 'kotlin-platform-common'
|
|
||||||
}
|
|
||||||
|
|
||||||
project('jvm') {
|
|
||||||
apply plugin: 'kotlin-platform-jvm'
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implement project(':common')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('js') {
|
|
||||||
apply plugin: 'kotlin-platform-js'
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implement project(':common')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
|
|
||||||
importProject()
|
importProject()
|
||||||
|
|
||||||
assertModuleModuleDepScope("jvm_main", "common_main", DependencyScope.COMPILE)
|
assertModuleModuleDepScope("jvm_main", "common_main", DependencyScope.COMPILE)
|
||||||
@@ -105,56 +65,14 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
|
|||||||
assertProductionOnTestDependency("js_main", "common_main", false)
|
assertProductionOnTestDependency("js_main", "common_main", false)
|
||||||
assertProductionOnTestDependency("js_test", "common_test", true)
|
assertProductionOnTestDependency("js_test", "common_test", true)
|
||||||
|
|
||||||
|
val commonTestFile = files.find { it.path.contains("common") }!!
|
||||||
assertFileInModuleScope(commonTestFile, "jvm_test")
|
assertFileInModuleScope(commonTestFile, "jvm_test")
|
||||||
assertFileInModuleScope(commonTestFile, "js_test")
|
assertFileInModuleScope(commonTestFile, "js_test")
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testPlatformToCommonExpectedByDependency() {
|
fun testPlatformToCommonExpectedByDependency() {
|
||||||
createProjectSubFile("settings.gradle", "include ':common1', ':common2', ':jvm', ':js'")
|
configureByFiles()
|
||||||
|
|
||||||
val kotlinVersion = "1.2.40-dev-610"
|
|
||||||
|
|
||||||
createProjectSubFile(
|
|
||||||
"build.gradle", """
|
|
||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
maven { url 'http://dl.bintray.com/kotlin/kotlin-dev' }
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('common1') {
|
|
||||||
apply plugin: 'kotlin-platform-common'
|
|
||||||
}
|
|
||||||
|
|
||||||
project('common2') {
|
|
||||||
apply plugin: 'kotlin-platform-common'
|
|
||||||
}
|
|
||||||
|
|
||||||
project('jvm') {
|
|
||||||
apply plugin: 'kotlin-platform-jvm'
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
expectedBy project(':common1')
|
|
||||||
expectedBy project(':common2')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('js') {
|
|
||||||
apply plugin: 'kotlin-platform-js'
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
expectedBy project(':common1')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
|
|
||||||
importProject()
|
importProject()
|
||||||
assertModuleModuleDepScope("jvm_main", "common1_main", DependencyScope.COMPILE)
|
assertModuleModuleDepScope("jvm_main", "common1_main", DependencyScope.COMPILE)
|
||||||
assertModuleModuleDepScope("jvm_main", "common2_main", DependencyScope.COMPILE)
|
assertModuleModuleDepScope("jvm_main", "common2_main", DependencyScope.COMPILE)
|
||||||
@@ -168,63 +86,7 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testPlatformToCommonExpectedByDependencyInComposite() {
|
fun testPlatformToCommonExpectedByDependencyInComposite() {
|
||||||
createProjectSubFile("toInclude/settings.gradle", "include ':common', ':jvm', ':js'")
|
configureByFiles()
|
||||||
|
|
||||||
val kotlinVersion = "1.2.0-beta-74"
|
|
||||||
|
|
||||||
createProjectSubFile(
|
|
||||||
"toInclude/build.gradle", """
|
|
||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
maven { url 'http://dl.bintray.com/kotlin/kotlin-dev' }
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('common') {
|
|
||||||
apply plugin: 'kotlin-platform-common'
|
|
||||||
}
|
|
||||||
|
|
||||||
project('jvm') {
|
|
||||||
apply plugin: 'kotlin-platform-jvm'
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
expectedBy project(':common')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('js') {
|
|
||||||
apply plugin: 'kotlin-platform-js'
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
expectedBy project(':common')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
|
|
||||||
createProjectSubFile("settings.gradle", "includeBuild('toInclude')")
|
|
||||||
createProjectSubFile(
|
|
||||||
"build.gradle", """
|
|
||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
maven { url 'http://dl.bintray.com/kotlin/kotlin-dev' }
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'kotlin'
|
|
||||||
""".trimIndent()
|
|
||||||
)
|
|
||||||
|
|
||||||
importProject()
|
importProject()
|
||||||
|
|
||||||
TestCase.assertEquals(listOf("common_main"), facetSettings("jvm_main").implementedModuleNames)
|
TestCase.assertEquals(listOf("common_main"), facetSettings("jvm_main").implementedModuleNames)
|
||||||
@@ -240,42 +102,7 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testPlatformToCommonDependencyRoot() {
|
fun testPlatformToCommonDependencyRoot() {
|
||||||
createProjectSubFile("settings.gradle", "rootProject.name = 'foo'\ninclude ':jvm', ':js'")
|
configureByFiles()
|
||||||
|
|
||||||
val kotlinVersion = "1.1.0"
|
|
||||||
|
|
||||||
createProjectSubFile(
|
|
||||||
"build.gradle", """
|
|
||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'kotlin-platform-common'
|
|
||||||
|
|
||||||
project('jvm') {
|
|
||||||
apply plugin: 'kotlin-platform-jvm'
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implement project(':')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('js') {
|
|
||||||
apply plugin: 'kotlin-platform-js'
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implement project(':')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
|
|
||||||
importProject()
|
importProject()
|
||||||
assertModuleModuleDepScope("jvm_main", "foo_main", DependencyScope.COMPILE)
|
assertModuleModuleDepScope("jvm_main", "foo_main", DependencyScope.COMPILE)
|
||||||
assertModuleModuleDepScope("jvm_test", "foo_test", DependencyScope.COMPILE)
|
assertModuleModuleDepScope("jvm_test", "foo_test", DependencyScope.COMPILE)
|
||||||
@@ -285,70 +112,7 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testMultiProject() {
|
fun testMultiProject() {
|
||||||
createProjectSubFile("settings.gradle", "include ':common-lib', ':jvm-lib', ':js-lib', ':common-app', ':jvm-app', ':js-app'")
|
configureByFiles()
|
||||||
|
|
||||||
val kotlinVersion = "1.1.0"
|
|
||||||
|
|
||||||
createProjectSubFile(
|
|
||||||
"build.gradle", """
|
|
||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('common-lib') {
|
|
||||||
apply plugin: 'kotlin-platform-common'
|
|
||||||
}
|
|
||||||
|
|
||||||
project('jvm-lib') {
|
|
||||||
apply plugin: 'kotlin-platform-jvm'
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implement project(':common-lib')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('js-lib') {
|
|
||||||
apply plugin: 'kotlin-platform-js'
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implement project(':common-lib')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('common-app') {
|
|
||||||
apply plugin: 'kotlin-platform-common'
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compile project(':common-lib')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('jvm-app') {
|
|
||||||
apply plugin: 'kotlin-platform-jvm'
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implement project(':common-app')
|
|
||||||
compile project(':jvm-lib')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('js-app') {
|
|
||||||
apply plugin: 'kotlin-platform-js'
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implement project(':common-app')
|
|
||||||
compile project(':js-lib')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
|
|
||||||
importProject()
|
importProject()
|
||||||
|
|
||||||
assertModuleModuleDepScope("jvm-app_main", "common-app_main", DependencyScope.COMPILE)
|
assertModuleModuleDepScope("jvm-app_main", "common-app_main", DependencyScope.COMPILE)
|
||||||
@@ -362,60 +126,7 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testDependenciesReachableViaImpl() {
|
fun testDependenciesReachableViaImpl() {
|
||||||
createProjectSubFile(
|
configureByFiles()
|
||||||
"settings.gradle",
|
|
||||||
"include ':common-lib1', ':common-lib2', ':jvm-lib1', ':jvm-lib2', ':jvm-app'"
|
|
||||||
)
|
|
||||||
|
|
||||||
val kotlinVersion = "1.1.0"
|
|
||||||
|
|
||||||
createProjectSubFile(
|
|
||||||
"build.gradle", """
|
|
||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('common-lib1') {
|
|
||||||
apply plugin: 'kotlin-platform-common'
|
|
||||||
}
|
|
||||||
|
|
||||||
project('common-lib2') {
|
|
||||||
apply plugin: 'kotlin-platform-common'
|
|
||||||
}
|
|
||||||
|
|
||||||
project('jvm-lib1') {
|
|
||||||
apply plugin: 'kotlin-platform-jvm'
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implement project(':common-lib1')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('jvm-lib2') {
|
|
||||||
apply plugin: 'kotlin-platform-jvm'
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implement project(':common-lib2')
|
|
||||||
compile project(':jvm-lib1')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('jvm-app') {
|
|
||||||
apply plugin: 'kotlin-platform-jvm'
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compile project(':jvm-lib2')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
|
|
||||||
importProject()
|
importProject()
|
||||||
|
|
||||||
assertModuleModuleDepScope("jvm-app_main", "jvm-lib2_main", DependencyScope.COMPILE)
|
assertModuleModuleDepScope("jvm-app_main", "jvm-lib2_main", DependencyScope.COMPILE)
|
||||||
@@ -431,69 +142,7 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testTransitiveImplement() {
|
fun testTransitiveImplement() {
|
||||||
createProjectSubFile(
|
configureByFiles()
|
||||||
"settings.gradle",
|
|
||||||
"include ':project1', ':project2', ':project3'"
|
|
||||||
)
|
|
||||||
|
|
||||||
val kotlinVersion = "1.1.51"
|
|
||||||
|
|
||||||
createProjectSubFile(
|
|
||||||
"build.gradle", """
|
|
||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('project1') {
|
|
||||||
apply plugin: 'kotlin-platform-common'
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
custom
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('project2') {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'kotlin-platform-jvm'
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
custom
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implement project(':project1')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('project3') {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'kotlin-platform-jvm'
|
|
||||||
apply plugin: 'kotlin'
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
custom
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compile project(':project2')
|
|
||||||
customCompile project(':project2')
|
|
||||||
testCompile(project(':project2').sourceSets.test.output)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
|
|
||||||
val isResolveModulePerSourceSet = getCurrentExternalProjectSettings().isResolveModulePerSourceSet
|
val isResolveModulePerSourceSet = getCurrentExternalProjectSettings().isResolveModulePerSourceSet
|
||||||
|
|
||||||
@@ -536,74 +185,7 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testTransitiveImplementWithNonDefaultConfig() {
|
fun testTransitiveImplementWithNonDefaultConfig() {
|
||||||
createProjectSubFile(
|
configureByFiles()
|
||||||
"settings.gradle",
|
|
||||||
"include ':project1', ':project2', ':project3'"
|
|
||||||
)
|
|
||||||
|
|
||||||
val kotlinVersion = "1.2.31"
|
|
||||||
|
|
||||||
createProjectSubFile(
|
|
||||||
"build.gradle", """
|
|
||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('project1') {
|
|
||||||
apply plugin: 'kotlin-platform-common'
|
|
||||||
}
|
|
||||||
|
|
||||||
project('project2') {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'kotlin-platform-jvm'
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
main
|
|
||||||
main2
|
|
||||||
}
|
|
||||||
|
|
||||||
task myJar(type: Jar) {
|
|
||||||
baseName = 'project2-jar'
|
|
||||||
from sourceSets.main.output
|
|
||||||
from sourceSets.main2.output
|
|
||||||
}
|
|
||||||
|
|
||||||
configurations {
|
|
||||||
myConfig
|
|
||||||
}
|
|
||||||
|
|
||||||
artifacts {
|
|
||||||
myConfig myJar
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implement project(':project1')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('project3') {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'kotlin-platform-jvm'
|
|
||||||
apply plugin: 'kotlin'
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compile(project(path: ':project2', configuration: 'myConfig')) { transitive = false }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
|
|
||||||
val isResolveModulePerSourceSet = getCurrentExternalProjectSettings().isResolveModulePerSourceSet
|
val isResolveModulePerSourceSet = getCurrentExternalProjectSettings().isResolveModulePerSourceSet
|
||||||
|
|
||||||
@@ -642,84 +224,8 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testTransitiveImplementWithAndroid() {
|
fun testTransitiveImplementWithAndroid() {
|
||||||
createProjectSubFile(
|
configureByFiles()
|
||||||
"settings.gradle",
|
|
||||||
"include ':project1', ':project2', ':project3'"
|
|
||||||
)
|
|
||||||
|
|
||||||
val kotlinVersion = "1.1.51"
|
|
||||||
|
|
||||||
createProjectSubFile(
|
|
||||||
"build.gradle", """
|
|
||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
jcenter()
|
|
||||||
maven { url 'https://maven.google.com' }
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
|
|
||||||
classpath 'com.android.tools.build:gradle:2.3.3'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('project1') {
|
|
||||||
apply plugin: 'kotlin-platform-common'
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
custom
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('project2') {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'kotlin-platform-jvm'
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
custom
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implement project(':project1')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('project3') {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'com.android.application'
|
|
||||||
apply plugin: 'kotlin-android'
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
custom
|
|
||||||
}
|
|
||||||
|
|
||||||
android {
|
|
||||||
compileSdkVersion 26
|
|
||||||
buildToolsVersion "23.0.1"
|
|
||||||
defaultConfig {
|
|
||||||
applicationId "org.jetbrains.kotlin"
|
|
||||||
minSdkVersion 18
|
|
||||||
targetSdkVersion 26
|
|
||||||
versionCode 1
|
|
||||||
versionName "1.0"
|
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compile project(':project2')
|
|
||||||
customCompile project(':project2')
|
|
||||||
testCompile(project(':project2').sourceSets.test.output)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
createProjectSubFile(
|
createProjectSubFile(
|
||||||
"local.properties", """
|
"local.properties", """
|
||||||
sdk.dir=/${KotlinTestUtils.getAndroidSdkSystemIndependentPath()}
|
sdk.dir=/${KotlinTestUtils.getAndroidSdkSystemIndependentPath()}
|
||||||
@@ -748,65 +254,8 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun simpleAndroidAppWithCommonModule() {
|
fun simpleAndroidAppWithCommonModule() {
|
||||||
createProjectSubFile(
|
configureByFiles()
|
||||||
"settings.gradle",
|
|
||||||
"include ':app', ':jvm', ':cmn'"
|
|
||||||
)
|
|
||||||
|
|
||||||
val kotlinVersion = "1.2.41"
|
|
||||||
|
|
||||||
createProjectSubFile(
|
|
||||||
"build.gradle", """
|
|
||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
jcenter()
|
|
||||||
maven { url 'https://maven.google.com' }
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
|
|
||||||
classpath 'com.android.tools.build:gradle:2.3.3'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('cmn') {
|
|
||||||
apply plugin: 'kotlin-platform-common'
|
|
||||||
}
|
|
||||||
|
|
||||||
project('jvm') {
|
|
||||||
apply plugin: 'kotlin-platform-jvm'
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
expectedBy project(":cmn")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('app') {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'com.android.application'
|
|
||||||
apply plugin: 'kotlin-android'
|
|
||||||
|
|
||||||
android {
|
|
||||||
compileSdkVersion 26
|
|
||||||
buildToolsVersion "23.0.1"
|
|
||||||
defaultConfig {
|
|
||||||
applicationId "org.jetbrains.kotlin"
|
|
||||||
minSdkVersion 18
|
|
||||||
targetSdkVersion 26
|
|
||||||
versionCode 1
|
|
||||||
versionName "1.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compile project(":jvm")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
createProjectSubFile(
|
createProjectSubFile(
|
||||||
"local.properties", """
|
"local.properties", """
|
||||||
sdk.dir=/${KotlinTestUtils.getAndroidSdkSystemIndependentPath()}
|
sdk.dir=/${KotlinTestUtils.getAndroidSdkSystemIndependentPath()}
|
||||||
@@ -833,44 +282,7 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testJsTestOutputFile() {
|
fun testJsTestOutputFile() {
|
||||||
createProjectSubFile(
|
configureByFiles()
|
||||||
"settings.gradle",
|
|
||||||
"include ':project1', ':project2', ':project3'"
|
|
||||||
)
|
|
||||||
|
|
||||||
val kotlinVersion = "1.1.51"
|
|
||||||
|
|
||||||
createProjectSubFile(
|
|
||||||
"build.gradle", """
|
|
||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
jcenter()
|
|
||||||
maven { url 'https://maven.google.com' }
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
|
|
||||||
classpath 'com.android.tools.build:gradle:2.3.3'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('project1') {
|
|
||||||
apply plugin: 'kotlin-platform-common'
|
|
||||||
}
|
|
||||||
|
|
||||||
project('project2') {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'kotlin-platform-js'
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implement project(':project1')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
|
|
||||||
importProject()
|
importProject()
|
||||||
|
|
||||||
@@ -886,45 +298,7 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testJsProductionOutputFile() {
|
fun testJsProductionOutputFile() {
|
||||||
createProjectSubFile(
|
configureByFiles()
|
||||||
"settings.gradle",
|
|
||||||
"include ':project1', ':project2', ':project3'"
|
|
||||||
)
|
|
||||||
|
|
||||||
val kotlinVersion = "1.1.51"
|
|
||||||
|
|
||||||
createProjectSubFile(
|
|
||||||
"build.gradle", """
|
|
||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
jcenter()
|
|
||||||
maven { url 'https://maven.google.com' }
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
|
|
||||||
classpath 'com.android.tools.build:gradle:2.3.3'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('project1') {
|
|
||||||
apply plugin: 'kotlin-platform-common'
|
|
||||||
}
|
|
||||||
|
|
||||||
project('project2') {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'kotlin-platform-js'
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implement project(':project1')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
|
|
||||||
importProject()
|
importProject()
|
||||||
|
|
||||||
TestCase.assertEquals(
|
TestCase.assertEquals(
|
||||||
@@ -939,70 +313,7 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testJsTestOutputFileInProjectWithAndroid() {
|
fun testJsTestOutputFileInProjectWithAndroid() {
|
||||||
createProjectSubFile(
|
configureByFiles()
|
||||||
"settings.gradle",
|
|
||||||
"include ':project1', ':project2', ':project3'"
|
|
||||||
)
|
|
||||||
|
|
||||||
val kotlinVersion = "1.1.51"
|
|
||||||
|
|
||||||
createProjectSubFile(
|
|
||||||
"build.gradle", """
|
|
||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
jcenter()
|
|
||||||
maven { url 'https://maven.google.com' }
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
|
|
||||||
classpath 'com.android.tools.build:gradle:2.3.3'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('project1') {
|
|
||||||
apply plugin: 'kotlin-platform-common'
|
|
||||||
}
|
|
||||||
|
|
||||||
project('project2') {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'kotlin-platform-js'
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implement project(':project1')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project('project3') {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'com.android.application'
|
|
||||||
apply plugin: 'kotlin-android'
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
custom
|
|
||||||
}
|
|
||||||
|
|
||||||
android {
|
|
||||||
compileSdkVersion 26
|
|
||||||
buildToolsVersion "23.0.1"
|
|
||||||
defaultConfig {
|
|
||||||
applicationId "org.jetbrains.kotlin"
|
|
||||||
minSdkVersion 18
|
|
||||||
targetSdkVersion 26
|
|
||||||
versionCode 1
|
|
||||||
versionName "1.0"
|
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
createProjectSubFile(
|
createProjectSubFile(
|
||||||
"local.properties", """
|
"local.properties", """
|
||||||
sdk.dir=/${KotlinTestUtils.getAndroidSdkSystemIndependentPath()}
|
sdk.dir=/${KotlinTestUtils.getAndroidSdkSystemIndependentPath()}
|
||||||
@@ -1016,4 +327,8 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
|
|||||||
PathUtil.toSystemIndependentName(KotlinFacet.get(getModule("project2"))!!.configuration.settings.testOutputPath)
|
PathUtil.toSystemIndependentName(KotlinFacet.get(getModule("project2"))!!.configuration.settings.testOutputPath)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun testDataDirName(): String {
|
||||||
|
return "multiplatform"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.0")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('common-lib1') {
|
||||||
|
apply plugin: 'kotlin-platform-common'
|
||||||
|
}
|
||||||
|
|
||||||
|
project('common-lib2') {
|
||||||
|
apply plugin: 'kotlin-platform-common'
|
||||||
|
}
|
||||||
|
|
||||||
|
project('jvm-lib1') {
|
||||||
|
apply plugin: 'kotlin-platform-jvm'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implement project(':common-lib1')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('jvm-lib2') {
|
||||||
|
apply plugin: 'kotlin-platform-jvm'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implement project(':common-lib2')
|
||||||
|
compile project(':jvm-lib1')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('jvm-app') {
|
||||||
|
apply plugin: 'kotlin-platform-jvm'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile project(':jvm-lib2')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
include ':common-lib1', ':common-lib2', ':jvm-lib1', ':jvm-lib2', ':jvm-app'
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
maven { url 'https://maven.google.com' }
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.51")
|
||||||
|
classpath 'com.android.tools.build:gradle:2.3.3'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('project1') {
|
||||||
|
apply plugin: 'kotlin-platform-common'
|
||||||
|
}
|
||||||
|
|
||||||
|
project('project2') {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'kotlin-platform-js'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implement project(':project1')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
include ':project1', ':project2', ':project3'
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
maven { url 'https://maven.google.com' }
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.51")
|
||||||
|
classpath 'com.android.tools.build:gradle:2.3.3'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('project1') {
|
||||||
|
apply plugin: 'kotlin-platform-common'
|
||||||
|
}
|
||||||
|
|
||||||
|
project('project2') {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'kotlin-platform-js'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implement project(':project1')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
include ':project1', ':project2', ':project3'
|
||||||
+54
@@ -0,0 +1,54 @@
|
|||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
maven { url 'https://maven.google.com' }
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.51")
|
||||||
|
classpath 'com.android.tools.build:gradle:2.3.3'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('project1') {
|
||||||
|
apply plugin: 'kotlin-platform-common'
|
||||||
|
}
|
||||||
|
|
||||||
|
project('project2') {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'kotlin-platform-js'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implement project(':project1')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('project3') {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'com.android.application'
|
||||||
|
apply plugin: 'kotlin-android'
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
custom
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdkVersion 26
|
||||||
|
buildToolsVersion "23.0.1"
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "org.jetbrains.kotlin"
|
||||||
|
minSdkVersion 18
|
||||||
|
targetSdkVersion 26
|
||||||
|
versionCode 1
|
||||||
|
versionName "1.0"
|
||||||
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
include ':project1', ':project2', ':project3'
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.0")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('common-lib') {
|
||||||
|
apply plugin: 'kotlin-platform-common'
|
||||||
|
}
|
||||||
|
|
||||||
|
project('jvm-lib') {
|
||||||
|
apply plugin: 'kotlin-platform-jvm'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implement project(':common-lib')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('js-lib') {
|
||||||
|
apply plugin: 'kotlin-platform-js'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implement project(':common-lib')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('common-app') {
|
||||||
|
apply plugin: 'kotlin-platform-common'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile project(':common-lib')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('jvm-app') {
|
||||||
|
apply plugin: 'kotlin-platform-jvm'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implement project(':common-app')
|
||||||
|
compile project(':jvm-lib')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('js-app') {
|
||||||
|
apply plugin: 'kotlin-platform-js'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implement project(':common-app')
|
||||||
|
compile project(':js-lib')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
include ':common-lib', ':jvm-lib', ':js-lib', ':common-app', ':jvm-app', ':js-app'
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.0")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('common') {
|
||||||
|
apply plugin: 'kotlin-platform-common'
|
||||||
|
}
|
||||||
|
|
||||||
|
project('jvm') {
|
||||||
|
apply plugin: 'kotlin-platform-jvm'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implement project(':common')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('js') {
|
||||||
|
apply plugin: 'kotlin-platform-js'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implement project(':common')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Vendored
@@ -0,0 +1 @@
|
|||||||
|
include ':common', ':jvm', ':js'
|
||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.0")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'kotlin-platform-common'
|
||||||
|
|
||||||
|
project('jvm') {
|
||||||
|
apply plugin: 'kotlin-platform-jvm'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implement project(':')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('js') {
|
||||||
|
apply plugin: 'kotlin-platform-js'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implement project(':')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
+2
@@ -0,0 +1,2 @@
|
|||||||
|
rootProject.name = 'foo'
|
||||||
|
include ':jvm', ':js'
|
||||||
+36
@@ -0,0 +1,36 @@
|
|||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
maven { url 'http://dl.bintray.com/kotlin/kotlin-dev' }
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.40-dev-610")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('common1') {
|
||||||
|
apply plugin: 'kotlin-platform-common'
|
||||||
|
}
|
||||||
|
|
||||||
|
project('common2') {
|
||||||
|
apply plugin: 'kotlin-platform-common'
|
||||||
|
}
|
||||||
|
|
||||||
|
project('jvm') {
|
||||||
|
apply plugin: 'kotlin-platform-jvm'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
expectedBy project(':common1')
|
||||||
|
expectedBy project(':common2')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('js') {
|
||||||
|
apply plugin: 'kotlin-platform-js'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
expectedBy project(':common1')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
include ':common1', ':common2', ':jvm', ':js'
|
||||||
Vendored
+12
@@ -0,0 +1,12 @@
|
|||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
maven { url 'http://dl.bintray.com/kotlin/kotlin-dev' }
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.0-beta-74")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'kotlin'
|
||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
includeBuild('toInclude')
|
||||||
+32
@@ -0,0 +1,32 @@
|
|||||||
|
|
||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
maven { url 'http://dl.bintray.com/kotlin/kotlin-dev' }
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.0-beta-74")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('common') {
|
||||||
|
apply plugin: 'kotlin-platform-common'
|
||||||
|
}
|
||||||
|
|
||||||
|
project('jvm') {
|
||||||
|
apply plugin: 'kotlin-platform-jvm'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
expectedBy project(':common')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('js') {
|
||||||
|
apply plugin: 'kotlin-platform-js'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
expectedBy project(':common')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
include ':common', ':jvm', ':js'
|
||||||
+49
@@ -0,0 +1,49 @@
|
|||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
maven { url 'https://maven.google.com' }
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.41")
|
||||||
|
classpath 'com.android.tools.build:gradle:2.3.3'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('cmn') {
|
||||||
|
apply plugin: 'kotlin-platform-common'
|
||||||
|
}
|
||||||
|
|
||||||
|
project('jvm') {
|
||||||
|
apply plugin: 'kotlin-platform-jvm'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
expectedBy project(":cmn")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('app') {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'com.android.application'
|
||||||
|
apply plugin: 'kotlin-android'
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdkVersion 26
|
||||||
|
buildToolsVersion "23.0.1"
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "org.jetbrains.kotlin"
|
||||||
|
minSdkVersion 18
|
||||||
|
targetSdkVersion 26
|
||||||
|
versionCode 1
|
||||||
|
versionName "1.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile project(":jvm")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
include ':app', ':jvm', ':cmn'
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.51")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('project1') {
|
||||||
|
apply plugin: 'kotlin-platform-common'
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
custom
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('project2') {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'kotlin-platform-jvm'
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
custom
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implement project(':project1')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('project3') {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'kotlin-platform-jvm'
|
||||||
|
apply plugin: 'kotlin'
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
custom
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile project(':project2')
|
||||||
|
customCompile project(':project2')
|
||||||
|
testCompile(project(':project2').sourceSets.test.output)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
include ':project1', ':project2', ':project3'
|
||||||
+68
@@ -0,0 +1,68 @@
|
|||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
maven { url 'https://maven.google.com' }
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.51")
|
||||||
|
classpath 'com.android.tools.build:gradle:2.3.3'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('project1') {
|
||||||
|
apply plugin: 'kotlin-platform-common'
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
custom
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('project2') {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'kotlin-platform-jvm'
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
custom
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implement project(':project1')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('project3') {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'com.android.application'
|
||||||
|
apply plugin: 'kotlin-android'
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
custom
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdkVersion 26
|
||||||
|
buildToolsVersion "23.0.1"
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "org.jetbrains.kotlin"
|
||||||
|
minSdkVersion 18
|
||||||
|
targetSdkVersion 26
|
||||||
|
versionCode 1
|
||||||
|
versionName "1.0"
|
||||||
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile project(':project2')
|
||||||
|
customCompile project(':project2')
|
||||||
|
testCompile(project(':project2').sourceSets.test.output)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
include ':project1', ':project2', ':project3'
|
||||||
+58
@@ -0,0 +1,58 @@
|
|||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.31")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('project1') {
|
||||||
|
apply plugin: 'kotlin-platform-common'
|
||||||
|
}
|
||||||
|
|
||||||
|
project('project2') {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'kotlin-platform-jvm'
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
main
|
||||||
|
main2
|
||||||
|
}
|
||||||
|
|
||||||
|
task myJar(type: Jar) {
|
||||||
|
baseName = 'project2-jar'
|
||||||
|
from sourceSets.main.output
|
||||||
|
from sourceSets.main2.output
|
||||||
|
}
|
||||||
|
|
||||||
|
configurations {
|
||||||
|
myConfig
|
||||||
|
}
|
||||||
|
|
||||||
|
artifacts {
|
||||||
|
myConfig myJar
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implement project(':project1')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
project('project3') {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'kotlin-platform-jvm'
|
||||||
|
apply plugin: 'kotlin'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile(project(path: ':project2', configuration: 'myConfig')) { transitive = false }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
include ':project1', ':project2', ':project3'
|
||||||
Reference in New Issue
Block a user