• Hannes

    Hannes

    2 years ago
    Hey folks, I'm struggeling a bit with kotlin mutliplatform and
    commonTest
    . In my
    build.gradle
    i have the following config:
    kotlin {
      ... 
      sourceSets {
         ...
           commonTest {
                dependencies {
                    implementation 'org.jetbrains.kotlin:kotlin-test-common'
                    implementation 'org.jetbrains.kotlin:kotlin-test-annotations-common'
                }
            }
       }
    }
    However, if I run a test in
    src/commonTest/kotlin/my/package/FooTest.kt
    which looks like this
    import kotlin.test.Test
    import kotlin.test.assertEquals
    
    class FooTest {
        @Test
        fun filterState(){
            assertEquals(1, 2)
        }
    }
    I get
    Unresolved reference: Test
    e: ... /src/commonTest/kotlin/my/package/FooTest.kt: (3, 20): Unresolved reference: Test
    e: ... /src/commonTest/kotlin/my/package/FooTest.kt: (4, 20): Unresolved reference: assertEquals
    Any idea what I have misconfigured?
    Hannes
    grandstaish
    +1
    20 replies
    Copy to Clipboard
  • r

    René

    2 years ago
    Hey guys, I observed for at least 6 month a strange behavior which I cannot fix. When I compile my mpp project from the cli it works fine, as expected. When I run the same gradle task from intellij I get tons of "Actual class foo has not corespondending expected declaration". If someone has some time to check it here is my repo: https://github.com/rewe-digital-incubator/Konversation/tree/feature/provisioning (that feature branch should have also all the latest versions of the dependencies) tbh I didn't care yet for this bug since I was able to compile my project, but this breaks debugging and running tests which is very annoying
    r
    Dominaezzz
    4 replies
    Copy to Clipboard
  • Nick Halase

    Nick Halase

    2 years ago
    What should I set
    core.symlinks
    to for my project if I have symbolic linked iosX86 and iosArm to a common directory? I assume I want
    false
    to maintain compatibility with Windows collaborators?
    Nick Halase
    1 replies
    Copy to Clipboard
  • Brendan Weinstein

    Brendan Weinstein

    2 years ago
    Just trying out appcode for the first time and it is cool that it generates a .swift version of the generated objectivec. When I rebuild the framework this .swift file does not get regenerated. Is there anything I can do to regenerate the .swift file. I discovered it by cmd+b'ing into the generated objc classes.
    Brendan Weinstein
    dambakk
    3 replies
    Copy to Clipboard
  • a

    addamsson

    2 years ago
    Hi guys! Is there something like a
    WeakReference
    in Kotlin MPP? I have a custom
    EventBus
    implementation which returns
    Subscription
    objects whenever the user subscribes to an event. My problem is that it is easy to forget to call
    Subscription.unsubscribe
    and there can be memory leaks when the subscriber drops the reference to the
    Subscription
    but the
    EventBus
    retains it forever. Is there a best practice for this scenario in the context of MPP?
    a
    spierce7
    14 replies
    Copy to Clipboard
  • Brendan Weinstein

    Brendan Weinstein

    2 years ago
    One selling point for winning over product managers on multiplatform is a far higher probability of consistent analytic events cross platform. Imagine a ViewController/Activity that has a
    fun render(state: ViewState)
    and observes
    ViewState
    's emitted by a StateMachine. The StateMachine is shared in the common module. If the analytics events are fired in the StateMachine, then the developer who implements the View would have to avoid using the shared StateMachine or use it in a way that breaks functionality in order to make analytics events inconsistent, which is a loose coupling and better than no coupling.
    Brendan Weinstein
    1 replies
    Copy to Clipboard
  • v

    vanniktech

    2 years ago
    Has anyone tried out getting a websocket working on iOS? Seems like ktor does not support it directly, but one could use their
    Engine
    API to bake Starscream or any other third party library into it
    v
    fcosta
    6 replies
    Copy to Clipboard
  • Joey

    Joey

    2 years ago
    Hi guys, our company uses bitbucket. Is it possible to upload a library from bitbucket to jitpack? I've heard that bitbucket doesn't support
    release
    features like the ones on github.
    Joey
    kpgalligan
    6 replies
    Copy to Clipboard
  • tylerwilson

    tylerwilson

    2 years ago
    I am surprised I had not noticed this before, but I needed a String.format in common code (%.2d for example), and turns out it is only on JVM. Seems like some low hanging fruit. 🙂 Maybe for 1.4?
    tylerwilson
    j
    +1
    11 replies
    Copy to Clipboard
  • Big Chungus

    Big Chungus

    2 years ago
    How can I create a commonNative sourceSet (or better yet, target) with access to native stdlib and depend on it from linux and mingw targets?
    Big Chungus
    Dominaezzz
    +1
    5 replies
    Copy to Clipboard