@@ -86,16 +86,21 @@ function ParseMavenPackage($pkg, $workingDirectory) {
86
86
$pkgId = $contentXML.project.artifactId
87
87
$pkgVersion = $contentXML.project.version
88
88
$groupId = if ($contentXML.project.groupId -eq $null ) { $contentXML.project.parent.groupId } else { $contentXML.project.groupId }
89
+ $releaseNotes = " "
90
+ $readmeContent = " "
89
91
90
92
# if it's a snapshot. return $null (as we don't want to create tags for this, but we also don't want to fail)
91
93
if ($pkgVersion.Contains (" SNAPSHOT" )) {
92
94
return $null
93
95
}
94
96
95
- $releaseNotes = & " ${PSScriptRoot} /../Extract-ReleaseNotes.ps1" - ChangeLogLocation @ (Get-ChildItem - Path $pkg.DirectoryName - Recurse - Include " $ ( $pkg.Basename ) -changelog.md" )[0 ]
97
+ $changeLogLoc = @ (Get-ChildItem - Path $pkg.DirectoryName - Recurse - Include " $ ( $pkg.Basename ) -changelog.md" )[0 ]
98
+ if ($changeLogLoc ) {
99
+ $releaseNotes = & " ${PSScriptRoot} /../Extract-ReleaseNotes.ps1" - ChangeLogLocation $changeLogLoc
100
+ }
96
101
97
102
$readmeContentLoc = @ (Get-ChildItem - Path $pkg.DirectoryName - Recurse - Include " $ ( $pkg.Basename ) -readme.md" )[0 ]
98
- if (Test-Path - Path $readmeContentLoc ) {
103
+ if ($readmeContentLoc ) {
99
104
$readmeContent = Get-Content - Raw $readmeContentLoc
100
105
}
101
106
@@ -155,15 +160,23 @@ function ResolvePkgJson($workFolder) {
155
160
function ParseNPMPackage ($pkg , $workingDirectory ) {
156
161
$workFolder = " $workingDirectory $ ( $pkg.Basename ) "
157
162
$origFolder = Get-Location
163
+ $releaseNotes = " "
164
+ $readmeContent = " "
165
+
158
166
New-Item - ItemType Directory - Force - Path $workFolder
159
167
cd $workFolder
160
168
161
169
tar - xzf $pkg
162
170
163
171
$packageJSON = ResolvePkgJson - workFolder $workFolder | Get-Content | ConvertFrom-Json
164
- $releaseNotes = & " ${PSScriptRoot} /../Extract-ReleaseNotes.ps1" - ChangeLogLocation @ (Get-ChildItem - Path $workFolder - Recurse - Include " CHANGELOG.md" )[0 ]
172
+
173
+ $changeLogLoc = @ (Get-ChildItem - Path $workFolder - Recurse - Include " CHANGELOG.md" )[0 ]
174
+ if ($changeLogLoc ) {
175
+ $releaseNotes = & " ${PSScriptRoot} /../Extract-ReleaseNotes.ps1" - ChangeLogLocation $changeLogLoc
176
+ }
177
+
165
178
$readmeContentLoc = @ (Get-ChildItem - Path $workFolder - Recurse - Include " README.md" )[0 ]
166
- if (Test-Path - Path $readmeContentLoc ) {
179
+ if ($readmeContentLoc ) {
167
180
$readmeContent = Get-Content - Raw $readmeContentLoc
168
181
}
169
182
@@ -208,15 +221,22 @@ function ParseNugetPackage($pkg, $workingDirectory) {
208
221
$workFolder = " $workingDirectory $ ( $pkg.Basename ) "
209
222
$origFolder = Get-Location
210
223
$zipFileLocation = " $workFolder /$ ( $pkg.Basename ) .zip"
224
+ $releaseNotes = " "
225
+ $readmeContent = " "
226
+
211
227
New-Item - ItemType Directory - Force - Path $workFolder
212
228
213
229
Copy-Item - Path $pkg - Destination $zipFileLocation
214
230
Expand-Archive - Path $zipFileLocation - DestinationPath $workFolder
215
231
[xml ] $packageXML = Get-ChildItem - Path " $workFolder /*.nuspec" | Get-Content
216
- $releaseNotes = & " ${PSScriptRoot} /../Extract-ReleaseNotes.ps1" - ChangeLogLocation @ (Get-ChildItem - Path $workFolder - Recurse - Include " CHANGELOG.md" )[0 ]
232
+
233
+ $changeLogLoc = @ (Get-ChildItem - Path $workFolder - Recurse - Include " CHANGELOG.md" )[0 ]
234
+ if ($changeLogLoc ) {
235
+ $releaseNotes = & " ${PSScriptRoot} /../Extract-ReleaseNotes.ps1" - ChangeLogLocation $changeLogLoc
236
+ }
217
237
218
238
$readmeContentLoc = @ (Get-ChildItem - Path $workFolder - Recurse - Include " README.md" )[0 ]
219
- if (Test-Path - Path $readmeContentLoc ) {
239
+ if ($readmeContentLoc ) {
220
240
$readmeContent = Get-Content - Raw $readmeContentLoc
221
241
}
222
242
@@ -269,12 +289,19 @@ function ParsePyPIPackage($pkg, $workingDirectory) {
269
289
270
290
$workFolder = " $workingDirectory $ ( $pkg.Basename ) "
271
291
$origFolder = Get-Location
272
- New-Item - ItemType Directory - Force - Path $workFolder
292
+ $releaseNotes = " "
293
+ $readmeContent = " "
273
294
295
+ New-Item - ItemType Directory - Force - Path $workFolder
274
296
Expand-Archive - Path $pkg - DestinationPath $workFolder
275
- $releaseNotes = & " ${PSScriptRoot} /../Extract-ReleaseNotes.ps1" - ChangeLogLocation @ (Get-ChildItem - Path $workFolder - Recurse - Include " CHANGELOG.md" )[0 ]
297
+
298
+ $changeLogLoc = @ (Get-ChildItem - Path $workFolder - Recurse - Include " CHANGELOG.md" )[0 ]
299
+ if ($changeLogLoc ) {
300
+ $releaseNotes = & " ${PSScriptRoot} /../Extract-ReleaseNotes.ps1" - ChangeLogLocation $changeLogLoc
301
+ }
302
+
276
303
$readmeContentLoc = @ (Get-ChildItem - Path $workFolder - Recurse - Include " README.md" )[0 ]
277
- if (Test-Path - Path $readmeContentLoc ) {
304
+ if ($readmeContentLoc ) {
278
305
$readmeContent = Get-Content - Raw $readmeContentLoc
279
306
}
280
307
Remove-Item $workFolder - Force - Recurse - ErrorAction SilentlyContinue
@@ -291,23 +318,28 @@ function ParsePyPIPackage($pkg, $workingDirectory) {
291
318
function ParseCArtifact ($pkg , $workingDirectory ) {
292
319
$packageInfo = Get-Content - Raw - Path $pkg | ConvertFrom-JSON
293
320
$packageArtifactLocation = (Get-ItemProperty $pkg ).Directory.FullName
321
+ $releaseNotes = " "
322
+ $readmeContent = " "
294
323
295
- $releaseNotes = ExtractReleaseNotes - changeLogLocation @ (Get-ChildItem - Path $packageArtifactLocation - Recurse - Include " CHANGELOG.md" )[0 ]
296
-
324
+ $changeLogLoc = @ (Get-ChildItem - Path $packageArtifactLocation - Recurse - Include " CHANGELOG.md" )[0 ]
325
+ if ($changeLogLoc )
326
+ {
327
+ $releaseNotes = & " ${PSScriptRoot} /../Extract-ReleaseNotes.ps1" - ChangeLogLocation $changeLogLoc
328
+ }
329
+
297
330
$readmeContentLoc = @ (Get-ChildItem - Path $packageArtifactLocation - Recurse - Include " README.md" )[0 ]
298
- if (Test-Path - Path $readmeContentLoc ) {
331
+ if ($readmeContentLoc ) {
299
332
$readmeContent = Get-Content - Raw $readmeContentLoc
300
333
}
301
334
302
335
return New-Object PSObject - Property @ {
303
- PackageId = $packageInfo .name
336
+ PackageId = ' '
304
337
PackageVersion = $packageInfo.version
305
338
# Artifact info is always considered deployable for C becasue it is not
306
339
# deployed anywhere. Dealing with duplicate tags happens downstream in
307
340
# CheckArtifactShaAgainstTagsList
308
341
Deployable = $true
309
342
ReleaseNotes = $releaseNotes
310
- ReadmeContent = $readmeContent
311
343
}
312
344
}
313
345
@@ -410,10 +442,16 @@ function VerifyPackages($pkgRepository, $artifactLocation, $workingDirectory, $a
410
442
exit (1 )
411
443
}
412
444
445
+ $tag = if ($parsedPackage.packageId ) {
446
+ " $ ( $parsedPackage.packageId ) _$ ( $parsedPackage.PackageVersion ) "
447
+ } else {
448
+ $parsedPackage.PackageVersion
449
+ }
450
+
413
451
$pkgList += New-Object PSObject - Property @ {
414
452
PackageId = $parsedPackage.PackageId
415
453
PackageVersion = $parsedPackage.PackageVersion
416
- Tag = ( $parsedPackage .PackageId + " _ " + $parsedPackage .PackageVersion )
454
+ Tag = $tag
417
455
ReleaseNotes = $parsedPackage.ReleaseNotes
418
456
ReadmeContent = $parsedPackage.ReadmeContent
419
457
}
0 commit comments