Jaroslav
02/21/2019, 11:19 AMbasher
02/21/2019, 4:30 PMbob
02/22/2019, 12:09 PMJaroslav
02/22/2019, 1:06 PMNSDate(timeIntervalSince1970:)
in kotlin? 😞Dominaezzz
02/22/2019, 1:07 PMruntime assert: Memory leaks found
? Can't find where the leak is from.ribesg
02/22/2019, 2:12 PMconstructor
cases to define by handbasher
02/23/2019, 4:12 AM.freeze()
on an object, somewhere along the line it calls FreezeSubgraph
internally. What is it that determines what is part of an object's subgraph that also gets frozen as a part of that object's freeze operation?basher
02/23/2019, 4:13 AMBernhard
02/24/2019, 5:38 PMBernhard
02/24/2019, 5:39 PMbasher
02/25/2019, 10:53 PMdrofwarcs
02/25/2019, 10:56 PMivan.savytskyi
02/26/2019, 5:17 PMframework
provided by some vendor) in Kotlin Native?jacek.karaskiewicz
02/27/2019, 3:03 PMfun foo(bar: IntArray) {}
to a macOsX dynamic library, I “get” a compiled library with a generated header where kotlin IntArray type is mapped to libtest_kref_kotlin_IntArray
, where test
is the name of my library.
There seems to be no good way of constructing this object though, or at least it’s not defined in this header. Is there a way of consuming this library in a C program and somehow providing an object of that type?r4zzz4k
02/27/2019, 8:47 PMlipo
with single Gradle task (configuring and running two Gradle builds under the hood).
https://github.com/JetBrains/kotlin-native/issues/2718#issuecomment-467838456
This looks to me like a good candidate for a bit of generalization, so maybe someone will find it useful :)spierce7
02/28/2019, 3:26 AMyusuf3000
02/28/2019, 12:38 PM./gradlew build
it recompiles the project even when it successfully compiled previously and there has been no changes. Is this a bug? Or is there some misconfiguration in my project?basher
02/28/2019, 6:27 PMdata class
backed by an iOS foundation object, and kotlin didn't complain. Is this because K/N has built in facilities for generating equals and hashCode that call the NSObject equivalents?Cyrille QUÉMIN
02/28/2019, 11:51 PMld: symbol(s) not found for architecture arm64
this only appears because I added staticLibraries
and a libraryPaths
in my def file since I noticed that the google framework contains
a native library .a
and other frameworks as part of the its internal dependency. I have tried multiple combination of using linkerOpts
with -L
or -F
pointing at the folder where the framework has been imported but nothing works.
I have not been able to find a clear explanation as to how to create correct cinterops with ios framework that contains a static library and multiple indirect dependencies since I suspect that the impossibility
to export this as ios framework is related to my wrong configuration of the cinterops.
Thanks in advance
Def File:
depends = Foundation
language = Objective-C
headers = GNSMessages.h
staticLibraries = NearbyMessages/Libraries/libGNSMessages.a
libraryPaths = /Users/cyrille.quemin/Documents/git/multiplatform-p2p/p2p-common/src/iosMain/dependencies/Pods
Cinterops:
binaries {
framework("p2p_common") {
linkerOpts "-L${podsDir}/NearbyMessages/Libraries"
}
}
compilations.main.cinterops {
NearbyMessage {
defFile "src/iOSMain/c_interop/NearbyMessages.def"
includeDirs "${podsDir}/Headers/Public/NearbyMessages"
linkerOpts "-F${podsDir}/NearbyMessages/Libraries/"
}
}
juancho
03/01/2019, 2:59 AMSWIFT CODE:
let originalString = "test/test"
let escapedString = originalString.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed)
print(escapedString!)
I found that this function is defined as an extension in a class called StringProtocol
extension StringProtocol where Self.Index == String.Index {
Any idea how can I get access to this function from Kotlin Native? Thanks!Roman
03/01/2019, 8:03 AMSystemTimeToFileTime
return 0, I messed up with types?
For the structure, should I do alloc
or` allocArray`?
val systemTime = alloc<_SYSTEMTIME>()
systemTime.wDay=1u
systemTime.wHour=11u
systemTime.wMinute=11u
systemTime.wSecond=11u
systemTime.wMonth=11u
systemTime.wYear=11u
val fileTime = alloc<_FILETIME>()
println(SystemTimeToFileTime(systemTime.ptr, fileTime.ptr))
olonho
03/01/2019, 9:31 AM* Exception backtraces in debug mode on macOS and iOS targets contains symbolic information
* Support for 32-bit Windows targets (target mingw_x86)
* Support for cross-compilation to Linux (x86-64 and arm32) from macOS and Windows hosts
* Static Apple frameworks can be produced
* Support Gradle 5.1
* Fix alignment-related issues on ARM32 and MIPS platforms
* Write unhandled exceptions stacktrace on device to iOS crash log
* Fix undefined behavior in some arithmetic operations
* Interop:
* Get rid of libffi dependency
* Support returning struct from C callbacks
* Support passing Kotlin strings to C interop functions accepting UTF-32 arguments
* Fix bool conversion
* Support variable length arrays
* Provide Kotlin access to C compiler intrinsics via platform.builtins package
* Support clang modules
* IDE
* Kotlin/Native plugin is supported in CLion 2018.3 and AppCode/CLion 2019.1
* Basic highlighting support for .def files
* Navigation to source files from exception backtrace
ribesg
03/01/2019, 10:43 AM.h
doesn’t even seem to compileCyrille QUÉMIN
03/01/2019, 11:02 AMlinkerOpts = -framework AVFoundation -framework full/path/to/my/Framework
and also linkerOpts = -framework AVFoundation -F path/to/my/framework/folder
-framework MyFramework` but it does not work. I keep on receiving this type of error: ld: framework not found MyFramework
ribesg
03/01/2019, 2:05 PMribesg
03/01/2019, 2:36 PMVoid
?Cyrille QUÉMIN
03/01/2019, 2:42 PM@property (readonly) Passport_reader_commonMapper *default;
or @property (readonly) double double;
which prevent the frameword to be built in my iOS app. Any idea on a workaround?Cyrille QUÉMIN
03/02/2019, 1:31 PMios32
and ios64
presets. And some methods thatI use have a different signatures in 32 where it uses Int
versus 64 where it uses Long
. Those method are ios specific only. If I declare the same method twice (in 32 and 64 source set) then obviously I get a multiple definition error. Is there a way to deal with this where I dont need to have `expected`/`actual` because android would have no need for it and therefore 'fake' implementation?Cyrille QUÉMIN
03/02/2019, 2:29 PMios32
and ios64
presets. The 32 preset defines a cinterops
. Is there a way for the 64 to 'inherit` the preset definition or do I have to duplicate the cinterops
bloc and the others into my 64 preset ?
Ideally something like ?
fromPreset(presets.iosArm32, 'myIOS') {
compilations.main.cinterops {
[...]
}
fromPreset(presets.myIOS, 'iOS64'){
}
GarouDan
03/02/2019, 3:44 PMimport kotlinx.interop.wasm.dom.*
import kotlinx.wasm.jsinterop.*
which dependencies should I include in my build.gradle.kts
configuration file?
I’m trying to follow the steps of this project but I didn’t find the correct dependencies yet:
https://github.com/JetBrains/kotlin-native/tree/master/samples/html5CanvasGarouDan
03/02/2019, 3:44 PMimport kotlinx.interop.wasm.dom.*
import kotlinx.wasm.jsinterop.*
which dependencies should I include in my build.gradle.kts
configuration file?
I’m trying to follow the steps of this project but I didn’t find the correct dependencies yet:
https://github.com/JetBrains/kotlin-native/tree/master/samples/html5CanvasDominaezzz
03/02/2019, 3:45 PMwasm
target.build.gradle
?GarouDan
03/02/2019, 4:29 PMimport org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile
import java.nio.file.Paths
plugins {
kotlin("multiplatform")
}
repositories {
jcenter()
}
val packageName = "kotlinx.interop.wasm.dom"
val jsinteropKlibFileName = Paths.get(buildDir.toString(), "klib", "$packageName-jsinterop.klib").toString()
kotlin {
wasm32 {
compilations["main"].outputKinds("EXECUTABLE")
compilations["main"].entryPoint("com.company.team.project.application.native_.wasm.main")
}
sourceSets {
val wasm32Main by getting {
kotlin.srcDir("src/main/kotlin")
resources.srcDir("src/main/resources")
dependencies {
implementation(files(jsinteropKlibFileName))
}
}
val wasm32Test by getting {
kotlin.srcDir("src/test/kotlin")
resources.srcDir("src/test/resources")
dependencies {
}
}
}
}
tasks {
withType<KotlinNativeCompile>().configureEach {
dependsOn("jsinterop")
}
}
task("jsinterop") {
val os = org.gradle.internal.os.OperatingSystem.current()!!
val workingDir = projectDir
val ext = if (os.isWindows) ".bat" else ""
val distributionPath = project.properties["org.jetbrains.kotlin.native.home"] as String
val jsinteropCommand = Paths.get(file(distributionPath).path, "bin", "jsinterop$ext").toString()
inputs.property("jsinteropCommand", jsinteropCommand)
inputs.property("jsinteropPackageName", packageName)
outputs.file(jsinteropKlibFileName)
exec {
commandLine(
jsinteropCommand,
"-pkg",
packageName,
"-o",
jsinteropKlibFileName,
"-target",
"wasm32"
)
}
}
Dominaezzz
03/02/2019, 4:31 PMGarouDan
03/02/2019, 4:33 PMExample.kt:7:36: error: unresolved reference: textContent
document.getElementById("target").textContent = "Test"
package com.company.team.project.application.native_.wasm
import kotlinx.interop.wasm.dom.*
import kotlinx.wasm.jsinterop.*
fun main() {
document.getElementById("target").textContent = "Test"
}
Dominaezzz
03/02/2019, 4:35 PMGarouDan
03/02/2019, 4:36 PMdocument.getElementById("target").textContent
for js, is this exists for wasm? Since my autocompletion is not working I can’t really knowdocument.getElementById("myCanvas").asCanvas
but I would like to write just a text for nowDominaezzz
03/02/2019, 4:38 PMGarouDan
03/02/2019, 4:39 PMfun main() {
val canvas = document.getElementById("myCanvas").asCanvas
val ctx = canvas.getContext("2d")
val rect = canvas.getBoundingClientRect()
val rectLeft = rect.left
val rectTop = <http://rect.top|rect.top>
var mouseX: Int = 0
var mouseY: Int = 0
var draw: Boolean = false
document.setter("onmousemove") { arguments: ArrayList<JsValue> ->
val event = MouseEvent(arguments[0])
mouseX = event.getInt("clientX") - rectLeft
mouseY = event.getInt("clientY") - rectTop
if (mouseX < 0) mouseX = 0
if (mouseX > 639) mouseX = 639
if (mouseY < 0) mouseY = 0
if (mouseY > 479) mouseY = 479
}
document.setter("onmousedown") {
draw = true
}
document.setter("onmouseup") {
draw = false
}
setInterval(10) {
if (draw) {
ctx.strokeStyle = "#222222"
ctx.lineTo(mouseX, mouseY)
ctx.stroke()
} else {
ctx.moveTo(mouseX, mouseY)
ctx.stroke()
}
}
}