From 085c634cd1100d8421ea3f94cbfdc4c5c9875998 Mon Sep 17 00:00:00 2001 From: RaiKoHoff Date: Tue, 11 Feb 2020 09:26:09 +0100 Subject: [PATCH] + chg: add commit-id file for local build version patches --- .gitignore | 7 ++++--- Version.ps1 | 16 +++++++++++----- Versions/commit_id.txt | 1 + 3 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 Versions/commit_id.txt diff --git a/.gitignore b/.gitignore index 26767c098..c69468aaa 100644 --- a/.gitignore +++ b/.gitignore @@ -43,7 +43,9 @@ Thumbs.db /Build/Signing/Password.txt /distrib/Notepad3*.exe -/Notepad3.VC.VC.opendb +/Version_*.cmd +/Versions/build.txt +/Versions/commit_id.txt /res/Notepad3.exe.manifest.conf /minipath/res/Notepad3.exe.manifest.conf @@ -51,9 +53,8 @@ Thumbs.db /minipath/src/VersionEx.h /test/test.log +/Notepad3.VC.VC.opendb -/Version_*.cmd -/Versions/build.txt /np3portableapp/*.7z /np3portableapp/*.paf.exe /np3portableapp/_buildname.txt diff --git a/Version.ps1 b/Version.ps1 index c6f5588fa..b260e90af 100644 --- a/Version.ps1 +++ b/Version.ps1 @@ -37,11 +37,17 @@ try $Minor = [int]$(Get-Date -format yy) $Revis = [int]$(Get-Date -format MMdd) if ($AppVeyorEnv) { - $CommitID = ([string]($env:appveyor_repo_commit)).substring(0,7) + $CommitID = ([string]($env:appveyor_repo_commit)).substring(0,8) $Build = [int]($env:appveyor_build_number) } else { - $CommitID = [string]($env:computername) + $CommitID = [string](Get-Content "Versions\commit_id.txt") + if ($CommitID -eq "computername") { + $CommitID = ([string]($env:computername)).substring(0,8).ToLower() + } + else { + $CommitID = $CommitID.substring(0,8) + } $Build = [int](Get-Content "Versions\build.txt") + 1 } if (!$CommitID) { $CommitID = "---" } @@ -59,6 +65,9 @@ try $CompleteVer = "$Major.$Minor.$Revis.$Build" DebugOutput("Version number: 'v$CompleteVer $VerPatch'") + if ($AppVeyorEnv) { + Update-AppveyorBuild -Version $CompleteVer + } #~if ($VerPatch) { $VerPatch = " $VerPatch" } # ensure space in front of string @@ -80,9 +89,6 @@ try (Get-Content "res\Notepad3.exe.manifest.conf") | ForEach-Object { $_ -replace '\$APPNAME\$', "$AppName" } | Set-Content "res\Notepad3.exe.manifest.conf" (Get-Content "res\Notepad3.exe.manifest.conf") | ForEach-Object { $_ -replace '\$VERPATCH\$', "$VerPatch" } | Set-Content "res\Notepad3.exe.manifest.conf" (Get-Content "res\Notepad3.exe.manifest.conf") | ForEach-Object { $_ -replace '\$VERSION\$', "$CompleteVer" } | Set-Content "res\Notepad3.exe.manifest.conf" - if ($AppVeyorEnv) { - Update-AppveyorBuild -Version $CompleteVer - } } catch { diff --git a/Versions/commit_id.txt b/Versions/commit_id.txt new file mode 100644 index 000000000..59418530f --- /dev/null +++ b/Versions/commit_id.txt @@ -0,0 +1 @@ +computername