diff --git a/build.gradle b/build.gradle index 82956f983..93e317a99 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ buildscript { def gitVersion = { -> def stdout = new ByteArrayOutputStream() exec { - commandLine 'git', 'describe', '--tags', '--always' + commandLine 'git', 'describe', '--tags', '--always', '--dirty' standardOutput = stdout } return stdout.toString().trim() diff --git a/opentasks/build.gradle b/opentasks/build.gradle index 0acdc0e0b..39cf6c9fc 100644 --- a/opentasks/build.gradle +++ b/opentasks/build.gradle @@ -95,5 +95,22 @@ dependencies { if (project.hasProperty('PLAY_STORE_SERVICE_ACCOUNT_CREDENTIALS')) { play { serviceAccountCredentials = file(PLAY_STORE_SERVICE_ACCOUNT_CREDENTIALS) + // the track is determined automatically by the version number format + switch (version){ + case ~/^(\d+)(\.\d+)*-\d+-[\w\d]+-dirty$/: + // work in progress goes to the internal track + track = "internal" + break + case ~/^(\d+)(\.\d+)*-\d+-[\w\d]+$/: + // untagged commits go to alpha + track = "alpha" + break + case ~/^(\d+)(\.\d+)*$/: + // tagged commits to go beta, from where they get promoted to releases + track = "beta" + break + default: + throw new IllegalArgumentException("Unrecognized version format") + } } } \ No newline at end of file