@@ -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+
4685function Publish-android-GithubIODocs ($DocLocation , $PublicArtifactLocation )
4786{
4887 $PublishedDocs = Get-ChildItem " $DocLocation " | Where-Object - FilterScript {$_.Name.EndsWith (" -javadoc.jar" )}
0 commit comments