is it possible for to have the bottom dependency o...
# compose-desktop
z
is it possible for to have the bottom dependency only for linux and all others have the top one?
Copy code
implementation("org.xerial:sqlite-jdbc:3.51.1.0")
    //**//implementation("com.github.zoff99:pkgs_zoffcc_sqlite-jdbc-sqlcipher:1.0.19")
j
Not trivially like that, no. The same binary runs on all OSes.
If they exist in different Java packages, you can do runtime selection of the driver based on the OS.
m
For Gradle/Compose on its own, you can't do better than an if statement. As you need to run packaging on each host OS separately anyway that should work. For cross-building, if you use Conveyor there are platform specific dependency configurations so you can avoid shipping binaries for the wrong OS, e.g.
Copy code
macAarch64("group:artifact:version")
linuxAmd64("group:artifact:version")
And that gets wired up automatically so gradle run works.
z
@mikehearn and without conveyor, what do i put in the "if" statement? is there an example to check for host os gradle runs on? because thats also what i thought about, just didnt know what to query in the "if"
m
You could ask Junie or ChatGPT, I don't recall the exact syntax off hand. Something like
if ("linux" in System.getProperty("os.name").lowercase()) { ... }
👍 1