From 3ed24bfcd1f3a6c2f9d96b636d698d042d534ff6 Mon Sep 17 00:00:00 2001 From: Genteure Date: Sun, 24 Nov 2019 09:38:31 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=99=E6=89=80=E6=9C=89=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20BuildInfo=20&=20=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E7=9A=84=20flv=20=E9=87=8C=E6=A0=87=E8=AE=B0=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E7=9A=84=E7=89=88=E6=9C=AC=E5=8F=B7=E8=80=8C=E4=B8=8D=E6=98=AF?= =?UTF-8?q?=20TEST?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- BililiveRecorder.Core/BililiveRecorder.Core.csproj | 4 ++++ BililiveRecorder.Core/RecordedRoom.cs | 2 +- .../BililiveRecorder.FlvProcessor.csproj | 4 ++++ BililiveRecorder.WPF/BililiveRecorder.WPF.csproj | 3 +-- BililiveRecorder.WPF/BuildInfo.txt => BuildInfo.txt | 2 +- CI/patch_buildinfo.ps1 | 2 +- 7 files changed, 13 insertions(+), 6 deletions(-) rename BililiveRecorder.WPF/BuildInfo.txt => BuildInfo.txt (85%) diff --git a/.gitignore b/.gitignore index 8f1c07b..1003e6c 100644 --- a/.gitignore +++ b/.gitignore @@ -261,5 +261,5 @@ paket-files/ __pycache__/ *.pyc -BililiveRecorder.WPF/BuildInfo.cs +**/BuildInfo.cs BililiveRecorder.WPF/Nlog.config diff --git a/BililiveRecorder.Core/BililiveRecorder.Core.csproj b/BililiveRecorder.Core/BililiveRecorder.Core.csproj index a5f8668..5d5e5cc 100644 --- a/BililiveRecorder.Core/BililiveRecorder.Core.csproj +++ b/BililiveRecorder.Core/BililiveRecorder.Core.csproj @@ -24,4 +24,8 @@ + + cd $(SolutionDir) +powershell -ExecutionPolicy Bypass -File .\CI\patch_buildinfo.ps1 Core + \ No newline at end of file diff --git a/BililiveRecorder.Core/RecordedRoom.cs b/BililiveRecorder.Core/RecordedRoom.cs index 3abff2a..e85f2ce 100644 --- a/BililiveRecorder.Core/RecordedRoom.cs +++ b/BililiveRecorder.Core/RecordedRoom.cs @@ -283,7 +283,7 @@ namespace BililiveRecorder.Core }, { "version", - "TEST" + BuildInfo.Version + " " + BuildInfo.HeadShaShort }, { "roomid", diff --git a/BililiveRecorder.FlvProcessor/BililiveRecorder.FlvProcessor.csproj b/BililiveRecorder.FlvProcessor/BililiveRecorder.FlvProcessor.csproj index e475f58..c59c5ae 100644 --- a/BililiveRecorder.FlvProcessor/BililiveRecorder.FlvProcessor.csproj +++ b/BililiveRecorder.FlvProcessor/BililiveRecorder.FlvProcessor.csproj @@ -20,4 +20,8 @@ + + cd $(SolutionDir) +powershell -ExecutionPolicy Bypass -File .\CI\patch_buildinfo.ps1 FlvProcessor + \ No newline at end of file diff --git a/BililiveRecorder.WPF/BililiveRecorder.WPF.csproj b/BililiveRecorder.WPF/BililiveRecorder.WPF.csproj index 5eaf67d..d69ca3c 100644 --- a/BililiveRecorder.WPF/BililiveRecorder.WPF.csproj +++ b/BililiveRecorder.WPF/BililiveRecorder.WPF.csproj @@ -196,7 +196,6 @@ ResXFileCodeGenerator Resources.Designer.cs - @@ -225,7 +224,7 @@ cd $(SolutionDir) -PowerShell -ExecutionPolicy Bypass -File .\CI\patch_buildinfo.ps1 +powershell -ExecutionPolicy Bypass -File .\CI\patch_buildinfo.ps1 WPF copy /y .\BililiveRecorder.WPF\Nlog.$(ConfigurationName).config .\BililiveRecorder.WPF\NLog.config diff --git a/BililiveRecorder.WPF/BuildInfo.txt b/BuildInfo.txt similarity index 85% rename from BililiveRecorder.WPF/BuildInfo.txt rename to BuildInfo.txt index d0e504f..71c021a 100644 --- a/BililiveRecorder.WPF/BuildInfo.txt +++ b/BuildInfo.txt @@ -1,4 +1,4 @@ -namespace BililiveRecorder.WPF +namespace BililiveRecorder.[PROJECT_NAME] { internal class BuildInfo { diff --git a/CI/patch_buildinfo.ps1 b/CI/patch_buildinfo.ps1 index a5c7443..bedfc1e 100644 --- a/CI/patch_buildinfo.ps1 +++ b/CI/patch_buildinfo.ps1 @@ -4,4 +4,4 @@ $isAppveyor = if ($env:APPVEYOR -eq $null) { "false" } else { $env:APPVEYOR } $buildversion = if ($env:APPVEYOR_BUILD_VERSION -eq $null) { "本地编译" } else { $env:APPVEYOR_BUILD_VERSION } $githash = git rev-parse --verify HEAD -(Get-Content .\BililiveRecorder.WPF\BuildInfo.txt).Replace('[APPVEYOR]', $isAppveyor.ToLower()).Replace('[VERSION]', $buildversion).Replace('[GIT_HASH]', $githash).Replace('[GIT_HASH_S]', $githash.Substring(0, 8)) | Set-Content .\BililiveRecorder.WPF\BuildInfo.cs +(Get-Content .\BuildInfo.txt).Replace('[PROJECT_NAME]', $args).Replace('[APPVEYOR]', $isAppveyor.ToLower()).Replace('[VERSION]', $buildversion).Replace('[GIT_HASH]', $githash).Replace('[GIT_HASH_S]', $githash.Substring(0, 8)) | Set-Content ".\BililiveRecorder.$args\BuildInfo.cs"