File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,37 @@ function Update-Icon {
3131 $xml.Save ($Path )
3232}
3333
34+ function Update-Versions {
35+ param (
36+ [string ]$Path
37+ )
38+ $Path = Resolve-Path $Path
39+ [xml ] $xml = Get-Content $Path
40+
41+ foreach ($dependency in $xml.package.metadata.dependencies.group.dependency ){
42+ if ($dependency.id -eq " MaterialDesignColors" ) {
43+ $dependency.version = Get-VersionString $MDIXColorsVersion
44+ } elseif ($dependency.id -eq " MaterialDesignThemes" ) {
45+ $dependency.version = Get-VersionString $MDIXVersion
46+ }
47+ }
48+ $xml.Save ($Path )
49+ }
50+
51+ function Get-VersionString {
52+ param (
53+ [string ]$Version
54+ )
55+
56+ $callback = {
57+ [int ]$args [0 ].Value + 1
58+ }
59+
60+ $re = [regex ]" ^\d+"
61+ $nextVersion = $re.Replace ($Version , $callback )
62+ return " [$Version ,$nextVersion )"
63+ }
64+
3465function New-Nuget {
3566 param (
3667 [string ]$NuSpecPath ,
@@ -44,6 +75,10 @@ function New-Nuget {
4475
4576Push-Location " $ ( Join-Path $PSScriptRoot " .." ) "
4677
78+ Update-Versions .\MaterialDesignColors.nuspec
79+ Update-Versions .\MaterialDesignThemes.nuspec
80+ Update-Versions .\MaterialDesignThemes.MahApps.nuspec
81+
4782New-Nuget .\MaterialDesignColors.nuspec $MDIXColorsVersion
4883New-Nuget .\MaterialDesignThemes.nuspec $MDIXVersion
4984New-Nuget .\MaterialDesignThemes.MahApps.nuspec $MDIXMahAppsVersion
You can’t perform that action at this time.
0 commit comments