Hello How can I include `some-gradle.properties`...
# gradle
i
Hello How can I include
some-gradle.properties
into main
gradle.properties
and get variables defined in it from
settings.gradle.kts
or
build.gradle.kts
?
m
I'm not sure
*.properties
file can include other
*.properties
files. Given that they're supposed to contain key/value properties, I doubt this is possible but maybe there's a way.
What you can do is load your
some-gradle.properties
file dynamically. Build scripts are code so nothing prevents you to do something like:
Copy code
val props = Properties()
File("/path/file.properties").inputStream.use { props.load(it) }
You'd then have your properties in
props
i
actually I am looking for a way to get my defined vars in other properties files like just
MY_VARIABLE
and not
props["MY_VARIABLE"]
or any other ways
e
Copy code
val MY_VARIABLE: String by props
i
and what about 50 vars?
m
Do that 50 times ? 😅
😅 3