So I defined a property in `gradle.properties` fil...
# announcements
i
So I defined a property in
gradle.properties
file and got a reference in the
build.gradle.kts
file by declaring a global property:
val api_key: String by project
. I want to use
api_key
in my
Main.kt
, but I can't seem to figure out how to gain access. Searched on StackOverflow and all the results were android related. Can anyone help?
d
Your main program is unrelated to Gradle. What about if you build for production? Gradle won't be anywhere in sight when your program is run then. You should probably put config files for your application somewhere else.
i
can you suggest where?
s
In the application source code / resources folder
135 Views