Refactoring versioning

Add badge about version
Update README.md
This commit is contained in:
s1lentq 2017-01-14 21:07:12 +07:00
parent 06d943417b
commit faff55df78
3 changed files with 12 additions and 8 deletions

View File

@ -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) Reverse-engineered gamedll (mp.dll / Counter-Strike)
## What is this? ## What is this?

View File

@ -20,7 +20,7 @@ class RegamedllVersionInfo {
String commitURL String commitURL
Integer commitCount Integer commitCount
String asMavenVersion() { String asMavenVersion(boolean extra = true) {
StringBuilder sb = new StringBuilder() StringBuilder sb = new StringBuilder()
sb.append(majorVersion).append('.' + minorVersion); sb.append(majorVersion).append('.' + minorVersion);
if (maintenanceVersion != null) { if (maintenanceVersion != null) {
@ -31,21 +31,23 @@ class RegamedllVersionInfo {
sb.append('.' + commitCount) sb.append('.' + commitCount)
} }
if (suffix) { if (extra && suffix) {
sb.append('-' + suffix) sb.append('-' + suffix)
} }
// do mark for this build like a modified version // do mark for this build like a modified version
if (localChanges) { if (extra && localChanges) {
sb.append('+m'); sb.append('+m');
} }
return sb.toString() return sb.toString()
} }
String asCommitDate() { String asCommitDate(String pattern = null) {
String pattern = "MMM d yyyy"; if (pattern == null) {
if (commitDate.getDayOfMonth() >= 10) { pattern = "MMM d yyyy";
pattern = "MMM d yyyy"; if (commitDate.getDayOfMonth() >= 10) {
pattern = "MMM d yyyy";
}
} }
return DateTimeFormat.forPattern(pattern).withLocale(Locale.ENGLISH).print(commitDate); return DateTimeFormat.forPattern(pattern).withLocale(Locale.ENGLISH).print(commitDate);

View File

@ -390,6 +390,8 @@ task generateAppVersion {
inputs.property('version', rootProject.version) inputs.property('version', rootProject.version)
inputs.property('commitDate', verInfo.asCommitDate()) inputs.property('commitDate', verInfo.asCommitDate())
println "##teamcity[buildNumber '" + verInfo.asMavenVersion(false) + "']";
doLast { doLast {
def templateCtx = [ def templateCtx = [
verInfo: verInfo verInfo: verInfo