Jason5lee
12/31/2023, 8:44 AMios
with a function that looks like doing something complete different.
This is a simple multiplatform library that is mostly common-only, so I want to support as many platform as possible. Is there a simple way to do this now?Jason5lee
12/31/2023, 8:53 AMThe plugin sets up those source sets automatically based on the targets specified in your project.But here I'm using
ios
to specify the target. Which should I replace?loke
12/31/2023, 9:02 AMiosArm64
? I've never used iphone, but that's what this page appears to suggest: https://kotlinlang.org/docs/multiplatform-hierarchy.htmlJason5lee
12/31/2023, 9:04 AMloke
12/31/2023, 9:06 AMJeff Lockhart
12/31/2023, 5:11 PMdependsOn
relationship between any source sets, you don't even have to call applyDefaultHierarchyTemplate
. This simplifies creating source set dependencies and intermediate source sets by automatically creating the default hierarchy for you for all targets you declare.
So you really only need step 1. Declare all the targets your code supports. You probably don't need to target Android directly, since it can consume the JVM artifact, unless you need Android-specific APIs. So you can declare jvm
, js
, and all native targets.