I would like to have a properties file that deployed with my application so that I can access it at runtime. How can I have my build.gradle
file access my property file located in src/main/resources
?
I would like to use this file as I would normal use gradle.properties
.
You want to read this properties file in your build.gradle file? You can simply:
def props = new Properties()
file("src/main/resources/my.properties").withInputStream {
stream -> props.load(stream)
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With