Skip to content
Snippets Groups Projects
Commit 928d4bc0 authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Include ConfigurationName in Prepare-Build.

There is no need to have this only as a post-build event, providing it
at this stage will allow us to include it in the assembly information.
parent 818db607
No related branches found
No related tags found
No related merge requests found
......@@ -171,11 +171,11 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>PowerShell -NoProfile -ExecutionPolicy RemoteSigned $(SolutionDir)\Scripts\Prepare-Build.ps1 $(ProjectDir)</PreBuildEvent>
<PreBuildEvent>PowerShell -NoProfile -ExecutionPolicy RemoteSigned $(SolutionDir)\Scripts\Prepare-Build.ps1 -ProjectDir $(ProjectDir) -ConfigurationName $(ConfigurationName)</PreBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PostBuildEvent>PowerShell -Command "Write-Host $(ConfigurationName)" &gt; $(ProjectDir)\Resources\BuildConfiguration.txt
</PostBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
......
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True)][string] $ProjectDir
[Parameter(Mandatory=$True)][string] $ProjectDir,
[Parameter(Mandatory=$True)][string] $ConfigurationName
)
function Write-BuildDetails {
......@@ -81,14 +82,20 @@ $Date = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'
$BCommit = "$($ProjectDir)\Resources\BuildCommit.txt"
$BuildDate = "$($ProjectDir)\Resources\BuildDate.txt"
$BuildConfig = "$($ProjectDir)\Resources\BuildConfiguration.txt"
$BuildDetailsCS = "$($ProjectDir)\..\Resources\BuildDetails.cs"
Write-Output $CommitName > $BCommit
Write-Output $Date > $BuildDate
Write-Output $CommitName > $BCommit
Write-Output $ConfigurationName > $BuildConfig
Write-Output "build-date: $($Date)"
Write-Output "git-branch: $($GitBranch)"
Write-Output "git-description: $($CommitName)$($StatusWarning)"
Write-Output $(
"build-config: [$($ConfigurationName)]"
"build-date: [$($Date)]"
"git-branch: [$($GitBranch)]"
"git-describe: [$($CommitName)]$($StatusWarning)"
)
Write-BuildDetails $BuildDetailsCS $DescItems $GitBranch $Date
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment