Slackbot
11/11/2023, 5:06 PMDavid Herman
11/11/2023, 5:06 PMDavid Herman
11/11/2023, 5:06 PMDavid Herman
11/11/2023, 5:07 PMDavid Herman
11/11/2023, 5:07 PMVampire
11/11/2023, 5:20 PMpom.xml, ivy.xml, or the Gradle Module Metadata.
Those metadata are used to resolve the artifacts you need in the end, so for example your consumer depends on foo:bar:1.0 with capability foo:bar-js to resolve to the JS feature variant or capability foo:bar-jvm to resolve to the JVM feature variant.
If the "metadata" you refer to is just some resource your consumer or library needs at runtime, it is not so much metadata, but a resource. You could for example package it with each of the variants, or you could have some common artifact if possible that the other two then depend on or something like that.
If that is not what you meant, you probably need to become even more concrete, or optimally show in an MCVE what you mean exactly.David Herman
11/11/2023, 5:21 PMDavid Herman
11/11/2023, 5:26 PMDavid Herman
11/11/2023, 5:29 PMDavid Herman
11/11/2023, 5:30 PMDavid Herman
11/11/2023, 5:39 PM# user's library code
src/
kotlin/
jsMain/
... stuff ...
jvmMain
... stuff ...
build.gradle.kts
# applies com.varabyte.kobweb.library
build/
libs/
user-library-1.2.3-js.klib
user-library-1.2.3-jvm.jar
# user's application code
src/
...
build.gradle.kts
# applies com.varabyte.kobweb.application
# specifies a dependency on `user-library:1.2.3`
build/
generated/
# main.kt calls register methods both from all libraries as well
# as application code if annotated
main.kt
Currently, the library plugin processes the user's code, generating META-INF/kobweb/frontend.json and META-INF/kobweb/backend.json and adding them as resources for each platform-specific artifact so they get bundled with them.
Later, the application plugin runs over all of its dependencies, unzipping artifacts and looking for the frontend.json and backend.json files. I'd like to limit the set of dependencies that the application plugin runs over, which I could do if I associated a top-level, common resource with the library artifact.
I'm thinking it makes sense to use Gradle machinery to expose that common resource. But then, once I do that, maybe I should be using it for the frontend.json and backend.json resources as well?David Herman
11/13/2023, 5:13 PMVampire
11/13/2023, 6:47 PMDavid Herman
11/13/2023, 6:49 PMDavid Herman
11/13/2023, 6:49 PMDavid Herman
11/13/2023, 6:55 PMVampire
11/13/2023, 8:06 PMVampire
11/13/2023, 8:06 PMDavid Herman
11/13/2023, 8:11 PMVampire
11/13/2023, 8:16 PMIvan CLOVIS Canet
11/13/2023, 8:28 PMimplementation with that added capability?
This way, Gradle would automatically figure out which subset of dependencies from the implementation configuration have that capability, during the dependency resolution phase, so you could trust that all libraries left are the ones you're interested in?David Herman
11/13/2023, 8:29 PM