• m

    Marc Knaup

    3 years ago
    Why is a different extension function called depending on whether one is
    expect
    or not? common module:
    sealed class Test {
    	object A : Test()
    }
    If I don't use expect:
    fun Test.print() {
    	when (this) {
    		is Test.A -> print() // calls method below
    	}
    }
    
    fun Test.A.print() { // gets called
    	println("A")
    }
    If I use expect:
    fun Test.print() {
    	when (this) {
    		is Test.A -> print() // recursive call
    	}
    }
    
    expect fun Test.A.print() // not called
    m
    louiscad
    2 replies
    Copy to Clipboard
  • max.denissov

    max.denissov

    3 years ago
    is there any approach to create mock object in tests of the common module for android/ios project? Tried to use Mockk, but common tests fails while run building common ios code, but passes while run building common android code.
    max.denissov
    Tobi
    +1
    3 replies
    Copy to Clipboard
  • m

    Marc Knaup

    3 years ago
    Did anybody manage to publish a multiplatform project to Sonatype? 🤔
    A POM cannot have multiple artifacts with the same type and classifier. Already have MavenArtifact fluid-stdlib-metadata:jar.asc:asc:null, trying to add MavenArtifact fluid-stdlib-metadata:jar.asc:asc:null
    (same here, unanswered: https://stackoverflow.com/questions/54318156/kotlin-multiplatform-library-project-upload-issue-pom-multiple-artifacts) configuration: https://github.com/fluidsonic/fluid-library/blob/master/sources/FluidLibraryVariantConfiguration.kt#L168
    m
    louiscad
    +1
    24 replies
    Copy to Clipboard
  • b

    basher

    3 years ago
    Has anyone run into
    Declaration annotated with '@OptionalExpectation' can only be used in common module sources
    recently? I've found old SO posts saying it's fixed. It just started happening on my machine for an
    @SharedImmutable
    in our common sources, for a declaration that has been in our codebase building fine for awhile now. Using 1.3.31
    b
    louiscad
    7 replies
    Copy to Clipboard
  • altavir

    altavir

    3 years ago
    I am struggling a lot with gradle-metadata feature. I have a module (this one: http://npm.mipt.ru:8081/artifactory/webapp/#/artifacts/browse/tree/General/gradle-dev-local/hep/dataforge/dataforge-meta) which is compiled and deployed with
    enableFeaturePreview("GRADLE_METADATA")
    . And then I have a library which is also build with gradle meta. According to documentation, all I need is to declare it in the
    commonMain
    block of mpp, and I will automatically get dependencies for all branches. It does not work. I have to write platform-specific dependencies for all platforms and additional metadata for common. What am I doing wrong?
    altavir
    m
    +1
    26 replies
    Copy to Clipboard
  • Jan Stoltman

    Jan Stoltman

    3 years ago
    Is there any alternative for Mockk which supports K/N?
    Jan Stoltman
    Tobi
    2 replies
    Copy to Clipboard
  • Kris Wong

    Kris Wong

    3 years ago
    has anyone seen a crash running unit tests for an iOS app after bringing in a Kotlin MPP via pods? libc++abi.dylib: terminating with uncaught exception of type NSException
    Kris Wong
    olonho
    8 replies
    Copy to Clipboard
  • tylerwilson

    tylerwilson

    3 years ago
    I am attempting to include an mp project in an Android app in Android Studio via the settings.gradle include and project().projectDir mechanism. Unfortunately, I can find the right incantation to have it build just the jvm/android lib/jar needed by the app. I have tried starting with an IDEA MP project and adding the Android library stuff, and also from a vanilla AS generated library and adding the kotlin-multiplatform plugins. But I have not been able to do it. My goal is to have the common shared lib in one repo, which is referenced from all the Android and iOS apps. Anybody get anything like this working? Please?
    tylerwilson
    s
    4 replies
    Copy to Clipboard
  • m

    Mohammadsss1

    3 years ago
    Any tutorial about converting an MPP's gradle from Groovy to Kotlin in Android studio without breaking the build process! I have renamed the files by adding .kts to the end of build.gradle file and .settings file but keeps didn't go well!
    m
    russhwolf
    +1
    4 replies
    Copy to Clipboard
  • r

    ribesg

    3 years ago
    I’m trying to run some tests on a MPP library (Android & iOS targets) and I have some questions.1. Why do I need to have JUnit/JUnit5/TestNG on the Android part just to get the
    @Test
    annotation? 2. Can you have top-level tests instead of having to put them in a class?3. Is there a good sample on how to have tests running for iOS, especially in the case of needing some CInterops?
    r
    s
    +1
    12 replies
    Copy to Clipboard