Skip to content

Commit

Permalink
Update build.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmontemagno committed Oct 3, 2017
1 parent 6403fe9 commit 1a603a2
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion build.ps1
Expand Up @@ -148,6 +148,31 @@ if (!(Test-Path $NUGET_EXE)) {
}
}

$configFiles = Get-ChildItem . *.csproj -rec
$assemblyVersionString = "<AssemblyVersion>" + $env:APPVEYOR_BUILD_VERSION + "</AssemblyVersion>"
$assemblyFileVersionString = "<AssemblyFileVersion>" + $env:APPVEYOR_BUILD_VERSION + "</AssemblyFileVersion>"
$versionString = "<Version>" + $env:APPVEYOR_BUILD_VERSION + "</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 +211,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 1a603a2

Please sign in to comment.