I'm building a Gradle plugin that targets multipla...
# multiplatform
j
I'm building a Gradle plugin that targets multiplatform projects - The plugin contributes a large resource (which libraries like compose-resources won't let me open a stream for), so I'm trying to contribute platform-specific resources instead. I've had no trouble adding a generated res directory for Android targets, but I can't figure out how to do the same for JVM. I figured I'd be able to grab the
jvmMain
source set with
sourceSets.findByName("jvmMain")
and go from there, but I just get
null
back 😔 Any ideas? Docs you can point me to? Some other simpler solution? Much appreciated 🙏
Answering my own question - check if
jvmMain
exists via
sourceSets.jvmMain.isPresent
, and configure via
sourceSets.jvmMain.configure
The actual source set and tasks don't exist until this is evaluated, so you need to make use of the lazy init stuff Thanks for rubber ducking