File tree Expand file tree Collapse file tree 3 files changed +16
-26
lines changed Expand file tree Collapse file tree 3 files changed +16
-26
lines changed Original file line number Diff line number Diff line change 3232 <Target
3333 Name =" ExportApiInner"
3434 DependsOnTargets =" Build;RemoveExistingListings;GenerateReferenceAssemblySource"
35- Condition =" '$(IsInnerBuild)' == 'true'" >
36-
37- <!-- Normalize line endings to LF using PowerShell Core -->
38- <ItemGroup >
39- <_ApiListingFiles Include =" $(GenAPITargetPath)" Condition =" Exists('$(GenAPITargetPath)')" />
40- </ItemGroup >
41- <Exec Command =" pwsh -NoProfile -ExecutionPolicy Bypass -File " $(MSBuildThisFileDirectory)scripts/Normalize-LineEndings.ps1" -FilePath " %(_ApiListingFiles.Identity)" " Condition =" '@(_ApiListingFiles)' != ''" />
42- </Target >
35+ Condition =" '$(IsInnerBuild)' == 'true'" />
4336
4437 <Target Name =" ExportApi" DependsOnTargets =" ExportApiCrossTarget;ExportApiInner" Condition =" '$(GenerateAPIListing)' == 'true'" />
4538
Original file line number Diff line number Diff line change @@ -20,6 +20,21 @@ $diagnosticArguments = ($debugLogging -and $logsFolder) ? "/binarylogger:$logsFo
2020
2121dotnet 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
2222
23+ # Normalize line endings to LF in generated API listing files
24+ Write-Host " Normalizing line endings in API listing files"
25+ $apiListingFiles = Get-ChildItem - Path " $PSScriptRoot /../../sdk/$ServiceDirectory /*/api/*.cs" - ErrorAction SilentlyContinue
26+ foreach ($file in $apiListingFiles ) {
27+ $content = Get-Content - Path $file.FullName - Raw
28+ if ($content ) {
29+ # Replace CRLF with LF
30+ $content = $content -replace " `r`n " , " `n "
31+ # Replace any remaining CR with LF
32+ $content = $content -replace " `r " , " `n "
33+ # Write back without adding extra newline
34+ Set-Content - Path $file.FullName - Value $content - NoNewline
35+ }
36+ }
37+
2338if ($SpellCheckPublicApiSurface ) {
2439 Write-Host " Spell check public API surface"
2540 & " $PSScriptRoot /../common/spelling/Invoke-Cspell.ps1" `
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments