Sourabh Rawat
10/22/2020, 8:44 AMntherning
10/22/2020, 11:42 AM.d
-file) which Xcode uses to determine whether Gradle needs to be run at all. Xcode will discover changes to .kt
files (which we edit in Android Studio, they aren't part of the Xcode project), changes to the Gradle files, etc and only then rebuild the framework. It works nicely so far. Would be great to get some feedback on the approach.
https://gist.github.com/ntherning/dafd5979bdfb660bbf516066ca056931leandro
10/22/2020, 1:04 PMcoreLibraryDesugaring
inside androidMain
dependencies? It seems that this function does not exist for the multiplatform
pluginElka
10/22/2020, 2:05 PMrocketraman
10/22/2020, 8:32 PMSebastien Leclerc Lavallee
10/23/2020, 3:52 AMshared/build/cocoapods/framework/shared.framework
Back to the ios folder, I’m doing pod install
and it does install everything. When I hit build, it fails with error like could not build module shared
. When inspecting the imported shared.framwork, I see it’s still have the dummy.h
so makes me think the sync didn’t worked.
Where can I get more info about that before_compile
script which calls task gradlew shared:syncFramework
?
Also, I did try to manually call the ./gradle shared:syncFramework
task but it fails with Task syncFramework not found in project shared
. Why?
Did checkout Touchlab’s KampKit and can compile without any issue… when comparing what they did, it’s pretty much the same. I’m clearly missing something but can’t point exactly what…
Anyone with some hint? Thanks!Vinod Rai
10/23/2020, 6:13 AMCould not create an instance of type org.jetbrains.kotlin.gradle.targets.js.subtargets.KotlinBrowserJs.
> Failed to apply plugin [class 'org.gradle.language.base.plugins.LifecycleBasePlugin']
> Cannot add task 'clean' as a task with that name already exists.
Here is the common code Gradle for js source.
js {
moduleName = "EmtCore"
binaries.executable()
browser {
webpackTask {
outputFileName = "$moduleName.js"
}
runTask {
outputFileName = "$moduleName.js"
}
}
}
can anyone guide how to generate .js fileSebouh Aguehian
10/23/2020, 10:51 AM:shared:iosTest
forever. Has anyone experience this before?joney
10/24/2020, 10:20 PMrunBlockingTest
of [TestCoroutineScope](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-test/kotlinx.coroutines.test/-test-coroutine-scope/) for native tests?Hyun
10/25/2020, 4:13 PMfun SampleScreen(val model: SampleViewModel) {
Screen(model) {
Column {
Text("greeting : ${+model.greeting}")
Text("reply result : ${+model.replyResult}")
Button("Reply") { model.onClick() }
}
}
}
Ios
• code looks similar though if ui is complicated, code also not be similar.
func SampleScreen(_ model: ApiSingleViewModel) -> some View {
Screen(model) {
Column {
Text("current value : \(+model.greeting ?? "")")
Text("reply result : \(+model.replyResult ?? "")")
Button("Reply") { model.onClick() }
}
}
}
Common
class SampleViewModel(val api: SampleApi = serviceLocator.sampleApi) : BaseViewModel() {
//[add] is for ios to watch each Flow, DataFlow will be migrated to SharedFlow
val greeting by add { DataFlow<String>() }
val replyResult by add { DataFlow<String>() }
override fun onInitialized() {
//initStatus handle error and loading ui, also retry on error
greeting.load(initStatus) {
api.getGreeting("Hyun", "Programmer")
}
}
fun onClick() {
//initStatus hide ui on loading, error.
//status doesn't hide ui but show loading, error ui
replyResult.load(status) {
api.reply("Thanks")
navigate(SomeOtherViewModel()) // you can navigate this way.
}
}
}
Matthew Rees
10/26/2020, 8:39 AMSelected Target platforms: Native (ios_arm64), Native (ios_x64)
but when manually creating a module in IntelliJ there is no way to create a module with multiple targets? There’s a Target Platform: Multiplatform
but this does not allow the use of the iOS platform libraries. Should I just scrap my existing project and use the new Template, or is there something I’m missing?william
10/26/2020, 12:40 PMsaket
10/27/2020, 2:21 AMcommon
dependency to my project because gradle is trying to find an artifact named file-macosx64
whereas the actual name is file-macosX64
(lowercase vs uppercase X
) This is probably a general gradle question, but is there a way to help gradle find the correct artifact?Umar Ata
10/27/2020, 10:21 AMMaurice Wingbermuhle
10/27/2020, 1:23 PM@JvmSynthetic
to hide them from the JVM API.
I am now wondering if there is similar annotation to make methods hidden from the iOS (Objective-C) API, so I can hide the suspend method, effectively disabling the automatic conversion.dazza5000
10/27/2020, 8:41 PMDaniele B
10/28/2020, 5:05 PMMyEnum
,
on Kotlin, it is possible to retrieve the list of all enum values with MyEnum.values()
what about in Swift?
.values()
doesn’t seem defined in the MyEnum
object in SwiftDaniele B
10/28/2020, 5:55 PMpackage com.project.shared.valuedefs
val myList = listOf("A","B","C")
can I access it from Swift and how?Samuel Michael
10/28/2020, 6:56 PMwilliam
10/28/2020, 8:05 PMTristan Hamilton
10/29/2020, 4:49 PMdazza5000
10/29/2020, 6:21 PMdrofwarcs
10/30/2020, 1:36 AMios()
shortcut, I'm noticing that commonizer does not add the optional methods on protocols. For example UITableviewDataSource has 11 methods, but the commonizer is only creating variants that only have the 2 required methods of that protocol. These 11 methods exist on both iosX64 and iosArm64, so figured the commonized versions should also have all the methods. Is this by design or is this a bug?nrobi
10/30/2020, 11:53 AMdazza5000
10/30/2020, 5:35 PMWe don't currently support sharing a source set for these combinations:
Several JVM targets
JVM + Android targets
Several JS targets
Nikita Khlebushkin
10/30/2020, 8:12 PMexpect class Observable<T>
androidMain/…/RxUtils.kt:
actual typealias Observable<T> = io.reactivex.rxjava3.core.Observable<T>
…but:rsetkus
10/30/2020, 9:16 PMapi(project(":generatedapi"))
it as a dependency to common module. It compiles and builds successfully but when I publish the project as a library, those generated classes are not included so clients which are using multiplatform library cannot access them. Does anybody tried to achive something similar like this or maybe know a way how to expose dependency classes to clients? Thanks.saket
10/30/2020, 10:59 PMe: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld invocation reported errors
The /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld command returned non-zero exit code: 1.
output:
ld: framework not found ObjectiveGit
> Task :shared:linkDebugTestMacos FAILED
build.gradle
fromPreset(presets.macosX64, "macos") {
compilations.main {
cinterops {
objectivegit {
defFile "src/nativeInterop/cinterop/objectivegit.def"
compilerOpts "-F$projectDir/Carthage/Build/Mac/"
}
}
}
}
objectivegit.def
depends = Foundation
package = libgit2.ObjectiveGit
language = Objective-C
modules = ObjectiveGit
compilerOpts = -framework ObjectiveGit
linkerOpts = -framework ObjectiveGit
william
10/31/2020, 2:53 PMsuspend fun
in my kotlin shared code but I have been unable to see it in swift. It shows up in the objective-c framework but for whatever reason Xcode doesn't see it when i am writing swift. any ideas? I am using kotlin 1.4.10Mustafa Ozhan
11/01/2020, 12:38 PMCombine > ObservedObject
so that we can use as @ObservedObject
in SwiftUI views ? Or do we have to create a wrapper for each viewModel ?Mustafa Ozhan
11/01/2020, 12:38 PMCombine > ObservedObject
so that we can use as @ObservedObject
in SwiftUI views ? Or do we have to create a wrapper for each viewModel ?John O'Reilly
11/01/2020, 1:03 PMMustafa Ozhan
11/01/2020, 1:31 PMCombine, ObservedObject
with @ObservedObject
and @Published
vars on IOS side or better to use straightforward approach like here: https://github.com/kuuuurt/jokes-app-multiplatform/blob/master/ios/JokesApp/ViewController.swiftsaket
11/01/2020, 5:17 PMMustafa Ozhan
11/01/2020, 10:08 PM