@@ -183,7 +183,7 @@ Function RunCommand {
183
183
)
184
184
185
185
Write-Color yellow $command
186
- Invoke-Expression " $command "
186
+ & cmd / c $command
187
187
}
188
188
189
189
Function GetDotNetFullName {
@@ -331,7 +331,7 @@ Function GetPreviewFolderPath {
331
331
Return [IO.Path ]::Combine($prefixFolder , " $dotNetVersion .$previewNumberVersion " , $apiDiffFolderName )
332
332
}
333
333
334
- $previewOrRCFolderName = GetPreviewOrRCFolderName $dotNetVersion $previewOrRC $previewNumberVersion
334
+ $previewOrRCFolderName = GetPreviewOrRCFolderName - dotNetVersion $dotNetVersion - previewOrRC $previewOrRC - previewNumberVersion $previewNumberVersion
335
335
Return [IO.Path ]::Combine($prefixFolder , " preview" , $previewOrRCFolderName , $apiDiffFolderName )
336
336
}
337
337
@@ -607,28 +607,27 @@ Function ProcessSdk
607
607
)
608
608
609
609
$beforeDllFolder = " "
610
- DownloadPackage $UseDefaultNuGetFeed $sdkName " Before" $PreviousDotNetVersion $PreviousPreviewOrRC $PreviousPreviewNumberVersion ([ref ]$beforeDllFolder )
610
+ DownloadPackage - useDefaultNuGetFeed $UseDefaultNuGetFeed - sdkName $sdkName - beforeOrAfter " Before" - dotNetVersion $PreviousDotNetVersion - previewOrRC $PreviousPreviewOrRC - previewNumberVersion $PreviousPreviewNumberVersion - resultingPath ([ref ]$beforeDllFolder )
611
611
VerifyPathOrExit $beforeDllFolder
612
612
613
613
$afterDllFolder = " "
614
- DownloadPackage $UseDefaultNuGetFeed $sdkName " After" $CurrentDotNetVersion $CurrentPreviewOrRC $CurrentPreviewNumberVersion ([ref ]$afterDllFolder )
614
+ DownloadPackage - useDefaultNuGetFeed $UseDefaultNuGetFeed - sdkName $sdkName - beforeOrAfter " After" - dotNetVersion $CurrentDotNetVersion - previewOrRC $CurrentPreviewOrRC - previewNumberVersion $CurrentPreviewNumberVersion - resultingPath ([ref ]$afterDllFolder )
615
615
VerifyPathOrExit $afterDllFolder
616
616
617
617
# For AspNetCore and WindowsDesktop, also download NETCore references to provide core assemblies
618
618
$beforeReferenceFolder = " "
619
619
$afterReferenceFolder = " "
620
620
if ($sdkName -eq " AspNetCore" -or $sdkName -eq " WindowsDesktop" ) {
621
- DownloadPackage $UseDefaultNuGetFeed " NETCore" " Before" $PreviousDotNetVersion $PreviousPreviewOrRC $PreviousPreviewNumberVersion ([ref ]$beforeReferenceFolder )
621
+ DownloadPackage - useDefaultNuGetFeed $UseDefaultNuGetFeed - sdkName " NETCore" - beforeOrAfter " Before" - dotNetVersion $PreviousDotNetVersion - previewOrRC $PreviousPreviewOrRC - previewNumberVersion $PreviousPreviewNumberVersion - resultingPath ([ref ]$beforeReferenceFolder )
622
622
VerifyPathOrExit $beforeReferenceFolder
623
-
624
- DownloadPackage $UseDefaultNuGetFeed " NETCore" " After" $CurrentDotNetVersion $CurrentPreviewOrRC $CurrentPreviewNumberVersion ([ref ]$afterReferenceFolder )
623
+ DownloadPackage - useDefaultNuGetFeed $UseDefaultNuGetFeed - sdkName " NETCore" - beforeOrAfter " After" - dotNetVersion $CurrentDotNetVersion - previewOrRC $CurrentPreviewOrRC - previewNumberVersion $CurrentPreviewNumberVersion - resultingPath ([ref ]$afterReferenceFolder )
625
624
VerifyPathOrExit $afterReferenceFolder
626
625
}
627
626
628
627
$targetFolder = [IO.Path ]::Combine($previewFolderPath , " Microsoft.$sdkName .App" )
629
628
RecreateFolder $targetFolder
630
629
631
- RunApiDiff $apiDiffExe $targetFolder $beforeDllFolder $afterDllFolder $currentDotNetFullName $assembliesToExclude $attributesToExclude $previousDotNetFriendlyName $currentDotNetFriendlyName $beforeReferenceFolder $afterReferenceFolder
630
+ RunApiDiff - apiDiffExe $apiDiffExe - outputFolder $targetFolder - beforeFolder $beforeDllFolder - afterFolder $afterDllFolder - tableOfContentsFileNamePrefix $currentDotNetFullName - assembliesToExclude $assembliesToExclude - attributesToExclude $attributesToExclude - beforeFriendlyName $previousDotNetFriendlyName - afterFriendlyName $currentDotNetFriendlyName - beforeReferenceFolder $beforeReferenceFolder - afterReferenceFolder $afterReferenceFolder
632
631
}
633
632
634
633
# ####################
@@ -653,6 +652,9 @@ $IsComparingReleases = ($PreviousDotNetVersion -Ne $CurrentDotNetVersion) -And (
653
652
VerifyPathOrExit $CoreRepo
654
653
VerifyPathOrExit $TmpFolder
655
654
655
+ # Acknowledge UseDefaultNuGetFeed parameter usage for PSScriptAnalyzer
656
+ Write-Verbose " Using default NuGet feed: $UseDefaultNuGetFeed " - Verbose:$false
657
+
656
658
$currentMajorVersion = $CurrentDotNetVersion.Split (" ." )[0 ]
657
659
$InstallApiDiffCommand = " dotnet tool install --global Microsoft.DotNet.ApiDiff.Tool --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet$currentMajorVersion -transport/nuget/v3/index.json --prerelease"
658
660
@@ -663,15 +665,15 @@ if ($InstallApiDiff) {
663
665
664
666
$apiDiffCommand = get-command " apidiff" - ErrorAction SilentlyContinue
665
667
666
- if (-Not $apiDiffCommand )
668
+ if (-Not $apiDiffCommand )
667
669
{
668
670
Write-Error " The command apidiff could not be found. Please first install the tool using the following command: $InstallApiDiffCommand " - ErrorAction Stop
669
671
}
670
672
671
673
$apiDiffExe = $apiDiffCommand.Source
672
674
# # Recreate api-diff folder in core repo folder
673
675
674
- $previewFolderPath = GetPreviewFolderPath $CoreRepo $CurrentDotNetVersion $CurrentPreviewOrRC $CurrentPreviewNumberVersion $IsComparingReleases
676
+ $previewFolderPath = GetPreviewFolderPath - rootFolder $CoreRepo - dotNetVersion $CurrentDotNetVersion - previewOrRC $CurrentPreviewOrRC - previewNumberVersion $CurrentPreviewNumberVersion - IsComparingReleases $IsComparingReleases
675
677
If (-Not (Test-Path - Path $previewFolderPath ))
676
678
{
677
679
Write-Color white " Creating new diff folder: $previewFolderPath "
@@ -681,28 +683,28 @@ If (-Not (Test-Path -Path $previewFolderPath))
681
683
# # Run the ApiDiff commands
682
684
683
685
# Example: "10.0-preview2"
684
- $currentDotNetFullName = GetDotNetFullName $IsComparingReleases $CurrentDotNetVersion $CurrentPreviewOrRC $CurrentPreviewNumberVersion
686
+ $currentDotNetFullName = GetDotNetFullName - IsComparingReleases $IsComparingReleases - dotNetVersion $CurrentDotNetVersion - previewOrRC $CurrentPreviewOrRC - previewNumberVersion $CurrentPreviewNumberVersion
685
687
686
688
# Examples: ".NET 10 Preview 1" and ".NET 10 Preview 2"
687
- $previousDotNetFriendlyName = GetDotNetFriendlyName $PreviousDotNetVersion $PreviousPreviewOrRC $PreviousPreviewNumberVersion
688
- $currentDotNetFriendlyName = GetDotNetFriendlyName $CurrentDotNetVersion $CurrentPreviewOrRC $CurrentPreviewNumberVersion
689
+ $previousDotNetFriendlyName = GetDotNetFriendlyName - DotNetVersion $PreviousDotNetVersion - PreviewOrRC $PreviousPreviewOrRC - PreviewNumberVersion $PreviousPreviewNumberVersion
690
+ $currentDotNetFriendlyName = GetDotNetFriendlyName - DotNetVersion $CurrentDotNetVersion - PreviewOrRC $CurrentPreviewOrRC - PreviewNumberVersion $CurrentPreviewNumberVersion
689
691
690
692
If (-Not $ExcludeNetCore )
691
693
{
692
- ProcessSdk " NETCore" $apiDiffExe $currentDotNetFullName $AssembliesToExcludeFilePath $AttributesToExcludeFilePath $previousDotNetFriendlyName $currentDotNetFriendlyName
694
+ ProcessSdk - sdkName " NETCore" - apiDiffExe $apiDiffExe - currentDotNetFullName $currentDotNetFullName - assembliesToExclude $AssembliesToExcludeFilePath - attributesToExclude $AttributesToExcludeFilePath - previousDotNetFriendlyName $previousDotNetFriendlyName - currentDotNetFriendlyName $currentDotNetFriendlyName
693
695
}
694
696
695
697
If (-Not $ExcludeAspNetCore )
696
698
{
697
- ProcessSdk " AspNetCore" $apiDiffExe $currentDotNetFullName $AssembliesToExcludeFilePath $AttributesToExcludeFilePath $previousDotNetFriendlyName $currentDotNetFriendlyName
699
+ ProcessSdk - sdkName " AspNetCore" - apiDiffExe $apiDiffExe - currentDotNetFullName $currentDotNetFullName - assembliesToExclude $AssembliesToExcludeFilePath - attributesToExclude $AttributesToExcludeFilePath - previousDotNetFriendlyName $previousDotNetFriendlyName - currentDotNetFriendlyName $currentDotNetFriendlyName
698
700
}
699
701
700
702
If (-Not $ExcludeWindowsDesktop )
701
703
{
702
- ProcessSdk " WindowsDesktop" $apiDiffExe $currentDotNetFullName $AssembliesToExcludeFilePath $AttributesToExcludeFilePath $previousDotNetFriendlyName $currentDotNetFriendlyName
704
+ ProcessSdk - sdkName " WindowsDesktop" - apiDiffExe $apiDiffExe - currentDotNetFullName $currentDotNetFullName - assembliesToExclude $AssembliesToExcludeFilePath - attributesToExclude $AttributesToExcludeFilePath - previousDotNetFriendlyName $previousDotNetFriendlyName - currentDotNetFriendlyName $currentDotNetFriendlyName
703
705
}
704
706
705
- CreateReadme $previewFolderPath $currentDotNetFriendlyName $currentDotNetFullName
707
+ CreateReadme - previewFolderPath $previewFolderPath - dotNetFriendlyName $currentDotNetFriendlyName - dotNetFullName $currentDotNetFullName
706
708
707
709
# ####################
708
710
# ## End Execution ###
0 commit comments