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)
## What is this?

View File

@ -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);

View File

@ -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