Quantcast
Viewing all articles
Browse latest Browse all 49

Answer by blacktide for How to set project.version by passing version property on gradle command line?

I've found this to be the easiest and cleanest way, without requiring a gradle.properties file or changing the version variable name.

In build.gradle:

// Note - there is intentionally no equals sign hereversion project.hasProperty('version') ? version : '1.0.0'

From the command line:

./gradlew -Pversion=1.5.2 build

Viewing all articles
Browse latest Browse all 49

Trending Articles