From 0cd537cce58cf71e9720df9dbb099636c448b0d5 Mon Sep 17 00:00:00 2001 From: James Montemagno Date: Mon, 9 Oct 2017 21:02:03 -0700 Subject: [PATCH] Update build.ps1 --- build.ps1 | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/build.ps1 b/build.ps1 index 3a8ef5c..1bc3444 100644 --- a/build.ps1 +++ b/build.ps1 @@ -148,6 +148,32 @@ if (!(Test-Path $NUGET_EXE)) { } } +$newVersion = $env:APPVEYOR_BUILD_VERSION.Replace("-beta","") +$configFiles = Get-ChildItem . *.csproj -rec +$assemblyVersionString = "" + $newVersion + "" +$assemblyFileVersionString = "" + $newVersion + "" +$versionString = "" + $newVersion + "" +foreach ($file in $configFiles) +{ + (Get-Content $file.PSPath) | + Foreach-Object { $_ -replace "1.0.0.0", $assemblyVersionString } | + Set-Content $file.PSPath +} + +foreach ($file in $configFiles) +{ + (Get-Content $file.PSPath) | + Foreach-Object { $_ -replace "1.0.0.0", $assemblyFileVersionString } | + Set-Content $file.PSPath +} + +foreach ($file in $configFiles) +{ + (Get-Content $file.PSPath) | + Foreach-Object { $_ -replace "1.0.0.0", $versionString } | + Set-Content $file.PSPath +} + # Save nuget.exe path to environment to be available to child processed $ENV:NUGET_EXE = $NUGET_EXE @@ -186,4 +212,4 @@ if (!(Test-Path $CAKE_EXE)) { # Start Cake Write-Host "Running build script..." Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" $UseMono $UseDryRun $UseExperimental $ScriptArgs" -exit $LASTEXITCODE \ No newline at end of file +exit $LASTEXITCODE