Skip to content

Gradle Passing System Properties Switching Environments

authorjapps edited this page Jun 26, 2020 · 2 revisions

You can passit it via -D

test {
    systemProperty "env", System.getProperty("env")
}

Then run Gradle CLI command:

gradle test -Denv=dev

gradle test -Denv=sit

or alternatively,

You can passit it via -P

test {
    systemProperty "env", project.getProperty("env")
}

Blogs

Clone this wiki locally