@@ -66,6 +66,28 @@ function Update-NuspecFiles ([string] $version) {
66
66
}
67
67
}
68
68
69
+ # -------------------------------------------------------------------------------
70
+ # Update <releaseNotes> element in UnitsNet.nuspec
71
+ # -------------------------------------------------------------------------------
72
+ function Update-NuspecFileReleaseNotes ([string ] $releaseInfo ) {
73
+ $nugetReleaseNotesPattern = ' <releaseNotes>.*?</releaseNotes>' ;
74
+ $nugetReleaseNotes = ' <releaseNotes>' + $releaseInfo + ' </releaseNotes>' ;
75
+
76
+ Get-ChildItem ..\ - r | Where { $_.PSChildName -match " ^UnitsNet\.nuspec$" } | ForEach-Object {
77
+ $filename = $_.Directory.ToString () + ' \' + $_.Name
78
+ $filename + ' -> ' + $releaseInfo
79
+
80
+ # If you are using a source control that requires to check-out files before
81
+ # modifying them, make sure to check-out the file here.
82
+ # For example, TFS will require the following command:
83
+ # tf checkout $filename
84
+
85
+ (Get-Content $filename - Encoding UTF8) | ForEach-Object {
86
+ % {$_ -replace $nugetReleaseNotesPattern , $nugetReleaseNotes }
87
+ } | Set-Content $filename - Encoding UTF8
88
+ }
89
+ }
90
+
69
91
# -------------------------------------------------------------------------------
70
92
# Parse arguments.
71
93
# -------------------------------------------------------------------------------
@@ -80,7 +102,9 @@ while ($version -notmatch "[0-9]+(\.([0-9]+|\*)){1,3}") {
80
102
}
81
103
}
82
104
105
+ $releaseNotes = Read-Host ' Enter release notes for .nuspec file'
106
+
83
107
Update-AssemblyInfoFiles $version
84
108
Update-NuspecFiles $version
85
-
109
+ Update-NuspecFileReleaseNotes $releaseNotes
86
110
0 commit comments