galex
06/20/2019, 12:05 PMFail
06/20/2019, 12:20 PMUnresolved reference: serializer
What changed?egorand
06/20/2019, 7:00 PMbuild/reports/tests/allTests
after running check
and I can only see tests executed on jvm
and macosX64
pardom
06/20/2019, 8:29 PMrusshwolf
06/20/2019, 10:57 PM./gradlew clean build check
, and observe the output
Execution failed for task ':kotlinNpmResolve'.
> Cannot add a configuration with name 'OneThreeForty-lib-npm' as a configuration with that name already exists.
Dmitry Motyl
06/21/2019, 9:31 AMhooliooo
06/21/2019, 9:50 AMfun someAPIRequest(input: String, callback: (SomeModel?, SomeError?) -> Unit) {
....
}
From what I read, Kotlin Native interoperability to iOS is Kotlin => Objective-C => Swift, correct? To change that into a Result type I’d implement something like:
sealed class SomeResult<T, E> {
data class Success<T, E>(val value: T): SomeResult<T, E>()
data class Failure<T, E>(val value: E): SomeResult<T, E>()
}
fun someAPIRequest(input: String, callback: (SomeResult<SomeModel, SomeError>) -> Unit) {
....
}
But then, I’d have to typecast in Swift, correct? I wouldn’t be able to leverage the Swift Result type because it’s a language feature right?coletz
06/21/2019, 1:23 PMspierce7
06/21/2019, 5:32 PMkotlin-platform-x
gradle plugins to use the multiplatform
plugin. I'm now getting the following error in my builds. Does anyone have any recommendations? I'm a bit stuck now:
> Task :app:lintVitalInternalRelease FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:lintVitalInternalRelease'.
> Configuration with name 'compileClasspath' not found.
Jan Stoltman
06/22/2019, 8:52 AMiosTest
?alex009
06/22/2019, 5:03 PMMatej Drobnič
06/23/2019, 4:35 PMspierce7
06/24/2019, 2:33 AMmultiplatform
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.sdeleuze
06/24/2019, 8:07 AMkotlin {
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 @gaetanSlackbot
06/24/2019, 9:06 AMdarkmoon_uk
06/24/2019, 11:24 AMFail
06/24/2019, 2:06 PMbuildscript {
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.kpgalligan
06/24/2019, 6:29 PMpardom
06/24/2019, 8:48 PMpresets.withType<KotlinNativeTargetPreset>().forEach { preset ->
targetFromPreset(preset) {
val main by compilations.getting {
dependencies {
api("org.jetbrains.kotlinx:kotlinx-coroutines-core-native:1.2.2")
}
}
}
}
capitalthree
06/24/2019, 9:27 PMpardom
06/25/2019, 1:07 AMcommonTest
. Is it possible to choose just one target to run the tests?pardom
06/25/2019, 1:16 AMgalex
06/25/2019, 5:38 AM1.3.40
to just compile I had to add the following in the root level dependencies block:
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
Running the gradle task build
, which runs the tasks testDebugUnitTest
fails:
> Task :testDebugUnitTest FAILED
com.mu51k.core.util.EmailUtilsTests > emailsAreInvalid FAILED
java.lang.NullPointerException at EmailUtilsTests.kt:20
com.mu51k.core.util.EmailUtilsTests > emailsAreValid FAILED
java.lang.NullPointerException at EmailUtilsTests.kt:12
2 tests completed, 2 failed
The NPE seems weird, as the code looks like that:
assertTrue { "<mailto:glfala@fefr.com|glfala@fefr.com>".emailValid() }
And emailValid()
on Android is the following:
actual fun String.emailValid(): Boolean = Patterns.EMAIL_ADDRESS.matcher(this).matches()
Any idea?Slackbot
06/25/2019, 2:06 PMadiba
06/25/2019, 3:50 PMgalex
06/25/2019, 4:08 PMkieran
06/26/2019, 3:57 AMcoletz
06/26/2019, 6:31 AMkotlin{
...
js {
browser {
}
}
}
2)
jvmBackendJar {
dependsOn(jsBrowserWebpack)
from(new File(jsBrowserWebpack.entry.name, jsBrowserWebpack.outputPath))
}
how can I replicate these tasks without kotlin 1.3.40? Can someone share an older mpp config with js?
Thanks 🙂adiba
06/26/2019, 1:58 PMKris Wong
06/26/2019, 3:45 PMKris Wong
06/26/2019, 3:45 PMbasher
06/26/2019, 3:46 PMKris Wong
06/26/2019, 3:46 PMbasher
06/26/2019, 3:55 PMKris Wong
06/26/2019, 3:59 PMbasher
06/26/2019, 4:01 PMpardom
06/26/2019, 4:13 PMKris Wong
06/26/2019, 4:27 PMolonho
06/26/2019, 9:29 PMKris Wong
06/26/2019, 9:32 PM