basher
06/26/2019, 7:00 PMsunbreak
06/27/2019, 4:28 AMfun foo(block: (Int) -> Unit) { ... }
in Kotlin would be func foo(block: (KotlinInt) -> KotlinUnit)
in Swfit, and foo(Function1<Integer, Unit> block)
in Java.
Both require KotlinUnit.Init() (or Unit.INSTANCE)
After upgraded to 1.3.40, it can be func foo(block: (KotlinInt) -> Void)
in Swift, without the KotlinUnit.Init().
Would it possible to omit the Unit.INSTANCE in Java?Nikolai
06/27/2019, 12:06 PMJoakimForslund
06/27/2019, 2:33 PMJS Client and JVM Server
project for 1.3.40 ? (more specificly the jvm server)adiba
06/27/2019, 4:56 PMLiang Song
06/27/2019, 10:37 PM1.3.40
, I have two interfaces
interface CompletionHandler<T> {
fun onCompletion(result: T)
fun onException(exception: Exception)
}
interface TestGenerics {
fun test(completionHandler: CompletionHandler<String>)
}
the signature of TestGenerics
in the generated Objective-C header is
__attribute__((swift_name("TestGenerics")))
@protocol TMDTestGenerics
@required
- (void)testCompletionHandler:(id<TMDCompletionHandler>)completionHandler __attribute__((swift_name("test(completionHandler:)")));
@end;
Looks like it is still not supportedcoletz
06/28/2019, 10:13 AMkotlin{
jvm("desktop"){
compilations.main.kotlinOptions.jvmTarget = "1.8"
}
}
It is still using java 11, so javafx is not working :(
Anyone know how can I force the compiler to use java 8?Vojtech Hrdina
06/28/2019, 12:12 PMFudge
06/29/2019, 3:01 PMCould not get unknown property 'java' for SoftwareComponentInternal set of type org.gradle.api.internal.component.DefaultSoftwareComponentContainer.
This is my build.gradle: https://pastebin.com/vxanr3UU
I have found people doing it in many other ways, but I haven't found a solution that works from start to finish.
How do I work around this error?egorand
06/29/2019, 8:37 PMsrc/commonTest
and src/jvmTest
. The CI build fails with the following message:
> Task :wire-tests:linkDebugTestLinuxX64 FAILED
e: Could not find "/home/travis/build/square/wire/wire-tests/build/classes/kotlin/linuxX64/main/wire-tests.klib" in [/home/travis/build/square/wire, /home/travis/.konan/klib, /home/travis/.konan/kotlin-native-linux-1.3/klib/common, /home/travis/.konan/kotlin-native-linux-1.3/klib/platform/linux_x64].
Pretty sure it’s a project misconfiguration problem, but I can’t figure it out, any ideas? The Gradle build can be found here: https://github.com/square/wire/blob/egorand/190629/kotlin-test-protos-to-common/wire-tests/build.gradlelouiscad
06/30/2019, 10:29 PMmaven-publish
Gradle plugin be-like:
BUILD SUCCESSFUL in 41m 15s
1866 actionable tasks: 1247 executed, 432 from cache, 187 up-to-dateBefore, I was using bintray gradle plugin, (plus didn't support Kotlin/Native in 3 modules that now support iOS and macOS) and the compilation + upload was taking 2-3 minutes on a equally fast internet connection. Now I'm looking for setting up a free CI for open source projects that would do it on command for me, off my laptop, so I can keep working on the codebase while publishing a version (that might still be useful after the state of
maven-publish
and Kotlin/Native compilation speed improves). Recommandations are welcome!serebit
07/01/2019, 5:26 AMinternal expect class WeakReference<T>(reference: T) {
fun get(): T?
}
I want to define an actual typealias
on kotlin.native.ref.WeakReference
for the linuxx64 source set. When I declare it as such, the compiler complains that `visibility is different`:
internal actual typealias WeakReference<T> = kotlin.native.ref.WeakReference<T>
When I remove internal
, the compiler still complains that visibility is different
. Should I report this?EnricCamarero
07/01/2019, 11:11 AMadiba
07/01/2019, 1:56 PMspierce7
07/01/2019, 5:11 PMkotlin-multiplatform-<platform>
plugins to use the multiplatform
plugin. I'm several weeks into this, and have the app building, but for some reason the IDE is showing some imports as unable to resolve (again, the app can build, and I've added the dependencies properly to the corresponding gradle files). The issue seems to be around the android multiplatform projects importing jvm multiplatform projects, and then the android project complains that it can't find jvm files. Has anyone seen something like this?
I can repro this in my project with AndroidStudio, IntelliJ, and AndroidStudio 3.5 with the upgraded beta05 plugin as well.Dominaezzz
07/01/2019, 10:59 PMpublishToMavenLocal
is a last resort.)vsazel
07/02/2019, 11:54 AMArkadii Ivanov
07/02/2019, 10:15 PMtest-common
dependency to commonMain
source set but compilation fails due to kotlin.test
package cannot be resolved. IDEA does not show any errors. What maight be the problem?Denis Shurygin
07/03/2019, 12:12 PMbuild.gradle
But as I understand, each target is independent package and should be added into JCenter independently. What is the right way to do it?rharter
07/03/2019, 8:13 PMandroidNativeArm32
and androidNativeArm64
, both deployed to by local maven repo. How can I set up my Android app to depend on that? Is there a way to use the maven dependency and either generate or write a jni wrapper?Kirill Zhukov
07/03/2019, 11:56 PMthana
07/04/2019, 7:26 AMjsTest
depend on the commonTest
set of a different module? i'd like to provide some common test files for several modules...4ntoine
07/04/2019, 7:39 AMlock
or synchronized
in Kotlin? https://stackoverflow.com/questions/56882860/is-there-multiplatform-lock-on-kotlinspierce7
07/04/2019, 7:03 PMmultiplatform
plugin?Malachi de Ælfweald
07/05/2019, 2:23 PMalex.hart
07/05/2019, 5:44 PMstructs
from multiplatform code?spierce7
07/06/2019, 2:54 AMDarmaheev
07/07/2019, 2:59 AM"Could not find method export () for arguments [<myLibrari>] on object of type org.jetbrains.kotlin.gradle.dsl.KotlinNativeBinaryContainer"
This library in the sourceSet is declared as api. Gradle version 4.10.3. kotlin-multiplatform 1.3.41. My build.gradle - kotlin {
targets {
final def iOSTarget = System.getenv('SDK_NAME')?.startsWith("iphoneos") \
? presets.iosArm64 : presets.iosX64
fromPreset(iOSTarget, 'ios') {
binaries {
export "myLybrary"
framework('framework-ios')
}
}
}
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib-common')
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$serializer_version"
}
}
iosMain {
dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:$serializer_version"
api "myLybrary"
}
}
}
}
Matej Drobnič
07/07/2019, 7:24 PMUseExperimental
annotation in multiplatform project? I tried
kotlin {
targets.all {
compilations.all {
kotlinOptions {
freeCompilerArgs += "-Xuse-experimental=kotlin.Experimental"
}
}
}
}
and IntelliJ still warns about missing compiler argumentCasey Brooks
07/08/2019, 4:25 PMjvmMain
output from another multiplatform module? Normally I’d use implementation(project(":lib"))
, but it doesn’t seem to be working when :lib
is a multiplatform projectCasey Brooks
07/08/2019, 4:25 PMjvmMain
output from another multiplatform module? Normally I’d use implementation(project(":lib"))
, but it doesn’t seem to be working when :lib
is a multiplatform projectrusshwolf
07/08/2019, 4:51 PMenableFeaturePreview("GRADLE_METADATA")
in settings.gradle.kts
Casey Brooks
07/09/2019, 6:43 PMrusshwolf
07/09/2019, 7:26 PM