@@ -14,9 +14,6 @@ The Name of the servicedirectory, usually the name of the service e.g. core
1414. PARAMETER ArtifactsDirectoryName
1515Used 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
2118The root of the Azure-SDK-for-Net Repo
2219
@@ -32,16 +29,14 @@ Directory Name: PopImport: https://azuresdkartifacts.blob.core.windows.net/azure
3229RepoRoot\doc\ApiDocGeneration
3330
3431#>
35-
32+
3633[CmdletBinding ()]
3734Param (
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
7065Write-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-
9083Write-Verbose " Package Location ${PackageLocation} "
9184
9285Write-Verbose " Create Directories Required for Doc Generation"
@@ -101,41 +94,19 @@ mkdir $YamlOutDir
10194Write-Verbose " Creating DocOutDir '$DocOutDir '"
10295mkdir $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"'
212183Set-Content - Path $baseUrl - Value $mutatedContent - NoNewline
213184
214185Write-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
0 commit comments