|
1 | 1 | [CmdletBinding()] |
2 | 2 | param ( |
3 | 3 | [Parameter(Position=0)] |
4 | | - [ValidateNotNullOrEmpty()] |
5 | 4 | [string] $ServiceDirectory, |
6 | 5 | [string] $SDKType = "all", |
7 | | - [switch] $SpellCheckPublicApiSurface |
| 6 | + [switch] $SpellCheckPublicApiSurface, |
| 7 | + [string] $PackagePath, |
| 8 | + [string] $SdkRepoPath |
8 | 9 | ) |
9 | 10 |
|
10 | 11 | if ($SpellCheckPublicApiSurface -and -not (Get-Command 'npx')) { |
11 | 12 | Write-Error "Could not locate npx. Install NodeJS (includes npm and npx) https://nodejs.org/en/download/" |
12 | 13 | exit 1 |
13 | 14 | } |
14 | 15 |
|
| 16 | +$relativePackagePath = if ($PackagePath) { |
| 17 | + Resolve-Path -Relative -RelativeBasePath (Join-Path $SdkRepoPath "sdk") -Path $PackagePath |
| 18 | +} else { |
| 19 | + $ServiceDirectory |
| 20 | +} |
| 21 | + |
15 | 22 | $servicesProj = Resolve-Path "$PSScriptRoot/../service.proj" |
16 | 23 |
|
17 | 24 | $debugLogging = $env:SYSTEM_DEBUG -eq "true" |
18 | 25 | $logsFolder = $env:BUILD_ARTIFACTSTAGINGDIRECTORY |
19 | 26 | $diagnosticArguments = ($debugLogging -and $logsFolder) ? "/binarylogger:$logsFolder/exportapi.binlog" : "" |
20 | 27 |
|
21 | | -dotnet build /t:ExportApi /p:RunApiCompat=false /p:InheritDocEnabled=false /p:GeneratePackageOnBuild=false /p:Configuration=Release /p:IncludeSamples=false /p:IncludePerf=false /p:IncludeStress=false /p:IncludeTests=false /p:Scope="$ServiceDirectory" /p:SDKType=$SDKType /restore $servicesProj $diagnosticArguments |
| 28 | +dotnet build /t:ExportApi /p:RunApiCompat=false /p:InheritDocEnabled=false /p:GeneratePackageOnBuild=false /p:Configuration=Release /p:IncludeSamples=false /p:IncludePerf=false /p:IncludeStress=false /p:IncludeTests=false /p:Scope="$relativePackagePath" /p:SDKType=$SDKType /restore $servicesProj $diagnosticArguments |
22 | 29 |
|
23 | 30 | # Normalize line endings to LF in generated API listing files |
24 | 31 | Write-Host "Normalizing line endings in API listing files" |
25 | | -$apiListingFiles = Get-ChildItem -Path "$PSScriptRoot/../../sdk/$ServiceDirectory/*/api/*.cs" -ErrorAction SilentlyContinue |
| 32 | +$apiListingFiles = Get-ChildItem -Path "$PSScriptRoot/../../sdk/$relativePackagePath/*/api/*.cs" -ErrorAction SilentlyContinue |
26 | 33 | foreach ($file in $apiListingFiles) { |
27 | 34 | $content = Get-Content -Path $file.FullName -Raw |
28 | 35 | if ($content) { |
|
0 commit comments