Hey guys, in an Android Project we can use `BuildC...
# gradle
k
Hey guys, in an Android Project we can use
BuildConfig
to set some variables from the Gradle file. What's the equivalent in a Kotlin Project ?
n
i do not use android but it should be the same.. even when using the gradle kotlin-dsl
the same cass should be available and the build process does not change drastically afaik
d
k
Doesn't gradle provide natively a way to set environment variables?
@Nikky BuildConfig is an android gradle plugin concept, it is not available on plain kotlin projects
n
oh i thinght you meant using kotlin in android
well what i do to get data from the buildscript into my code is a plugin in
buildSrc
hat adds a generated src root, generates some files in there using kotlin-poet and adds that task to run before kotlinCompile
but i do not know of anything ready to use out of the box
226 Views