diff --git a/README.md b/README.md index ad797642..c1c4cb2b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ReGameDLL_CS [![Build Status](http://teamcity.rehlds.org/app/rest/builds/buildType:(id:ReGameDLLCs_Publish)/statusIcon)](http://teamcity.rehlds.org/viewType.html?buildTypeId=ReGameDLLCs_Publish&guest=1) +# ReGameDLL_CS [![Build Status](http://teamcity.rehlds.org/app/rest/builds/buildType:(id:ReGameDLLCs_Publish)/statusIcon)](http://teamcity.rehlds.org/viewType.html?buildTypeId=ReGameDLLCs_Publish&guest=1) [![Download](http://rehlds.org/version/regamedll.svg)](http://teamcity.rehlds.org/guestAuth/downloadArtifacts.html?buildTypeId=ReGameDLL_Publish&buildId=lastSuccessful) Reverse-engineered gamedll (mp.dll / Counter-Strike) ## What is this? diff --git a/buildSrc/src/main/groovy/versioning/RegamedllVersionInfo.groovy b/buildSrc/src/main/groovy/versioning/RegamedllVersionInfo.groovy index 2b8629f9..99b68e66 100644 --- a/buildSrc/src/main/groovy/versioning/RegamedllVersionInfo.groovy +++ b/buildSrc/src/main/groovy/versioning/RegamedllVersionInfo.groovy @@ -20,7 +20,7 @@ class RegamedllVersionInfo { String commitURL Integer commitCount - String asMavenVersion() { + String asMavenVersion(boolean extra = true) { StringBuilder sb = new StringBuilder() sb.append(majorVersion).append('.' + minorVersion); if (maintenanceVersion != null) { @@ -31,21 +31,23 @@ class RegamedllVersionInfo { sb.append('.' + commitCount) } - if (suffix) { + if (extra && suffix) { sb.append('-' + suffix) } // do mark for this build like a modified version - if (localChanges) { + if (extra && localChanges) { sb.append('+m'); } return sb.toString() } - String asCommitDate() { - String pattern = "MMM d yyyy"; - if (commitDate.getDayOfMonth() >= 10) { - pattern = "MMM d yyyy"; + String asCommitDate(String pattern = null) { + if (pattern == null) { + pattern = "MMM d yyyy"; + if (commitDate.getDayOfMonth() >= 10) { + pattern = "MMM d yyyy"; + } } return DateTimeFormat.forPattern(pattern).withLocale(Locale.ENGLISH).print(commitDate); diff --git a/regamedll/build.gradle b/regamedll/build.gradle index a0f24d3f..34cf2449 100644 --- a/regamedll/build.gradle +++ b/regamedll/build.gradle @@ -390,6 +390,8 @@ task generateAppVersion { inputs.property('version', rootProject.version) inputs.property('commitDate', verInfo.asCommitDate()) + println "##teamcity[buildNumber '" + verInfo.asMavenVersion(false) + "']"; + doLast { def templateCtx = [ verInfo: verInfo