Repository navigation
Expand file tree
/
Copy pathsetversion.ps1
More file actions
53 lines (42 loc) · 1.89 KB
/
Copy pathsetversion.ps1
File metadata and controls
53 lines (42 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<#
.SYNOPSIS
Set a single consistent version string for each OneMore project, including the installer.
.PARAMETER version
The version string to apply. Must be of the form major.minor.patch.
.COPYRIGHT
Copyright © 2016 Steven M Cohn. All rights reserved.
#>
param (
[Parameter(Mandatory = $true)]
[ValidatePattern({^\d+\.\d+\.\d+$})]
[string] $version
)
Begin
{
}
Process
{
$0 = '.\OneMore\Properties\AssemblyInfo.cs'
$content = (Get-Content $0) -replace 'Version = "\d+\.\d+(?:\.\d+)?";',"Version = ""$version"";"
$content | Out-File $0 -Force
$0 = '.\OneMoreCalendar\Properties\AssemblyInfo.cs'
$content = (Get-Content $0) -replace 'Version = "\d+\.\d+(?:\.\d+)?";',"Version = ""$version"";"
$content | Out-File $0 -Force
$0 = '.\OneMoreCli\Properties\AssemblyInfo.cs'
$content = (Get-Content $0) -replace 'Version = "\d+\.\d+(?:\.\d+)?";',"Version = ""$version"";"
$content | Out-File $0 -Force
$0 = '.\OneMoreProtocolHandler\Properties\AssemblyInfo.cs'
$content = (Get-Content $0) -replace 'Version = "\d+\.\d+(?:\.\d+)?";',"Version = ""$version"";"
$content | Out-File $0 -Force
$0 = '.\OneMoreSetupActions\Properties\AssemblyInfo.cs'
$content = (Get-Content $0) -replace 'Version = "\d+\.\d+(?:\.\d+)?";',"Version = ""$version"";"
$content | Out-File $0 -Force
$0 = '.\OneMoreTray\Properties\AssemblyInfo.cs'
$content = (Get-Content $0) -replace 'Version = "\d+\.\d+(?:\.\d+)?";',"Version = ""$version"";"
$content | Out-File $0 -Force
# note that ProductVersion is overridden by build.ps1 using a /p:ProductVersion= argument,
# so this is just a default value, but make it obvious here that we've bumped the version
$0 = '.\OneMoreSetup\OneMoreSetup.wixproj'
$content = (Get-Content $0) -replace '(<ProductVersion[^>]*>)\d+\.\d+(?:\.\d+)?(</ProductVersion>)', "`${1}$version`${2}"
$content | Out-File $0 -Force
}