• a

    addamsson

    3 years ago
    How do I make project dependencies transitive when using the
    kotlin-multiplatform
    plugin? My understanding was that I should use
    api
    in my
    build.gradle
    like this:
    jvmMain {
                dependencies {
                    api 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
                    api libraries.kotlin_reflect
                    api libraries.caffeine
                    api libraries.snakeyaml
                    api libraries.slf4j_api
                    api libraries.slf4j_simple
                    api libraries.trie_map
                }
            }
    But when I reference this multiplatform project in another project in my multi-project build:
    dependencies {
        compile project(":zircon.core")
    
        compile libraries.kotlin_stdlib
        compile libraries.filters
    
        testCompile libraries.junit
        testCompile libraries.mockito
        testCompile libraries.assertj
    }
    and publish this to a repository, when I add my project as dependency:
    dependencies {
        compile "org.hexworks.zircon:zircon.jvm.swing:$version"
    }
    only the contents of the
    org.hexworks.zircon:zircon.jvm.swing
    are added to the classpath and I can't see stuff from
    zircon.core
    . What could be the problem?
    a
    Jurriaan Mous
    3 replies
    Copy to Clipboard
  • n

    Nikolai

    3 years ago
    Hi, everyone Another simple question, I guess. I am trying to solve it, but can’t understand what I am doing wrong. I am using IDEA, selecting : new project - kotlin- mobile android/ios. And get the default project. After that I want to import ktor (to implement client-server connection). I added :
    maven { url "<https://dl.bintray.com/kotlin/ktor/>" }
    to repositories list. Then I went through all sourceSets and add:
    implementation "io.ktor:ktor-client-core:1.0.0-beta-3"
    - for common module
    implementation "io.ktor:ktor-client-android:1.0.0-beta-3"
    - android
    implementation "io.ktor:ktor-client-core-ios:1.0.0-beta-3"
    - ios run “assemble” task of the gradle, everything ok. After that I add some simple code to common module:
    private val client = io.ktor.client.HttpClient()
    (btw I didn’t get any autocomplete or suggestions from IDE, but at least after I entered whole line it was ok). After that I tried to run “assemble” again, but got an error :
    n
    z
    2 replies
    Copy to Clipboard
  • n

    Nikolai

    3 years ago
    Looks like am doing something wrong and iOS module didn’t recognize ktor, even after I added needed dependency. (here is my project in github, I messed up with gitignore, but still it’s not so big : https://github.com/nbaklanov-issart/ktorTry) Do I missing something? Do I need to add or set something else?
    n
    orangy
    +1
    4 replies
    Copy to Clipboard
  • s

    Sabrina Namur

    3 years ago
    Hi, i want to add unit test to my multiplatform project. I'm using the new stucture with Mobile iOS/android. Is it possible to write unit tests in commonTest module? If so how do I do that?
    s
    Jurriaan Mous
    9 replies
    Copy to Clipboard
  • s

    Slackbot

    3 years ago
    This message was deleted.
    s
    russhwolf
    +2
    7 replies
    Copy to Clipboard
  • n

    Nikolai

    3 years ago
    Hello, everyone Did someone tried to use ktor JsonFeature in multiplatform project? Is it available for mp projects? I have following code in common module :
    private val client = io.ktor.client.HttpClient() {
            install(JsonFeature) {
                serializer = io.ktor.client.features.json.defaultSerializer()
            }
            expectSuccess = false
        }
    And during asseble compileKotlinIos fails with : error: unresolved reference: JsonFeature. Do I need to add additional dependency in iOS module, or this feature is not for multiplatform? P.S. I tried to search something like : io.ktor:ktor-client-ios-json but no luck.
    n
    gildor
    +3
    10 replies
    Copy to Clipboard
  • kpgalligan

    kpgalligan

    3 years ago
    I've been using gradle-bintray-plugin:1.8.2-SNAPSHOT from https://dl.bintray.com/jetbrains/kotlin-native-dependencies to publish multiplatform and native artifacts with metadata. This works for 4.7, but updating to 4.10 blows up the 1.8.2-SNAPSHOT. Using bintray's 1.8.4 doesn't seem to understand modules and metadata. Anybody poking around this stuff and have solutions?
    kpgalligan
    russhwolf
    7 replies
    Copy to Clipboard
  • a

    addamsson

    3 years ago
    it works out of the box
    a
    kpgalligan
    +1
    14 replies
    Copy to Clipboard
  • p

    patjackson52

    3 years ago
    Anyone know of a MPP with JS tests in the shared module? I know to add the actual tests, but unclear on how to set up to run them
    p
    s
    2 replies
    Copy to Clipboard
  • a

    addamsson

    3 years ago
    Do you plan to add a cross-platform assertion library?
    a
    joseph_ivie
    +1
    4 replies
    Copy to Clipboard