PckStudio.csproj - Added condition to only aquire commit hash and branch name when in debug mode

This commit is contained in:
miku-666
2023-05-04 14:37:40 +02:00
parent 7777fb21ca
commit bef679dc82
2 changed files with 3 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2023-present miku-666, MattNL
/* Copyright (c) 2023-present miku-666
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.

View File

@@ -18,7 +18,7 @@
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<Target Name="GetGitHash" BeforeTargets="WriteGitInfo" Condition="'$(BuildHash)' == ''">
<Target Name="GetGitHash" BeforeTargets="WriteGitInfo" Condition="'$(Configuration)' == 'Debug' AND '$(BuildHash)' == ''">
<!-- write hash and branch to console.-->
<Exec Command="git -C $(ProjectDir) describe --always" ConsoleToMsBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="GitHash" />
@@ -31,7 +31,7 @@
<BuildBranch>$(GitBranch)</BuildBranch>
</PropertyGroup>
</Target>
<Target Name="WriteGitInfo" BeforeTargets="CoreCompile">
<Target Name="WriteGitInfo" BeforeTargets="CoreCompile" Condition="'$(Configuration)' == 'Debug'">
<!-- names the obj/.../GitAssemblyInfo.cs file -->
<PropertyGroup>
<GitAssemblyInfoFile>$(IntermediateOutputPath)GitAssemblyInfo.cs</GitAssemblyInfoFile>