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

Commit 3365745

Browse files
committed
Appveyor does assembly info patch
1 parent 8732c4a commit 3365745

File tree

2 files changed

+9
-23
lines changed

2 files changed

+9
-23
lines changed

.build/default.ps1

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ FormatTaskName (("-"*25) + "[{0}]" + ("-"*25))
3333

3434
Task default -depends Clean, Build, Package
3535

36-
Task Build -depends Restore-Packages, Update-AssemblyInfoFiles {
36+
Task Build -depends Restore-Packages {
3737
exec { . $MSBuild $SolutionFile /t:Build /v:normal /p:Configuration=$Configuration }
3838
exec { . $MSBuild $SolutionFile /t:Build /v:normal /p:Configuration=$Configuration-Net45 }
3939
}
@@ -60,25 +60,3 @@ Task Install-MSBuild {
6060
}
6161

6262
Task Install-BuildTools -depends Install-MSBuild
63-
64-
# Borrowed from Luis Rocha's Blog (http://www.luisrocha.net/2009/11/setting-assembly-version-with-windows.html)
65-
Task Update-AssemblyInfoFiles {
66-
$assemblyVersionPattern = 'AssemblyVersion\("[0-9]+(\.([0-9]+|\*)){1,3}"\)'
67-
$fileVersionPattern = 'AssemblyFileVersion\("[0-9]+(\.([0-9]+|\*)){1,3}"\)'
68-
$fileCommitPattern = 'AssemblyInformationalVersion\("(.*?)"\)'
69-
70-
$assemblyVersion = 'AssemblyVersion("' + $Version + '")';
71-
$fileVersion = 'AssemblyFileVersion("' + $Version + '")';
72-
$commitVersion = 'AssemblyInformationalVersion("' + $InformationalVersion + '")';
73-
74-
Get-ChildItem -path $SolutionRoot -r -filter AssemblyInfo.cs | ForEach-Object {
75-
$filename = $_.Directory.ToString() + '\' + $_.Name
76-
$filename + ' -> ' + $Version
77-
78-
(Get-Content $filename) | ForEach-Object {
79-
% {$_ -replace $assemblyVersionPattern, $assemblyVersion } |
80-
% {$_ -replace $fileVersionPattern, $fileVersion } |
81-
% {$_ -replace $fileCommitPattern, $commitVersion }
82-
} | Set-Content $filename
83-
}
84-
}

appveyor.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,20 @@ configuration: Release
2525
build_script:
2626
- cmd: .\build.bat Package
2727

28+
assembly_info:
29+
patch: true
30+
file: AssemblyInfo.*
31+
assembly_version: "{version}"
32+
assembly_file_version: "{version}"
33+
assembly_informational_version: "{version}"
34+
2835
# to disable automatic tests
2936
test: off
3037

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

41+
3442
#---------------------------------#
3543
# artifacts configuration #
3644
#---------------------------------#

0 commit comments

Comments
 (0)