This is inside my android main, how can I access f...
# multiplatform
b
This is inside my android main, how can I access from my shared. Is there another library I need to install?
s
p
Or just write a simple gradle task that generates it, no need to pull another dependency
b
I am using buildKonfig
Doesn’t work
p
Its doesn't cache it's tasks, I wouldn't use it
b
Write a simple gradle task? Not sure what you mean, I’m a noobie. Sorry
p
Create a task, let it generate a source file to the generated build dir and apply that task to your projects.
but Android is a bit special and needs
registerJavaGeneratingTask
instead
actually if you're only targeting Android, then create the fields in defaultConfig and override them in flavors
p
That's not incremental neither
e
it's not cacheable, you mean? true, but by Gradle's own documentation, "Some tasks, like Copy or Jar, usually do not make sense to make cacheable because Gradle is only copying files from one location to another. It also doesn’t make sense to make tasks cacheable that do not produce outputs or have no task actions." something like this is just copying from the build script to a file
p
It's not just copying
e
pulling it out of cache is no better than re-running the task
p
It's generating source files and will trigger recompilations afaik
e
only if the inputs change
well, in this case the "inputs" include the build script due to the use of
doLast
, so that's unfortunate, but can be remedied by defining the task elsewhere properly
p
Or even simpler: just let your app module inject a simple data class into your modules