Skip to content

Commit

Permalink
Put the namespaces(packages) into the json files (#39593)
Browse files Browse the repository at this point in the history
* Put the namespaces(packages) into the json files

* Add missing function end curly

* Updates for testing

* remove last fetch template usage

* Actually return the packageInfo object from GetDocsMsDevLanguageSpecificPackageInfoFn

* revert the docindex changes

* remove the testing changes from template's ci.yml
  • Loading branch information
JimSuplizio authored Apr 9, 2024
1 parent dc8f815 commit b295475
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 211 deletions.
22 changes: 0 additions & 22 deletions eng/pipelines/templates/stages/archetype-java-release-batch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -353,17 +353,6 @@ stages:
- metadata/
DocValidationImageId: "$(DocValidationImageId)"

- ${{ each artifact in parameters.Artifacts }}:
- ${{if ne(artifact.skipPublishDocMs, 'true')}}:
- template: /eng/pipelines/templates/steps/fetch-package-list.yml
parameters:
JavaDocJarLocation: "$(Pipeline.Workspace)/${{parameters.ArtifactName}}/${{artifact.groupId}}/${{artifact.name}}"
ArtifactName: ${{artifact.name}}
TargetBranch: $(TargetBranchName)
DocRepoLocation: $(DocRepoLocation)
TargetDocRepoName: ${{parameters.TargetDocRepoName}}
TargetDocRepoOwner: "Azure"

- deployment: PublishDocs
displayName: Publish Docs to GitHubIO Blob Storage
condition: and(succeeded(), ne(variables['Skip.PublishDocs'], 'true'))
Expand Down Expand Up @@ -518,15 +507,4 @@ stages:
- metadata/
DocValidationImageId: "$(DocValidationImageId)"

- ${{ each artifact in parameters.Artifacts }}:
- ${{if ne(artifact.skipPublishDocMs, 'true')}}:
- template: /eng/pipelines/templates/steps/fetch-package-list.yml
parameters:
JavaDocJarLocation: "$(Pipeline.Workspace)/${{parameters.ArtifactName}}/${{artifact.groupId}}/${{artifact.name}}"
ArtifactName: ${{artifact.name}}
TargetBranch: $(TargetBranchName)
DocRepoLocation: $(DocRepoLocation)
TargetDocRepoName: ${{parameters.TargetDocRepoName}}
TargetDocRepoOwner: "azure-sdk"

- template: /eng/common/pipelines/templates/steps/docsms-ensure-validation.yml
11 changes: 0 additions & 11 deletions eng/pipelines/templates/stages/archetype-java-release-patch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -273,17 +273,6 @@ stages:
- metadata/
DocValidationImageId: "$(DocValidationImageId)"

- ${{ each artifact in parameters.Artifacts }}:
- ${{if ne(artifact.skipPublishDocMs, 'true')}}:
- template: /eng/pipelines/templates/steps/fetch-package-list.yml
parameters:
JavaDocJarLocation: "$(Pipeline.Workspace)/${{parameters.ArtifactName}}/${{artifact.groupId}}/${{artifact.name}}"
ArtifactName: ${{artifact.name}}
TargetBranch: $(TargetBranchName)
DocRepoLocation: $(DocRepoLocation)
TargetDocRepoName: ${{parameters.TargetDocRepoName}}
TargetDocRepoOwner: "Azure"

- deployment: PublishDocs
displayName: Publish Docs to GitHubIO Blob Storage
condition: and(succeeded(), ne(variables['Skip.PublishDocs'], 'true'))
Expand Down
19 changes: 0 additions & 19 deletions eng/pipelines/templates/stages/archetype-java-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,6 @@ stages:
- docs-ref-services/
- metadata/
DocValidationImageId: "$(DocValidationImageId)"
- template: /eng/pipelines/templates/steps/fetch-package-list.yml
parameters:
JavaDocJarLocation: "$(Pipeline.Workspace)/${{parameters.ArtifactName}}/${{artifact.groupId}}/${{artifact.name}}"
ArtifactName: ${{artifact.name}}
TargetBranch: $(TargetBranchName)
DocRepoLocation: $(DocRepoLocation)
TargetDocRepoName: ${{parameters.TargetDocRepoName}}
TargetDocRepoOwner: "Azure"

- ${{if ne(artifact.skipPublishDocGithubIo, 'true')}}:
- deployment: PublishDocs
Expand Down Expand Up @@ -495,15 +487,4 @@ stages:
- metadata/
DocValidationImageId: "$(DocValidationImageId)"

- ${{ each artifact in parameters.Artifacts }}:
- ${{if ne(artifact.skipPublishDocMs, 'true')}}:
- template: /eng/pipelines/templates/steps/fetch-package-list.yml
parameters:
JavaDocJarLocation: "$(Pipeline.Workspace)/${{parameters.ArtifactName}}/${{artifact.groupId}}/${{artifact.name}}"
ArtifactName: ${{artifact.name}}
TargetBranch: $(TargetBranchName)
DocRepoLocation: $(DocRepoLocation)
TargetDocRepoName: ${{parameters.TargetDocRepoName}}
TargetDocRepoOwner: "azure-sdk"

- template: /eng/common/pipelines/templates/steps/docsms-ensure-validation.yml
29 changes: 0 additions & 29 deletions eng/pipelines/templates/steps/fetch-package-list.yml

This file was deleted.

49 changes: 0 additions & 49 deletions eng/scripts/Fetch-PackageList-Javadoc.ps1

This file was deleted.

29 changes: 28 additions & 1 deletion eng/scripts/Language-Settings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function Get-java-PackageInfoFromPackageFile ($pkg, $workingDirectory)
$pkgId = $contentXML.project.artifactId
$docsReadMeName = $pkgId -replace "^azure-" , ""
$pkgVersion = $contentXML.project.version
$groupId = if ($contentXML.project.groupId -eq $null) { $contentXML.project.parent.groupId } else { $contentXML.project.groupId }
$groupId = if ($null -eq $contentXML.project.groupId) { $contentXML.project.parent.groupId } else { $contentXML.project.groupId }
$releaseNotes = ""
$readmeContent = ""

Expand Down Expand Up @@ -141,6 +141,33 @@ function Get-java-PackageInfoFromPackageFile ($pkg, $workingDirectory)
}
}

# Defined in common.ps1 as:
# $GetDocsMsDevLanguageSpecificPackageInfoFn = "Get-${Language}-DocsMsDevLanguageSpecificPackageInfo"
function Get-java-DocsMsDevLanguageSpecificPackageInfo($packageInfo, $packageSourceOverride) {
# If the default namespace isn't in the package info then it needs to be added
# Can't check if (!$packageInfo.Namespaces) in strict mode because Namespaces won't exist
# at all.
if (!($packageInfo | Get-Member Namespaces)) {
$version = $packageInfo.Version
# If the dev version is set, use that
if ($packageInfo.DevVersion) {
$version = $packageInfo.DevVersion
}
$namespaces = Fetch-Namespaces-From-Javadoc $packageInfo.Name $packageInfo.Group $version
if ($namespaces.Count -gt 0) {
$packageInfo | Add-Member -Type NoteProperty -Name "Namespaces" -Value $namespaces
} else {
# If nothing else, the package name will have "-" instead of "." which should make it evident
# that we couldn't find namespaces.
LogWarning "Unable to find namespaces for $($packageInfo.Name):$version, using the package name."
$tempNamespaces = @()
$tempNamespaces += $packageInfo.Name
$packageInfo | Add-Member -Type NoteProperty -Name "Namespaces" -Value $tempNamespaces
}
}
return $packageInfo
}

# Stage and Upload Docs to blob Storage
function Publish-java-GithubIODocs ($DocLocation, $PublicArtifactLocation)
{
Expand Down
Loading

0 comments on commit b295475

Please sign in to comment.