gildor
03/26/2018, 8:22 AMkotlin-platform-jvm
instead of kotlin
in Gradle?yusuf3000
03/26/2018, 8:23 AMyusuf3000
03/26/2018, 8:24 AMapply plugin: 'kotlin-platform-jvm'
repositories {
jcenter()
maven { url "<http://kotlin.bintray.com/kotlinx>" }
}
sourceSets {
main.kotlin.srcDirs += 'main/'
test.kotlin.srcDirs += 'test/'
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
expectedBy project(":booking:framework")
testCompile "junit:junit:4.12"
testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
}
gildor
03/26/2018, 8:24 AMactual
declaration should be enoughgildor
03/26/2018, 8:24 AMyusuf3000
03/26/2018, 8:26 AMexpect class Platform(
url: String
) {
fun get():String
}
yusuf3000
03/26/2018, 8:26 AMactual class Platform actual constructor(
private val url: String
) {
actual fun get():String {
return "KN-Android $url"
}
}
yusuf3000
03/26/2018, 8:27 AMyusuf3000
03/26/2018, 8:28 AMExpected class Platform has no actual declaration in module
yusuf3000
03/26/2018, 8:28 AMActual class 'Platform' has no corresponding expected declaration
gildor
03/26/2018, 8:30 AMyusuf3000
03/26/2018, 8:31 AMgildor
03/26/2018, 8:36 AMactual class Platform(url: String) {
actual fun get():String {
return "test"
}
}
yusuf3000
03/26/2018, 8:37 AMgildor
03/26/2018, 8:38 AMyusuf3000
03/26/2018, 8:43 AMgildor
03/26/2018, 8:44 AMyusuf3000
03/26/2018, 8:50 AMgildor
03/26/2018, 8:52 AMgildor
03/26/2018, 8:52 AMgaetan
03/26/2018, 8:52 AMyusuf3000
03/26/2018, 8:53 AMyusuf3000
03/26/2018, 8:54 AMgildor
03/26/2018, 8:55 AMilya.gorbunov
03/26/2018, 10:44 AMalbertgao
03/27/2018, 9:18 PMmain
of expect common
module is located in ./common/main/
, while the main
of actual platform
module resides in ./src/main/java
. The building won’t work? Even I set the sourceSets
in build.gradle
? These relative path of the 2 need to match even in the different project?ilya.gorbunov
03/27/2018, 10:20 PM