Skip to content

Commit

Permalink
GITBORK if Git isn't working.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunstrike committed Nov 30, 2013
1 parent de0a33f commit 5012c3a
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions build.gradle
Expand Up @@ -52,13 +52,24 @@ minecraft {
version = '1.6.4-9.11.1.964'
assetDir = 'run/assets'
}

// sets version to the slimeKnights version format
task buildInfo {
def cmd = "git rev-parse --short HEAD"
def proc = cmd.execute()
ext.revision = proc.text.trim()
if (proc.exitValue() == 0) {
ext.revision = proc.text.trim()
} else {
ext.revision = "GITBORK"
}

if (System.getenv().BUILD_NUMBER != null) {
ext.buildNum = System.getenv().BUILD_NUMBER
} else {
ext.buildNum = "DEV"
}
}
version = "${minecraft.version}-${System.getenv().BUILD_NUMBER}-${project.buildInfo.revision}"
version = "${minecraft.version}-${project.buildInfo.buildNum}.${project.buildInfo.revision}"

sourceSets {
main {
Expand Down

0 comments on commit 5012c3a

Please sign in to comment.