Skip to content

Commit 47fd179

Browse files
authored
Unset the SDKType environment variable for API Docs Gen (#45080)
* Unset the SDKType environment variable for API Docs Gen * Unsetting didn't work, try a different approach * set /p:BuildInParallel=false on the build commands * for the want of a quote, the kingdom fell * change the mgmt build commands, if those work the if statements will be consolidated * Remove libtype, everything is Taco Bell
1 parent 8ad44c5 commit 47fd179

File tree

2 files changed

+18
-48
lines changed

2 files changed

+18
-48
lines changed

doc/ApiDocGeneration/Generate-Api-Docs.ps1

Lines changed: 18 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ The Name of the servicedirectory, usually the name of the service e.g. core
1414
.PARAMETER ArtifactsDirectoryName
1515
Used in the case where the package directory name is different from the package name. e.g in cognitiveservice packages
1616
17-
.PARAMETER LibType
18-
Specifies if its a client or management library
19-
2017
.PARAMETER RepoRoot
2118
The root of the Azure-SDK-for-Net Repo
2219
@@ -32,16 +29,14 @@ Directory Name: PopImport: https://azuresdkartifacts.blob.core.windows.net/azure
3229
RepoRoot\doc\ApiDocGeneration
3330
3431
#>
35-
32+
3633
[CmdletBinding()]
3734
Param (
3835
[Parameter(Mandatory = $True)]
3936
$ArtifactName,
4037
[Parameter(Mandatory = $True)]
4138
$ServiceDirectory,
4239
$ArtifactsDirectoryName,
43-
[ValidateSet('client', 'management')]
44-
$LibType = "client",
4540
$RepoRoot = "${PSScriptRoot}/../..",
4641
[Parameter(Mandatory = $True)]
4742
$BinDirectory,
@@ -68,7 +63,9 @@ function UpdateDocIndexFiles([string]$docPath, [string] $mainJsPath) {
6863
}
6964

7065
Write-Verbose "Name Reccuring paths with variable names"
71-
if ([System.String]::IsNullOrEmpty($ArtifactsDirectoryName)) {$ArtifactsDirectoryName = $ArtifactName}
66+
if ([System.String]::IsNullOrEmpty($ArtifactsDirectoryName)) {
67+
$ArtifactsDirectoryName = $ArtifactName
68+
}
7269
$PackageLocation = "${ServiceDirectory}/${ArtifactsDirectoryName}"
7370
$FrameworkDir = "${BinDirectory}/${ArtifactsDirectoryName}/dll-docs"
7471
$ApiDir = "${FrameworkDir}/my-api"
@@ -83,10 +80,6 @@ $DocFxTool = "${BinDirectory}/docfx/docfx.exe"
8380
$DocCommonGenDir = "${RepoRoot}/eng/common/docgeneration"
8481
$GACampaignId = "UA-62780441-41"
8582

86-
if ($LibType -eq 'management') {
87-
$ArtifactName = $ArtifactName.Substring($ArtifactName.LastIndexOf('.Management') + 1)
88-
}
89-
9083
Write-Verbose "Package Location ${PackageLocation}"
9184

9285
Write-Verbose "Create Directories Required for Doc Generation"
@@ -101,41 +94,19 @@ mkdir $YamlOutDir
10194
Write-Verbose "Creating DocOutDir '$DocOutDir'"
10295
mkdir $DocOutDir
10396

104-
if ($LibType -eq 'client') {
105-
Write-Verbose "Build Packages for Doc Generation - Client"
106-
Write-Verbose "dotnet build '${RepoRoot}/eng/service.proj' /p:ServiceDirectory=$PackageLocation /p:IncludeTests=false /p:IncludeSamples=false /p:IncludePerf=false /p:IncludeStress=false /p:OutputPath=$ApiDir"
107-
dotnet build "${RepoRoot}/eng/service.proj" /p:ServiceDirectory=$PackageLocation /p:IncludeTests=false /p:IncludeSamples=false /p:IncludePerf=false /p:IncludeStress=false /p:OutputPath=$ApiDir
108-
if ($LASTEXITCODE -ne 0) {
109-
Log-Warning "Build Packages for Doc Generation - Client failed with $LASTEXITCODE please see output above"
110-
exit 0
111-
}
112-
113-
Write-Verbose "Include Client Dependencies"
114-
Write-Verbose "'${RepoRoot}/eng/service.proj' /p:ServiceDirectory=$PackageLocation /p:IncludeTests=false /p:IncludeSamples=false /p:IncludePerf=false /p:IncludeStress=false /p:OutputPath=$ApiDependenciesDir /p:CopyLocalLockFileAssemblies=true"
115-
dotnet build "${RepoRoot}/eng/service.proj" /p:ServiceDirectory=$PackageLocation /p:IncludeTests=false /p:IncludeSamples=false /p:IncludePerf=false /p:IncludeStress=false /p:OutputPath=$ApiDependenciesDir /p:CopyLocalLockFileAssemblies=true
116-
if ($LASTEXITCODE -ne 0) {
117-
Log-Warning "Include Client Dependencies build failed with $LASTEXITCODE please see output above"
118-
exit 0
119-
}
120-
} elseif ($LibType -eq 'management') {
121-
# Management Package
122-
Write-Verbose "Build Packages for Doc Generation - Management"
123-
Write-Verbose "dotnet msbuild '${RepoRoot}/eng/mgmt.proj' /p:scope=$PackageLocation /p:OutputPath=$ApiDir -maxcpucount:1 -nodeReuse:false"
124-
dotnet msbuild "${RepoRoot}/eng/mgmt.proj" /p:scope=$PackageLocation /p:OutputPath=$ApiDir -maxcpucount:1 -nodeReuse:false
125-
if ($LASTEXITCODE -ne 0) {
126-
Log-Warning "Build Packages for Doc Generation - Management failed with $LASTEXITCODE please see output above"
127-
exit 0
128-
}
129-
130-
Write-Verbose "Include Management Dependencies"
131-
Write-Verbose "dotnet msbuild '${RepoRoot}/eng/mgmt.proj' /p:scope=$PackageLocation /p:OutputPath=$ApiDependenciesDir /p:CopyLocalLockFileAssemblies=true -maxcpucount:1 -nodeReuse:false"
132-
dotnet msbuild "${RepoRoot}/eng/mgmt.proj" /p:scope=$PackageLocation /p:OutputPath=$ApiDependenciesDir /p:CopyLocalLockFileAssemblies=true -maxcpucount:1 -nodeReuse:false
133-
if ($LASTEXITCODE -ne 0) {
134-
Log-Warning "Include Management Dependencies build failed with $LASTEXITCODE please see output above"
135-
exit 0
136-
}
137-
} else {
138-
Log-Warning "'$LibType' is not a supported library type at this time."
97+
Write-Verbose "Build Packages for Doc Generation - Client"
98+
Write-Verbose "dotnet build '${RepoRoot}/eng/service.proj' /p:ServiceDirectory=$ServiceDirectory /p:Project=$ArtifactsDirectoryName /p:IncludeTests=false /p:IncludeSamples=false /p:IncludePerf=false /p:IncludeStress=false /p:BuildInParallel=false /p:OutputPath=$ApiDir"
99+
dotnet build "${RepoRoot}/eng/service.proj" /p:ServiceDirectory=$ServiceDirectory /p:Project=$ArtifactsDirectoryName /p:IncludeTests=false /p:IncludeSamples=false /p:IncludePerf=false /p:IncludeStress=false /p:BuildInParallel=false /p:OutputPath=$ApiDir
100+
if ($LASTEXITCODE -ne 0) {
101+
Log-Warning "Build Packages for Doc Generation - Client failed with $LASTEXITCODE please see output above"
102+
exit 0
103+
}
104+
105+
Write-Verbose "Include Client Dependencies"
106+
Write-Verbose "'${RepoRoot}/eng/service.proj' /p:ServiceDirectory=$ServiceDirectory /p:Project=$ArtifactsDirectoryName /p:IncludeTests=false /p:IncludeSamples=false /p:IncludePerf=false /p:IncludeStress=false /p:BuildInParallel=false /p:OutputPath=$ApiDependenciesDir /p:CopyLocalLockFileAssemblies=true"
107+
dotnet build "${RepoRoot}/eng/service.proj" /p:ServiceDirectory=$ServiceDirectory /p:Project=$ArtifactsDirectoryName /p:IncludeTests=false /p:IncludeSamples=false /p:IncludePerf=false /p:IncludeStress=false /p:BuildInParallel=false /p:OutputPath=$ApiDependenciesDir /p:CopyLocalLockFileAssemblies=true
108+
if ($LASTEXITCODE -ne 0) {
109+
Log-Warning "Include Client Dependencies build failed with $LASTEXITCODE please see output above"
139110
exit 0
140111
}
141112

@@ -212,4 +183,4 @@ $mutatedContent = $mutatedContent -replace $hrefRegex, '"./$1"'
212183
Set-Content -Path $baseUrl -Value $mutatedContent -NoNewline
213184

214185
Write-Verbose "Compress and copy HTML into the staging Area"
215-
Compress-Archive -Path "${DocOutHtmlDir}/*" -DestinationPath "${ArtifactStagingDirectory}/${ArtifactName}/${ArtifactName}.docs.zip" -CompressionLevel Fastest
186+
Compress-Archive -Path "${DocOutHtmlDir}/*" -DestinationPath "${ArtifactStagingDirectory}/${ArtifactName}/${ArtifactName}.docs.zip" -CompressionLevel Fastest

eng/pipelines/templates/steps/archetype-sdk-docs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ steps:
1818
-ArtifactName '${{artifact.name}}'
1919
-ServiceDirectory '${{parameters.ServiceDirectory}}'
2020
-ArtifactsDirectoryName '${{artifact.directoryName}}'
21-
-LibType '${{parameters.LibType}}'
2221
-RepoRoot $(Build.SourcesDirectory)
2322
-BinDirectory $(Build.BinariesDirectory)
2423
-DocGenDir ${{parameters.DocGenerationDir}}

0 commit comments

Comments
 (0)