K
Kord3mo ago
Tic

Publish multiplatform library (not Discord bot)

Hello This is the list of supported platform of my lib:
iosX64()
iosArm64()
iosSimulatorArm64()
tvosX64()
tvosArm64()
tvosSimulatorArm64()
watchosArm32()
watchosArm64()
watchosX64()
watchosSimulatorArm64()
linuxX64()
linuxArm64()
macosX64()
macosArm64()
mingwX64()
jvm {
}

js {
jsAndWasmSharedConfigurationTarget()
}
wasmJs {
jsAndWasmSharedConfigurationTarget()
}
iosX64()
iosArm64()
iosSimulatorArm64()
tvosX64()
tvosArm64()
tvosSimulatorArm64()
watchosArm32()
watchosArm64()
watchosX64()
watchosSimulatorArm64()
linuxX64()
linuxArm64()
macosX64()
macosArm64()
mingwX64()
jvm {
}

js {
jsAndWasmSharedConfigurationTarget()
}
wasmJs {
jsAndWasmSharedConfigurationTarget()
}
I'm using the plugin https://github.com/gradle-nexus/publish-plugin to publish my lib in maven central However, when I check the availabled action, I can publish for: JVM JS WasmJS MingwX64 LinuxX64 LinuxArm64 But as you can see, the targets: Macos TvOsSimulatorArm64 TsosX64 WatchosArm32 etc. Are not avaiabled in the commands list. For your lib, how do you publish it with these missing targets? Should I change the plugin used?
GitHub
GitHub - gradle-nexus/publish-plugin: Gradle plugin for publishing ...
Gradle plugin for publishing to Nexus repositories - gradle-nexus/publish-plugin
20 Replies
vyfor
vyfor3mo ago
apple targets can only be compiled on apple devices you can either create a ci that runs on a mac to compile for all targets, or cross compile which is a pain to setup
Tic
Tic3mo ago
Aaah maybe I need to have a mac to see the gradle command I will try it after! Probably nice catch
SchlaubiBus
SchlaubiBus3mo ago
How could you miss that the compiler yells at you
Tic
Tic2mo ago
I didn't miss that, but that's not linked to the gradle publish plugin
SchlaubiBus
SchlaubiBus2mo ago
publishing is handled by the Kotlin Gradle plugin the other plugin just handles some specifics
Tic
Tic2mo ago
Hum, ok on Mac I see the Tvos etc. But .. why I see MingwX64? That's not a windows target?
SchlaubiBus
SchlaubiBus2mo ago
that is the windows target yes you can compile windows on mac and linux just apple is special
Tic
Tic2mo ago
what really? So .. to publish, I just need to start the CI with macos-latest and all target will be published?
vyfor
vyfor2mo ago
yes
Tic
Tic2mo ago
Ok I will try Other question, if I apply nativeTest by gettings { .. }, that will be applied for all native targets? win, linux, ios?
vyfor
vyfor2mo ago
afaik, nativeTest is not a built-in name of a source set, so you need to use by creating {} instead, and then manually have each native target's relevant source set depend on nativeTest and as long as you have that dependency, whatever you put in nativeTest should be applied to other targets just keep in mind that you won't be able to use os-specific code this way
SchlaubiBus
SchlaubiBus2mo ago
It is when you use the hierarchy template
vyfor
vyfor2mo ago
is it? i always had it disabled
SchlaubiBus
SchlaubiBus2mo ago
Well that's the reason
Want results from more Discord servers?
Add your server