Skip to content

Instantly share code, notes, and snippets.

@elevenetc
Created March 31, 2014 11:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elevenetc/9890225 to your computer and use it in GitHub Desktop.
Save elevenetc/9890225 to your computer and use it in GitHub Desktop.
Gradle naming class
class Versions{
public final String projectName
public final String nameVersion
public final int codeVersion
Versions(String projectName, String nameVersion, int codeVersion) {
this.codeVersion = codeVersion
this.nameVersion = nameVersion
this.projectName = projectName
}
public def getFileName(){
return projectName + "-" + "v" + nameVersion + getBuildVersion() + "-vCode" + codeVersion + ".apk"
}
public def getBuildVersion(){
if(!hasProperty('teamcity')){
return "";
}else{
tc = this['teamcity']
return "-build" + tc.get('teamcity.build.id')
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment