The Include Properties plugin allows you to include external .properties files into your Gradle project,
optionally overriding existing properties.
- License: MIT
- Author: JTorleon Studios Team
- Public Maven Repository: https://jtorleon-studios-team-github-io.pages.dev/
- Public Github Repository: https://github.com/jtorleon-studios-team/gradle-include-properties
Add the public Maven repository in your settings.gradle:
pluginManagement {
repositories {
maven {
url = 'https://jtorleon-studios-team-github-io.pages.dev/maven'
}
}
}Then apply the plugin in your build.gradle:
plugin {
id 'gradle-include-properties' version '1.0.0'
}expectedProperties {
expected = [
"my_key_1",
"my_key_2",
"my_key_3"
]
}This block can be used after project evaluation to verify that certain keys exist.
org.gradle.jvmargs=-Xmx4G
# etc...
include.properties=extra.properties
include.properties.override=trueinclude.propertiescan be a single file, multiple files (comma-separated), or directories.include.properties.overridedetermines if properties in included files override existing ones.
extra.properties:
my_key_1=a
my_key_2=b
my_key_3=ctask printProperties {
doLast {
println "my_key_1 <- ${project.findProperty('my_key_1')}"
println "my_key_2 <- ${project.findProperty('my_key_2')}"
println "my_key_3 <- ${project.findProperty('my_key_3')}"
}
}include.properties=file1.properties,../file2.properties,my-directory
include.properties.override=trueAll properties from the listed files/directories will be loaded, optionally overriding existing values.