给所有项目添加 BuildInfo & 输出的 flv 里标记正确的版本号而不是 TEST

This commit is contained in:
Genteure 2019-11-24 09:38:31 +08:00
parent 724d87c4ac
commit 3ed24bfcd1
7 changed files with 13 additions and 6 deletions

2
.gitignore vendored
View File

@ -261,5 +261,5 @@ paket-files/
__pycache__/
*.pyc
BililiveRecorder.WPF/BuildInfo.cs
**/BuildInfo.cs
BililiveRecorder.WPF/Nlog.config

View File

@ -24,4 +24,8 @@
<ItemGroup>
<ProjectReference Include="..\BililiveRecorder.FlvProcessor\BililiveRecorder.FlvProcessor.csproj" />
</ItemGroup>
<PropertyGroup>
<PreBuildEvent>cd $(SolutionDir)
powershell -ExecutionPolicy Bypass -File .\CI\patch_buildinfo.ps1 Core</PreBuildEvent>
</PropertyGroup>
</Project>

View File

@ -283,7 +283,7 @@ namespace BililiveRecorder.Core
},
{
"version",
"TEST"
BuildInfo.Version + " " + BuildInfo.HeadShaShort
},
{
"roomid",

View File

@ -20,4 +20,8 @@
<PackageReference Include="Autofac" Version="4.8.1" />
<PackageReference Include="NLog" Version="4.5.10" />
</ItemGroup>
<PropertyGroup>
<PreBuildEvent>cd $(SolutionDir)
powershell -ExecutionPolicy Bypass -File .\CI\patch_buildinfo.ps1 FlvProcessor</PreBuildEvent>
</PropertyGroup>
</Project>

View File

@ -196,7 +196,6 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="BuildInfo.txt" />
<None Include="Properties\app.manifest" />
<Resource Include="ico.ico" />
<Content Include="NLog.config">
@ -225,7 +224,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>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</PreBuildEvent>
</PropertyGroup>
<PropertyGroup>

View File

@ -1,4 +1,4 @@
namespace BililiveRecorder.WPF
namespace BililiveRecorder.[PROJECT_NAME]
{
internal class BuildInfo
{

View File

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