Jetbrains skiko examples for gradle settings, used...
# amper
u
Jetbrains skiko examples for gradle settings, used java queries to get the current os and arch for getting the multi-platform specific skiko dependency, is there a way to achieve this on amper? for compose there is
$compose.desktop.currentOs
but there is no way to use current os in other dependencies
m
on amper you can specify dependencies by platform like:
Copy code
# Android-only dependencies  
dependencies@android:
  # Android-specific integration with Compose
  - androidx.activity:activity-compose:1.7.2: exported
  - androidx.appcompat:appcompat:1.6.1: exported
u
for android and ios yes, but desktop does not allow to specify win/linux/mac only JVM
a
hi, thanks for the question the answer is no, it's only exception for
compose.desktop
there is no way to use current os for other dependencies however, I'm curious: what do you need that for? Let's discuss: do we need that feature or if there is a better way to do that
m
I would say: it would be nice to specify a platform implementation (mac/linux/windows) dependency for a desktop app
a
what specific dependency do you have in mind? could you please share?
m
@utenma?
An example: imagine you want to create a desktop game using KMP, then you want to use proper libraries for each system like: • Windows: DirectX DLL • Linux: OpenGL • MacOS: some other library And then you want to wrap those libraries with a Kotlin expect/actual layer
a
The problem of
jvm
target which is truly cross-platform in wild nature might exist, indeed However, keep in mind that scenario you are describing according to me, doesn't exist yet There is a compiler limitation, you can't just depend on library with native targets from jvm module I get the intention here, though For now the reason why
$compose.desktop.currentOs
escape hatch exists is that every package contains OS-dependant binary called through jni There are other ways how to do that all of them aren't perfect, though This is why I'm eager to see more real-life examples of this to understand the actual demand considering all the limitations of runtime/compiler/etc
u
@Anton Prokhorov the use case was to run skiko (jetbrains skia) on jvm, without compose
thank you color 1