Skip to content

Commit

Permalink
Update build.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmontemagno authored Oct 10, 2017
1 parent a07ec3b commit 0cd537c
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,32 @@ if (!(Test-Path $NUGET_EXE)) {
}
}

$newVersion = $env:APPVEYOR_BUILD_VERSION.Replace("-beta","")
$configFiles = Get-ChildItem . *.csproj -rec
$assemblyVersionString = "<AssemblyVersion>" + $newVersion + "</AssemblyVersion>"
$assemblyFileVersionString = "<AssemblyFileVersion>" + $newVersion + "</AssemblyFileVersion>"
$versionString = "<Version>" + $newVersion + "</Version>"
foreach ($file in $configFiles)
{
(Get-Content $file.PSPath) |
Foreach-Object { $_ -replace "<AssemblyVersion>1.0.0.0</AssemblyVersion>", $assemblyVersionString } |
Set-Content $file.PSPath
}

foreach ($file in $configFiles)
{
(Get-Content $file.PSPath) |
Foreach-Object { $_ -replace "<AssemblyFileVersion>1.0.0.0</AssemblyFileVersion>", $assemblyFileVersionString } |
Set-Content $file.PSPath
}

foreach ($file in $configFiles)
{
(Get-Content $file.PSPath) |
Foreach-Object { $_ -replace "<Version>1.0.0.0</Version>", $versionString } |
Set-Content $file.PSPath
}

# Save nuget.exe path to environment to be available to child processed
$ENV:NUGET_EXE = $NUGET_EXE

Expand Down Expand Up @@ -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
exit $LASTEXITCODE

0 comments on commit 0cd537c

Please sign in to comment.