Last active
May 23, 2016 20:52
-
-
Save philippreston/e3a078c6bc888782cfa4582cda314085 to your computer and use it in GitHub Desktop.
Create version file in Gradle (See AppConfig.groovy)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def version_major = 0 | |
def version_minor = 1 | |
def version_patch = 0 | |
def version_release = "BETA" | |
group 'org.company' | |
version "${version_major}.${version_minor}.${version_patch}.${version_release}" | |
task setVersion() { | |
def appProperties = new File("src/main/resources/application.properties") | |
appProperties.withWriter { writer -> | |
writer.write("app.version.major=${version_major}\n") | |
writer.write("app.version.minor=${version_minor}\n") | |
writer.write("app.version.patch=${version_patch}\n") | |
writer.write("app.version.release=${version_release}\n") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment