Hi! I have library that targets the JVM and JS. I ...
# multiplatform
o
Hi! I have library that targets the JVM and JS. I would like to have function/API (runtime) to retrieve my artefact version. However, the version is only available in the gradle build scripts. Is there a smart way to inject the version to my code so that my consumers can retreive it?
f
You can use a Gradle plugin that generates a kotlin file containing the necessary data, like BuildKonfig which is for multiplatform projects.
o
Thanks 🙂
I ended up reading the package.json with an expect/actual method. 🙂
require('../package.json').version