• alex009

    alex009

    3 years ago
    anyone know mpp (android & ios) library with datetime and timezones? analog of klock
    alex009
    louiscad
    +1
    3 replies
    Copy to Clipboard
  • m

    Matej Drobnič

    3 years ago
    Is it possible to have normal module and multiplatform module in the same gradle project?
    m
    egorand
    12 replies
    Copy to Clipboard
  • spierce7

    spierce7

    3 years ago
    Using the
    multiplatform
    plugin, if I have test sourcesets dependOn other sourcesets, I can't access the
    internal
    code of those source sets. I have a sourceSet that is generated code, so I separate it, and those tests that depend on the generated code, and the common code can't access the internal code of the common source set. My configuration is inside the thread.
    spierce7
    1 replies
    Copy to Clipboard
  • sdeleuze

    sdeleuze

    3 years ago
    Hey, thanks to @snrostov my https://github.com/sdeleuze/spring-kotlin-fullstack is now using the new MP Gradle plugin but I have to say I am puzzled by the dependency structure that seems rather not conventional and harder to understand that previous one. For the JS module, we have currently:
    kotlin {
        target {
            browser()
    
            sourceSets {
                main {
                    dependencies {
                        implementation(kotlin("stdlib-js"))
                        implementation(project(":shared"))
                    }
                }
            }
        }
    }
    Why not:
    kotlin {
        target {
            browser()
        }
    }
    dependencies {
            implementation(kotlin("stdlib-js"))
            implementation(project(":shared"))
        }
    For the common module, we have this pretty confusing build:
    kotlin {
        jvm()
        js {
            browser()
            nodejs()
        }
    
        sourceSets {
            commonMain {
                dependencies {
                    implementation(kotlin("stdlib-common"))
                }
            }
            commonTest {
                dependencies {
                    implementation(kotlin("test-common"))
                    implementation(kotlin("test-annotations-common"))
                }
            }
            getByName("jvmMain").apply {
                dependencies {
                    implementation(kotlin("stdlib-jdk8"))
                }
            }
            getByName("jvmTest").apply {
                dependencies {
                    implementation(kotlin("test"))
                    implementation(kotlin("test-junit"))
                }
            }
            getByName("jsMain").apply {
                dependencies {
                    implementation(kotlin("stdlib-js"))
                }
            }
            getByName("jsTest").apply {
                dependencies {
                    implementation(kotlin("test-js"))
                }
            }
        }
    }
    Is it the expected final format we are going to use? cc @gaetan
    sdeleuze
    snrostov
    +4
    100 replies
    Copy to Clipboard
  • s

    Slackbot

    3 years ago
    This message was deleted.
    s
    y
    +2
    13 replies
    Copy to Clipboard
  • d

    darkmoon_uk

    3 years ago
    Really want to support a project with both an Android and Desktop Java source-set
    d
    h0tk3y
    +1
    3 replies
    Copy to Clipboard
  • f

    Fail

    3 years ago
    Strange errors with sqldelight> Case:1. Create new multiplatform (Android/IOS) project. 2. Add sqldelight: create folder, add plugin to gradle:
    buildscript {
        repositories {
            google()
            mavenCentral()
        }
        dependencies {
            classpath 'com.squareup.sqldelight:gradle-plugin:1.1.3'
        }
    }
    ...
    apply plugin: 'com.squareup.sqldelight'
    sqldelight {
        MyDatabase {
            packageName = "ru.mybase.database"
            sourceFolders = ["sqldelight"]
        }
    }
    ...
    kotlin {
    ...
    SourceSets {
            commonMain {
                dependencies {
                    implementation kotlin('stdlib-common')
                    implementation "com.squareup.sqldelight:runtime-metadata:1.1.3"
                }
            }
    ...
    All compiled and worked. 3. Add kotlinx serialization:
    buildscript {
    ...
        dependencies {
            --> classpath "org.jetbrains.kotlin:kotlin-serialization:1.3.40"
            classpath 'com.squareup.sqldelight:gradle-plugin:1.1.3'
        }
    }
    ...
    apply plugin: 'kotlinx-serialization'
    ...
    implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:0.11.1"
    ...
    And we have error:
    Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.squareup.sqldelight:runtime-jvm:1.1.3.
    After removing serialization plugin the error remains. Tested with enableFeaturePreview("GRADLE_METADATA") and without.
    f
    y
    +1
    13 replies
    Copy to Clipboard
  • kpgalligan

    kpgalligan

    3 years ago
    Any chance there will be a 1.3.0-M1 update for Kotlin 1.3.40? Can’t deploy some libraries until that’s available.
    kpgalligan
    1 replies
    Copy to Clipboard
  • p

    pardom

    3 years ago
    Perhaps like this?
    presets.withType<KotlinNativeTargetPreset>().forEach { preset ->
        targetFromPreset(preset)  {
            val main by compilations.getting {
                dependencies {
                    api("org.jetbrains.kotlinx:kotlinx-coroutines-core-native:1.2.2")
                }
            }
        }
    }
    p
    b
    15 replies
    Copy to Clipboard
  • c

    capitalthree

    3 years ago
    can anyone point me to any example of a gradle kotlin multiplatform project that has a subproject? Even if nobody can give me a specific answer about scala, I am pretty sure I can make it work as a subproject but I don't know how to make the jvm compile task include the subproject properly
    c
    b
    54 replies
    Copy to Clipboard