Rewrite MultiplatformProjectImportingTest to use testData directory

This commit is contained in:
Natalia Selezneva
2018-08-10 09:39:41 +03:00
parent d20b58ce61
commit 97f1fc1f54
32 changed files with 608 additions and 703 deletions
@@ -52,47 +52,7 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
@Test
fun testPlatformToCommonDependency() {
createProjectSubFile("settings.gradle", "include ':common', ':jvm', ':js'")
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')
}
}
"""
)
val files = configureByFiles()
importProject()
assertModuleModuleDepScope("jvm_main", "common_main", DependencyScope.COMPILE)
@@ -105,56 +65,14 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
assertProductionOnTestDependency("js_main", "common_main", false)
assertProductionOnTestDependency("js_test", "common_test", true)
val commonTestFile = files.find { it.path.contains("common") }!!
assertFileInModuleScope(commonTestFile, "jvm_test")
assertFileInModuleScope(commonTestFile, "js_test")
}
@Test
fun testPlatformToCommonExpectedByDependency() {
createProjectSubFile("settings.gradle", "include ':common1', ':common2', ':jvm', ':js'")
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')
}
}
"""
)
configureByFiles()
importProject()
assertModuleModuleDepScope("jvm_main", "common1_main", DependencyScope.COMPILE)
assertModuleModuleDepScope("jvm_main", "common2_main", DependencyScope.COMPILE)
@@ -168,63 +86,7 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
@Test
fun testPlatformToCommonExpectedByDependencyInComposite() {
createProjectSubFile("toInclude/settings.gradle", "include ':common', ':jvm', ':js'")
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()
)
configureByFiles()
importProject()
TestCase.assertEquals(listOf("common_main"), facetSettings("jvm_main").implementedModuleNames)
@@ -240,42 +102,7 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
@Test
fun testPlatformToCommonDependencyRoot() {
createProjectSubFile("settings.gradle", "rootProject.name = 'foo'\ninclude ':jvm', ':js'")
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(':')
}
}
"""
)
configureByFiles()
importProject()
assertModuleModuleDepScope("jvm_main", "foo_main", DependencyScope.COMPILE)
assertModuleModuleDepScope("jvm_test", "foo_test", DependencyScope.COMPILE)
@@ -285,70 +112,7 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
@Test
fun testMultiProject() {
createProjectSubFile("settings.gradle", "include ':common-lib', ':jvm-lib', ':js-lib', ':common-app', ':jvm-app', ':js-app'")
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')
}
}
"""
)
configureByFiles()
importProject()
assertModuleModuleDepScope("jvm-app_main", "common-app_main", DependencyScope.COMPILE)
@@ -362,60 +126,7 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
@Test
fun testDependenciesReachableViaImpl() {
createProjectSubFile(
"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')
}
}
"""
)
configureByFiles()
importProject()
assertModuleModuleDepScope("jvm-app_main", "jvm-lib2_main", DependencyScope.COMPILE)
@@ -431,69 +142,7 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
@Test
fun testTransitiveImplement() {
createProjectSubFile(
"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)
}
}
"""
)
configureByFiles()
val isResolveModulePerSourceSet = getCurrentExternalProjectSettings().isResolveModulePerSourceSet
@@ -536,74 +185,7 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
@Test
fun testTransitiveImplementWithNonDefaultConfig() {
createProjectSubFile(
"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 }
}
}
"""
)
configureByFiles()
val isResolveModulePerSourceSet = getCurrentExternalProjectSettings().isResolveModulePerSourceSet
@@ -642,84 +224,8 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
@Test
fun testTransitiveImplementWithAndroid() {
createProjectSubFile(
"settings.gradle",
"include ':project1', ':project2', ':project3'"
)
configureByFiles()
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(
"local.properties", """
sdk.dir=/${KotlinTestUtils.getAndroidSdkSystemIndependentPath()}
@@ -748,65 +254,8 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
@Test
fun simpleAndroidAppWithCommonModule() {
createProjectSubFile(
"settings.gradle",
"include ':app', ':jvm', ':cmn'"
)
configureByFiles()
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(
"local.properties", """
sdk.dir=/${KotlinTestUtils.getAndroidSdkSystemIndependentPath()}
@@ -833,44 +282,7 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
@Test
fun testJsTestOutputFile() {
createProjectSubFile(
"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')
}
}
"""
)
configureByFiles()
importProject()
@@ -886,45 +298,7 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
@Test
fun testJsProductionOutputFile() {
createProjectSubFile(
"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')
}
}
"""
)
configureByFiles()
importProject()
TestCase.assertEquals(
@@ -939,70 +313,7 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
@Test
fun testJsTestOutputFileInProjectWithAndroid() {
createProjectSubFile(
"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"
}
}
}
"""
)
configureByFiles()
createProjectSubFile(
"local.properties", """
sdk.dir=/${KotlinTestUtils.getAndroidSdkSystemIndependentPath()}
@@ -1016,4 +327,8 @@ class MultiplatformProjectImportingTest : GradleImportingTestCase() {
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')
}
}
@@ -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'
@@ -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"
}
}
}
@@ -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')
}
}
@@ -0,0 +1 @@
include ':common', ':jvm', ':js'
@@ -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(':')
}
}
@@ -0,0 +1,2 @@
rootProject.name = 'foo'
include ':jvm', ':js'
@@ -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')
}
}
@@ -0,0 +1 @@
include ':common1', ':common2', ':jvm', ':js'
@@ -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'
@@ -0,0 +1 @@
includeBuild('toInclude')
@@ -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')
}
}
@@ -0,0 +1 @@
include ':common', ':jvm', ':js'
@@ -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")
}
}
@@ -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'
@@ -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)
}
}
@@ -0,0 +1 @@
include ':project1', ':project2', ':project3'
@@ -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 }
}
}
@@ -0,0 +1 @@
include ':project1', ':project2', ':project3'