File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
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'" />
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 >
3643
3744 <Target Name =" ExportApi" DependsOnTargets =" ExportApiCrossTarget;ExportApiInner" Condition =" '$(GenerateAPIListing)' == 'true'" />
3845
Original file line number Diff line number Diff line change 1+ # !/usr/bin/env pwsh
2+ # Copyright (c) Microsoft Corporation. All rights reserved.
3+ # Licensed under the MIT License.
4+
5+ param (
6+ [Parameter (Mandatory = $true )]
7+ [string ]$FilePath
8+ )
9+
10+ if (Test-Path $FilePath ) {
11+ $content = Get-Content - Path $FilePath - Raw
12+ # Replace CRLF with LF
13+ $content = $content -replace " `r`n " , " `n "
14+ # Replace any remaining CR with LF
15+ $content = $content -replace " `r " , " `n "
16+ # Write back without adding extra newline
17+ Set-Content - Path $FilePath - Value $content - NoNewline
18+ }
You can’t perform that action at this time.
0 commit comments