hmole
10/11/2018, 3:46 PMLiliia
10/11/2018, 4:14 PMhmole
10/11/2018, 6:36 PMLiliia
10/12/2018, 9:22 AMAdependency on a multiplatform library is used. Replace it with aproject('...')
dependency. Use the appropriate target’s runtime elements configuration, such asproject(path: '...', configuration: '...')
. Due to the current limitations, this dependency should be placed in a top-level `dependencies { ... } `block rather than in a source set’s dependencies.jvm6RuntimeElements
In both of the cases above, another solution is to mark the targets with a custom attribute. This, however, must be done on both the library author and the consumer sides, and it’s the library author’s responsibility to communicate the attribute and its values to the consumers;There is also an example of the latter case, you may take a look at how the dependency is specified for such case here: https://github.com/h0tk3y/k-new-mpp-samples/tree/master/multiple-targets-same-platform
hmole
10/12/2018, 11:32 AMjvmImplementation
)
apply plugin: 'kotlin-multiplatform'
kotlin {
targets {
fromPreset(presets.android, 'android')
}
sourceSets {
commonMain {
dependencies {
implementation project(":lib")
}
}
}
}
dependencies {
project(path: ':lib', configuration: 'jvmImplementation')
project(path: ':lib', configuration: 'androidDebugImplementation')
}
Liliia
10/12/2018, 12:59 PMactual
parts) of the same class and those will obviously clash with each other.
// also, it’s explicitly written in the Gradle documentation for plugins that implementation
configuration isn’t consumable: https://docs.gradle.org/current/userguide/java_library_plugin.html#sec:java_library_configurations_graphhmole
10/12/2018, 2:40 PMLiliia
10/12/2018, 3:33 PM