From 1d3719abd91c6b2d1b41e5802bb188ba4e905630 Mon Sep 17 00:00:00 2001 From: RaiKoHoff Date: Mon, 10 Feb 2020 14:57:04 +0100 Subject: [PATCH] + chg: remove AppVeyors build number, add build-of-the-day number, add commit/local build ID --- Version.ps1 | 11 ++++++++--- Versions/VersionEx.h.tpl | 1 + Versions/build.txt | 2 +- res/Notepad3.exe.manifest.conf | 2 +- src/Dialogs.c | 4 ++-- src/VersionEx.h | 5 +++-- 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Version.ps1 b/Version.ps1 index 8df56f916..8568afcb5 100644 --- a/Version.ps1 +++ b/Version.ps1 @@ -36,13 +36,18 @@ try $Major = 5 $Minor = [int]$(Get-Date -format yy) $Revis = [int]$(Get-Date -format MMdd) + #~$Build = [int]($env:appveyor_build_number ) + $Build = [int](Get-Content "Versions\build.txt") if ($AppVeyorEnv) { - $Build = [int]($env:appveyor_build_number) + $CommitID = [string]($env:appveyor_repo_commit) } else { - $Build = [int](Get-Content "Versions\build.txt") + 1 + $CommitID = [string]($env:computername) + $Build = $Build + 1 + $Build | Set-Content "Versions\build.txt" } if (!$Build) { $Build = 0 } + if (!$CommitID) { $CommitID = "0" } $SciVer = [string](Get-Content "scintilla\version.txt") if (!$SciVer) { $SciVer = 0 } $OnigVer = [string](Get-Content "oniguruma\version.txt") @@ -71,6 +76,7 @@ try (Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$TINYEXPRVER\$', "$TinyExprVer" } | Set-Content "src\VersionEx.h" (Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$UTHASHVER\$', "$UtHashVer" } | Set-Content "src\VersionEx.h" (Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$VERPATCH\$', "$VerPatch" } | Set-Content "src\VersionEx.h" + (Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$COMMITID\$', "$CommitID" } | Set-Content "src\VersionEx.h" Copy-Item -LiteralPath "Versions\Notepad3.exe.manifest.tpl" -Destination "res\Notepad3.exe.manifest.conf" -Force (Get-Content "res\Notepad3.exe.manifest.conf") | ForEach-Object { $_ -replace '\$APPNAME\$', "$AppName" } | Set-Content "res\Notepad3.exe.manifest.conf" @@ -89,7 +95,6 @@ catch } finally { - $Build | Set-Content "Versions\build.txt" [Environment]::SetEnvironmentVariable("LASTEXITCODE", $LastExitCode, "User") $host.SetShouldExit($LastExitCode) Write-Host "VersionPatching: Done! Elapsed time: $($stopwatch.Elapsed)." diff --git a/Versions/VersionEx.h.tpl b/Versions/VersionEx.h.tpl index ebd52c812..7649daec5 100644 --- a/Versions/VersionEx.h.tpl +++ b/Versions/VersionEx.h.tpl @@ -16,3 +16,4 @@ #define TINYEXPR_VER $TINYEXPRVER$ #define UTHASH_VER $UTHASHVER$ #define VERSION_PATCH $VERPATCH$ +#define VERSION_COMMIT_ID $COMMITID$ diff --git a/Versions/build.txt b/Versions/build.txt index 44991232b..d00491fd7 100644 --- a/Versions/build.txt +++ b/Versions/build.txt @@ -1 +1 @@ -2725 +1 diff --git a/res/Notepad3.exe.manifest.conf b/res/Notepad3.exe.manifest.conf index 685049582..297c5465c 100644 --- a/res/Notepad3.exe.manifest.conf +++ b/res/Notepad3.exe.manifest.conf @@ -3,7 +3,7 @@ Notepad3 BETA diff --git a/src/Dialogs.c b/src/Dialogs.c index ecd8c7d3e..9a0f11598 100644 --- a/src/Dialogs.c +++ b/src/Dialogs.c @@ -664,7 +664,7 @@ INT_PTR CALLBACK AboutDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR)lParam); if (Globals.hDlgIcon) { SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)Globals.hDlgIcon); } - SetDlgItemText(hwnd, IDC_VERSION, _W(_STRG(VERSION_FILEVERSION_LONG))); + SetDlgItemText(hwnd, IDC_VERSION, _W(_STRG(VERSION_FILEVERSION_LONG)) L" (" _W(_STRG(VERSION_COMMIT_ID)) L")"); static HFONT hFontTitle = NULL; if (hFontTitle) { DeleteObject(hFontTitle); } @@ -891,7 +891,7 @@ INT_PTR CALLBACK AboutDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam // -------------------------------------------------------------------- - StringCchCopy(wchVerInfo, COUNTOF(wchVerInfo), _W(_STRG(VERSION_FILEVERSION_LONG))); + StringCchCopy(wchVerInfo, COUNTOF(wchVerInfo), _W(_STRG(VERSION_FILEVERSION_LONG)) L" (" _W(_STRG(VERSION_COMMIT_ID)) L")"); StringCchCat(wchVerInfo, COUNTOF(wchVerInfo), L"\n" VERSION_COMPILER); StringCchCat(wchVerInfo, COUNTOF(wchVerInfo), L"\n"); diff --git a/src/VersionEx.h b/src/VersionEx.h index 39931a36c..9c4522aad 100644 --- a/src/VersionEx.h +++ b/src/VersionEx.h @@ -8,11 +8,12 @@ #define SAPPNAME "Notepad3" #define VERSION_MAJOR 5 #define VERSION_MINOR 20 -#define VERSION_REV 208 -#define VERSION_BUILD 2725 +#define VERSION_REV 210 +#define VERSION_BUILD 1 #define SCINTILLA_VER 430 #define ONIGURUMA_REGEX_VER 6.9.4 #define UCHARDET_VER 2018.09.27 #define TINYEXPR_VER 2018.05.11 #define UTHASH_VER 2.1.0 #define VERSION_PATCH BETA +#define VERSION_COMMIT_ID local