Skip to content

Commit b3ce381

Browse files
committed
Add one more missing docs function
1 parent 95170f0 commit b3ce381

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

eng/scripts/Language-Settings.ps1

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,45 @@ function SetPackageVersion ($PackageName, $Version, $ReleaseDate, $ReplaceLatest
4343
-ReleaseDate $ReleaseDate -ReplaceLatestEntryTitle $ReplaceLatestEntryTitle
4444
}
4545

46+
# Parse out package publishing information given a maven POM file
47+
function Get-android-PackageInfoFromPackageFile ($pkg, $workingDirectory)
48+
{
49+
[xml]$contentXML = Get-Content $pkg
50+
51+
$pkgId = $contentXML.project.artifactId
52+
$docsReadMeName = $pkgId -replace "^azure-" , ""
53+
$pkgVersion = $contentXML.project.version
54+
$groupId = if ($contentXML.project.groupId -eq $null) { $contentXML.project.parent.groupId } else { $contentXML.project.groupId }
55+
$releaseNotes = ""
56+
$readmeContent = ""
57+
58+
# 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)
59+
if ($pkgVersion.Contains("SNAPSHOT")) {
60+
return $null
61+
}
62+
63+
$changeLogLoc = @(Get-ChildItem -Path $pkg.DirectoryName -Recurse -Include "$($pkg.Basename)-changelog.md")[0]
64+
if ($changeLogLoc) {
65+
$releaseNotes = Get-ChangeLogEntryAsString -ChangeLogLocation $changeLogLoc -VersionString $pkgVersion
66+
}
67+
68+
$readmeContentLoc = @(Get-ChildItem -Path $pkg.DirectoryName -Recurse -Include "$($pkg.Basename)-readme.md")[0]
69+
if ($readmeContentLoc) {
70+
$readmeContent = Get-Content -Raw $readmeContentLoc
71+
}
72+
73+
return New-Object PSObject -Property @{
74+
PackageId = $pkgId
75+
GroupId = $groupId
76+
PackageVersion = $pkgVersion
77+
ReleaseTag = "$($pkgId)_$($pkgVersion)"
78+
Deployable = $forceCreate -or !(IsMavenPackageVersionPublished -pkgId $pkgId -pkgVersion $pkgVersion -groupId $groupId.Replace(".", "/"))
79+
ReleaseNotes = $releaseNotes
80+
ReadmeContent = $readmeContent
81+
DocsReadMeName = $docsReadMeName
82+
}
83+
}
84+
4685
function Publish-android-GithubIODocs ($DocLocation, $PublicArtifactLocation)
4786
{
4887
$PublishedDocs = Get-ChildItem "$DocLocation" | Where-Object -FilterScript {$_.Name.EndsWith("-javadoc.jar")}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=1.0.0-beta.5
1+
version=1.0.0-beta.6

0 commit comments

Comments
 (0)