natario1
09/01/2023, 10:34 AMfoo:foo-runtime:0.1.0
with many KMP targets on a local repository. The library source sets look like this:
• frontendMain
is a plain jvm target
• backendMain
is a parent for all androidNative* targets
The lib also ships a Gradle plugin which observes the KMP plugin and adds foo:foo-runtime:0.1.0
individually to all supported targets that it finds (either jvm or androidNative). It’s the common pattern of a Gradle plugin that adds the runtime dependency automatically.
Now in the consumer project, :bar
, I apply this plugin and add relevant targets.
• When I declare jvm()
target, I can correctly see stuff from foo:frontendMain
• When I declare androidNativeArm64()
target (for example), I can correctly see stuff from foo:backendMain
• But in my merged source set bar:androidNativeMain
, which is a parent for all androidNative* targets, I can’t see foo:backendMain
at all.
I seem to remember this used to work, shouldn’t it?
Note: my plugin can’t add foo:foo-runtime:0.1.0
to bar:androidNativeMain
, it doesn’t know what source sets exists, it can only act on the individual end targets. Also I can’t add it to commonMain
because the library does not support all targets and if any of them is defined in the consumer project, Gradle fails.