I have local and global gradle.properties, the global one is needed to configure the proxy, but it also contains other parameters, wondering what happens if for the same settings you specify different values, which of the files will be in priority or maybe they are How do they merge?
my global gradle.properties
systemProp.http.proxyHost=hostname
systemProp.http.proxyPort=8080
systemProp.http.proxyPassword=password
org.gradle.parallel=false
my local gradle.properties
android.useDeprecatedNdk=true
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx4096M
For example, which org.gradle.parallel
will be used?
Gradle project properties provide an easy way to customise builds which may need to run differently in certain situations. In this article you'll learn the most effective ways to use and set properties, along with some common scenarios you might come across in your Gradle project.
Defining properties via system properties We use the -D command-line option just like in a normal Java application. The name of the system property must start with org. gradle. project , followed by the name of the property we want to set, and then by the value.
According to the Gradle properties, the gradle.properties
files are applied in the following order:
gradle.properties
in project root directory.gradle.properties
in GRADLE_USER_HOME
directory.-Dgradle.user.home
is set on the command line.Because the properties in GRADLE_USER_HOME
are applied after the ones in the project root, they override the ones defined in the project. Assuming that with global you mean the one in the GRADLE_USER_HOME
directory and local the one in your project root, your value for org.gradle.parallel
will be false
.
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