Skip to content
This repository has been archived by the owner on Apr 21, 2021. It is now read-only.

Commit

Permalink
Appveyor does assembly info patch
Browse files Browse the repository at this point in the history
  • Loading branch information
justcoding121 committed Dec 25, 2015
1 parent 8732c4a commit 3365745
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 23 deletions.
24 changes: 1 addition & 23 deletions .build/default.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ FormatTaskName (("-"*25) + "[{0}]" + ("-"*25))

Task default -depends Clean, Build, Package

Task Build -depends Restore-Packages, Update-AssemblyInfoFiles {
Task Build -depends Restore-Packages {
exec { . $MSBuild $SolutionFile /t:Build /v:normal /p:Configuration=$Configuration }
exec { . $MSBuild $SolutionFile /t:Build /v:normal /p:Configuration=$Configuration-Net45 }
}
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
}
}
8 changes: 8 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,20 @@ configuration: Release
build_script:
- cmd: .\build.bat Package

assembly_info:
patch: true
file: AssemblyInfo.*
assembly_version: "{version}"
assembly_file_version: "{version}"
assembly_informational_version: "{version}"

# 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 3365745

Please sign in to comment.