forked from MaterialDesignInXAML/MaterialDesignInXamlToolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUpdateNugets.ps1
More file actions
34 lines (27 loc) · 1.09 KB
/
UpdateNugets.ps1
File metadata and controls
34 lines (27 loc) · 1.09 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
param(
[string]$Path,
[string]$MDIXVersion = "1.0.0",
[string]$MDIXColorsVersion = "1.0.0",
[string]$MDIXMahAppsVersion = "1.0.0"
)
function Get-VersionString {
param (
[string]$Version
)
$incrementCallback = {
[int]$args[0].Groups[1].Value + 1
}
$releaseVersionCallback = {
"$($args[0].Groups[1].Value).$($args[0].Groups[2].Value)"
}
$re = [regex]"^(\d+)\.(\d+\.\d+).*"
$releaseVersion = $re.Replace($Version, $releaseVersionCallback)
$nextVersion = $re.Replace($Version, $incrementCallback)
return "[$releaseVersion,$nextVersion)"
}
Push-Location "$(Join-Path $PSScriptRoot "..")"
$Path = Resolve-Path $Path
nupkgwrench nuspec dependencies modify "$Path" --dependency-id "MaterialDesignThemes" --dependency-version "$(Get-VersionString $MDIXVersion)"
nupkgwrench nuspec dependencies modify "$Path" --dependency-id "MaterialDesignColors" --dependency-version "$(Get-VersionString $MDIXColorsVersion)"
nupkgwrench nuspec dependencies modify "$Path" --dependency-id "MaterialDesignThemes.MahApps" --dependency-version "$(Get-VersionString $MDIXMahAppsVersion)"
Pop-Location