Skip to content
This repository has been archived by the owner on Jul 9, 2023. It is now read-only.

Commit

Permalink
Fix appveyor building twice
Browse files Browse the repository at this point in the history
  • Loading branch information
justcoding121 committed Dec 25, 2015
1 parent dfe1687 commit 27ad1dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 25 deletions.
28 changes: 3 additions & 25 deletions .build/default.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ Task Build -depends Restore-Packages {
exec { . $MSBuild $SolutionFile /t:Build /v:normal /p:Configuration=$Configuration-Net45 }
}

Task Package -depends Update-AssemblyInfoFiles, Build {
Task Package -depends Build {
exec { . $NuGet pack "$SolutionRoot\Titanium.Web.Proxy\Titanium.Web.Proxy.nuspec" -Properties Configuration=$Configuration -OutputDirectory "$SolutionRoot" -Version "$Version" }
}

Task Clean {
Task Clean -depends Install-BuildTools {
Remove-Item -Path "$SolutionRoot\packages\*" -Exclude repositories.config -Recurse -Force
Get-ChildItem .\ -include bin,obj -Recurse | foreach ($_) { Remove-Item $_.fullname -Force -Recurse }
exec { . $MSBuild $SolutionFile /t:Clean /v:quiet }
}

Task Restore-Packages -depends Install-BuildTools {
Task Restore-Packages {
exec { . $NuGet restore $SolutionFile }
}

Expand All @@ -60,25 +60,3 @@ Task Install-MSBuild {
}

Task Install-BuildTools -depends Install-MSBuild

# Borrowed from Luis Rocha's Blog (http://www.luisrocha.net/2009/11/setting-assembly-version-with-windows.html)
Task Update-AssemblyInfoFiles {
$assemblyVersionPattern = 'AssemblyVersion\("[0-9]+(\.([0-9]+|\*)){1,3}"\)'
$fileVersionPattern = 'AssemblyFileVersion\("[0-9]+(\.([0-9]+|\*)){1,3}"\)'
$fileCommitPattern = 'AssemblyInformationalVersion\("(.*?)"\)'

$assemblyVersion = 'AssemblyVersion("' + $Version + '")';
$fileVersion = 'AssemblyFileVersion("' + $Version + '")';
$commitVersion = 'AssemblyInformationalVersion("' + $InformationalVersion + '")';

Get-ChildItem -path $SolutionRoot -r -filter AssemblyInfo.cs | ForEach-Object {
$filename = $_.Directory.ToString() + '\' + $_.Name
$filename + ' -> ' + $Version

(Get-Content $filename) | ForEach-Object {
% {$_ -replace $assemblyVersionPattern, $assemblyVersion } |
% {$_ -replace $fileVersionPattern, $fileVersion } |
% {$_ -replace $fileCommitPattern, $commitVersion }
} | Set-Content $filename
}
}
4 changes: 4 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ assembly_info:
# to disable automatic tests
test: off

# skip building commits that add tags (such as release tag)
skip_tags: true


#---------------------------------#
# artifacts configuration #
#---------------------------------#
Expand Down

0 comments on commit 27ad1dc

Please sign in to comment.