Skip to content

Commit

Permalink
Merge branch 'release/8.0.1xx' into darc-release/8.0.1xx-4e5b5b71-566…
Browse files Browse the repository at this point in the history
…4-45d3-9e92-fc39d8fa3920
  • Loading branch information
marek-safar authored Sep 14, 2023
2 parents 5bfdbaf + 364f67b commit bfbca53
Show file tree
Hide file tree
Showing 16 changed files with 312 additions and 177 deletions.
5 changes: 0 additions & 5 deletions eng/SourceBuildPrebuiltBaseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
<UsagePattern IdentityGlob="Nuget.*/*" />
<UsagePattern IdentityGlob="Microsoft.Build.NuGetSdkResolver/*" />

<!-- TODO: Figure out what to do about the netcoreapp ref packages (these are probably being pulled
in via implicit versions and net6 targeting projects (e.g. tests)
https://github.com/dotnet/source-build/issues/3356 -->
<UsagePattern IdentityGlob="Microsoft.*.App.Ref/*6.0*" />

<!-- These are coming in transitively from verious repos (aspnetcore & format). Needs evaluation.
https://github.com/dotnet/source-build/issues/3358. -->
<UsagePattern IdentityGlob="Microsoft.CodeAnalysis.AnalyzerUtilities/*3.3.0*" />
Expand Down
210 changes: 107 additions & 103 deletions eng/Version.Details.xml

Large diffs are not rendered by default.

68 changes: 34 additions & 34 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<SystemCollectionsImmutablePackageVersion>7.0.0</SystemCollectionsImmutablePackageVersion>
<SystemDiagnosticsFileVersionInfoVersion>4.0.0</SystemDiagnosticsFileVersionInfoVersion>
<SystemReflectionMetadataVersion>7.0.0</SystemReflectionMetadataVersion>
<MicrosoftDotNetSignToolVersion>8.0.0-beta.23451.1</MicrosoftDotNetSignToolVersion>
<MicrosoftDotNetSignToolVersion>8.0.0-beta.23461.2</MicrosoftDotNetSignToolVersion>
<MicrosoftWebXdtPackageVersion>7.0.0-preview.22423.2</MicrosoftWebXdtPackageVersion>
<SystemSecurityCryptographyProtectedDataPackageVersion>8.0.0-rc.2.23463.10</SystemSecurityCryptographyProtectedDataPackageVersion>
<SystemCollectionsSpecializedPackageVersion>4.3.0</SystemCollectionsSpecializedPackageVersion>
Expand Down Expand Up @@ -94,7 +94,7 @@
</PropertyGroup>
<PropertyGroup>
<!-- Dependencies from https://github.com/dotnet/format -->
<dotnetformatVersion>8.0.445201</dotnetformatVersion>
<dotnetformatVersion>8.0.446302</dotnetformatVersion>
</PropertyGroup>
<PropertyGroup>
<!-- Dependencies from https://github.com/dotnet/roslyn-analyzers -->
Expand All @@ -103,7 +103,7 @@
</PropertyGroup>
<PropertyGroup>
<!-- Dependencies from https://github.com/Microsoft/msbuild -->
<MicrosoftBuildPackageVersion>17.8.0-preview-23431-02</MicrosoftBuildPackageVersion>
<MicrosoftBuildPackageVersion>17.8.0-preview-23462-02</MicrosoftBuildPackageVersion>
<MicrosoftBuildCurrentPackageVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildCurrentPackageVersion>
<!-- Some tasks and the resolver will need to run in an MSBuild that is older than the very latest,
so target one that matches the version in minimumMSBuildVersion.
Expand All @@ -112,58 +112,58 @@
<MicrosoftBuildPackageVersion Condition="exists('$(RepoRoot)\src\Layout\redist\minimumMSBuildVersion') and '$(DotNetBuildFromSource)' != 'true'">$([System.IO.File]::ReadAllText('$(RepoRoot)\src\Layout\redist\minimumMSBuildVersion').Trim())</MicrosoftBuildPackageVersion>
<MicrosoftBuildFrameworkPackageVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildFrameworkPackageVersion>
<MicrosoftBuildRuntimePackageVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildRuntimePackageVersion>
<MicrosoftBuildLocalizationPackageVersion>17.8.0-preview-23431-02</MicrosoftBuildLocalizationPackageVersion>
<MicrosoftBuildLocalizationPackageVersion>17.8.0-preview-23462-02</MicrosoftBuildLocalizationPackageVersion>
<MicrosoftBuildUtilitiesCorePackageVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildUtilitiesCorePackageVersion>
<MicrosoftBuildTasksCorePackageVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildTasksCorePackageVersion>
<MicrosoftBuildTasksCoreVersion>$(MicrosoftBuildTasksCorePackageVersion)</MicrosoftBuildTasksCoreVersion>
</PropertyGroup>
<PropertyGroup>
<!-- Dependencies from https://github.com/dotnet/templating -->
<MicrosoftTemplateEngineAbstractionsPackageVersion>8.0.100-rc.2.23461.1</MicrosoftTemplateEngineAbstractionsPackageVersion>
<MicrosoftTemplateEngineAbstractionsPackageVersion>8.0.100-rc.2.23462.8</MicrosoftTemplateEngineAbstractionsPackageVersion>
<MicrosoftTemplateEngineEdgePackageVersion>$(MicrosoftTemplateEngineAbstractionsPackageVersion)</MicrosoftTemplateEngineEdgePackageVersion>
<MicrosoftTemplateEngineOrchestratorRunnableProjectsPackageVersion>$(MicrosoftTemplateEngineAbstractionsPackageVersion)</MicrosoftTemplateEngineOrchestratorRunnableProjectsPackageVersion>
<MicrosoftTemplateEngineUtilsPackageVersion>$(MicrosoftTemplateEngineAbstractionsPackageVersion)</MicrosoftTemplateEngineUtilsPackageVersion>
<MicrosoftTemplateSearchCommonPackageVersion>$(MicrosoftTemplateEngineAbstractionsPackageVersion)</MicrosoftTemplateSearchCommonPackageVersion>
<!-- test dependencies -->
<MicrosoftTemplateEngineMocksPackageVersion>$(MicrosoftTemplateEngineAbstractionsPackageVersion)</MicrosoftTemplateEngineMocksPackageVersion>
<MicrosoftTemplateEngineTestHelperPackageVersion>$(MicrosoftTemplateEngineAbstractionsPackageVersion)</MicrosoftTemplateEngineTestHelperPackageVersion>
<MicrosoftTemplateEngineMocksPackageVersion>8.0.100-rc.2.23462.2</MicrosoftTemplateEngineMocksPackageVersion>
<MicrosoftTemplateEngineTestHelperPackageVersion>$(MicrosoftTemplateEngineMocksPackageVersion)</MicrosoftTemplateEngineTestHelperPackageVersion>
<MicrosoftTemplateEngineAuthoringTemplateVerifierVersion>$(MicrosoftTemplateEngineAbstractionsPackageVersion)</MicrosoftTemplateEngineAuthoringTemplateVerifierVersion>
<MicrosoftTemplateSearchTemplateDiscoveryPackageVersion>$(MicrosoftTemplateEngineAbstractionsPackageVersion)</MicrosoftTemplateSearchTemplateDiscoveryPackageVersion>
<MicrosoftTemplateSearchTemplateDiscoveryPackageVersion>$(MicrosoftTemplateEngineMocksPackageVersion)</MicrosoftTemplateSearchTemplateDiscoveryPackageVersion>
</PropertyGroup>
<PropertyGroup>
<!-- Dependencies from https://github.com/Microsoft/visualfsharp -->
<MicrosoftFSharpCompilerPackageVersion>12.8.0-beta.23457.4</MicrosoftFSharpCompilerPackageVersion>
<MicrosoftFSharpCompilerPackageVersion>12.8.0-beta.23463.3</MicrosoftFSharpCompilerPackageVersion>
</PropertyGroup>
<PropertyGroup>
<!-- Dependencies from https://github.com/dotnet/roslyn -->
<MicrosoftNetCompilersToolsetPackageVersion>4.8.0-3.23459.2</MicrosoftNetCompilersToolsetPackageVersion>
<MicrosoftCodeAnalysisPackageVersion>4.8.0-3.23459.2</MicrosoftCodeAnalysisPackageVersion>
<MicrosoftCodeAnalysisCSharpPackageVersion>4.8.0-3.23459.2</MicrosoftCodeAnalysisCSharpPackageVersion>
<MicrosoftCodeAnalysisCSharpCodeStylePackageVersion>4.8.0-3.23459.2</MicrosoftCodeAnalysisCSharpCodeStylePackageVersion>
<MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>4.8.0-3.23459.2</MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>
<MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>4.8.0-3.23459.2</MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>4.8.0-3.23459.2</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
<MicrosoftNetCompilersToolsetPackageVersion>4.8.0-3.23462.10</MicrosoftNetCompilersToolsetPackageVersion>
<MicrosoftCodeAnalysisPackageVersion>4.8.0-3.23462.10</MicrosoftCodeAnalysisPackageVersion>
<MicrosoftCodeAnalysisCSharpPackageVersion>4.8.0-3.23462.10</MicrosoftCodeAnalysisCSharpPackageVersion>
<MicrosoftCodeAnalysisCSharpCodeStylePackageVersion>4.8.0-3.23462.10</MicrosoftCodeAnalysisCSharpCodeStylePackageVersion>
<MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>4.8.0-3.23462.10</MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>
<MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>4.8.0-3.23462.10</MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>4.8.0-3.23462.10</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
<MicrosoftNetCompilersToolsetVersion>$(MicrosoftNetCompilersToolsetPackageVersion)</MicrosoftNetCompilersToolsetVersion>
</PropertyGroup>
<PropertyGroup>
<!-- Dependencies from https://github.com/aspnet/AspNetCore -->
<MicrosoftAspNetCoreAppRefPackageVersion>8.0.0-rc.2.23460.4</MicrosoftAspNetCoreAppRefPackageVersion>
<MicrosoftAspNetCoreDeveloperCertificatesXPlatPackageVersion>8.0.0-rc.2.23460.4</MicrosoftAspNetCoreDeveloperCertificatesXPlatPackageVersion>
<MicrosoftAspNetCoreComponentsSdkAnalyzersPackageVersion>8.0.0-rc.2.23460.4</MicrosoftAspNetCoreComponentsSdkAnalyzersPackageVersion>
<MicrosoftAspNetCoreMvcAnalyzersPackageVersion>8.0.0-rc.2.23460.4</MicrosoftAspNetCoreMvcAnalyzersPackageVersion>
<MicrosoftAspNetCoreMvcApiAnalyzersPackageVersion>8.0.0-rc.2.23460.4</MicrosoftAspNetCoreMvcApiAnalyzersPackageVersion>
<MicrosoftAspNetCoreAnalyzersPackageVersion>8.0.0-rc.2.23460.4</MicrosoftAspNetCoreAnalyzersPackageVersion>
<MicrosoftAspNetCoreTestHostPackageVersion>8.0.0-rc.2.23460.4</MicrosoftAspNetCoreTestHostPackageVersion>
<MicrosoftAspNetCoreAppRefPackageVersion>8.0.0-rc.2.23463.16</MicrosoftAspNetCoreAppRefPackageVersion>
<MicrosoftAspNetCoreDeveloperCertificatesXPlatPackageVersion>8.0.0-rc.2.23463.16</MicrosoftAspNetCoreDeveloperCertificatesXPlatPackageVersion>
<MicrosoftAspNetCoreComponentsSdkAnalyzersPackageVersion>8.0.0-rc.2.23463.16</MicrosoftAspNetCoreComponentsSdkAnalyzersPackageVersion>
<MicrosoftAspNetCoreMvcAnalyzersPackageVersion>8.0.0-rc.2.23463.16</MicrosoftAspNetCoreMvcAnalyzersPackageVersion>
<MicrosoftAspNetCoreMvcApiAnalyzersPackageVersion>8.0.0-rc.2.23463.16</MicrosoftAspNetCoreMvcApiAnalyzersPackageVersion>
<MicrosoftAspNetCoreAnalyzersPackageVersion>8.0.0-rc.2.23463.16</MicrosoftAspNetCoreAnalyzersPackageVersion>
<MicrosoftAspNetCoreTestHostPackageVersion>8.0.0-rc.2.23463.16</MicrosoftAspNetCoreTestHostPackageVersion>
</PropertyGroup>
<!-- Dependencies from https://github.com/dotnet/razor -->
<PropertyGroup>
<MicrosoftAspNetCoreMvcRazorExtensionsToolingInternalPackageVersion>7.0.0-preview.23458.4</MicrosoftAspNetCoreMvcRazorExtensionsToolingInternalPackageVersion>
<MicrosoftCodeAnalysisRazorToolingInternalVersion>7.0.0-preview.23458.4</MicrosoftCodeAnalysisRazorToolingInternalVersion>
<MicrosoftNETSdkRazorSourceGeneratorsTransportPackageVersion>7.0.0-preview.23458.4</MicrosoftNETSdkRazorSourceGeneratorsTransportPackageVersion>
<MicrosoftAspNetCoreMvcRazorExtensionsToolingInternalPackageVersion>7.0.0-preview.23463.3</MicrosoftAspNetCoreMvcRazorExtensionsToolingInternalPackageVersion>
<MicrosoftCodeAnalysisRazorToolingInternalVersion>7.0.0-preview.23463.3</MicrosoftCodeAnalysisRazorToolingInternalVersion>
<MicrosoftNETSdkRazorSourceGeneratorsTransportPackageVersion>7.0.0-preview.23463.3</MicrosoftNETSdkRazorSourceGeneratorsTransportPackageVersion>
</PropertyGroup>
<PropertyGroup>
<!-- Dependencies from https://github.com/dotnet/wpf -->
<MicrosoftNETSdkWindowsDesktopPackageVersion>8.0.0-rc.2.23457.4</MicrosoftNETSdkWindowsDesktopPackageVersion>
<MicrosoftNETSdkWindowsDesktopPackageVersion>8.0.0-rc.2.23462.7</MicrosoftNETSdkWindowsDesktopPackageVersion>
</PropertyGroup>
<PropertyGroup Label="Manually updated">
<!-- Dependencies from https://github.com/microsoft/MSBuildLocator -->
Expand All @@ -176,12 +176,12 @@
</PropertyGroup>
<PropertyGroup>
<!-- Dependencies from https://github.com/dotnet/sourcelink -->
<MicrosoftBuildTasksGitVersion>8.0.0-beta.23458.2</MicrosoftBuildTasksGitVersion>
<MicrosoftSourceLinkCommonVersion>8.0.0-beta.23458.2</MicrosoftSourceLinkCommonVersion>
<MicrosoftSourceLinkAzureReposGitVersion>8.0.0-beta.23458.2</MicrosoftSourceLinkAzureReposGitVersion>
<MicrosoftSourceLinkGitHubVersion>8.0.0-beta.23458.2</MicrosoftSourceLinkGitHubVersion>
<MicrosoftSourceLinkGitLabVersion>8.0.0-beta.23458.2</MicrosoftSourceLinkGitLabVersion>
<MicrosoftSourceLinkBitbucketGitVersion>8.0.0-beta.23458.2</MicrosoftSourceLinkBitbucketGitVersion>
<MicrosoftBuildTasksGitVersion>8.0.0-beta.23463.2</MicrosoftBuildTasksGitVersion>
<MicrosoftSourceLinkCommonVersion>8.0.0-beta.23463.2</MicrosoftSourceLinkCommonVersion>
<MicrosoftSourceLinkAzureReposGitVersion>8.0.0-beta.23463.2</MicrosoftSourceLinkAzureReposGitVersion>
<MicrosoftSourceLinkGitHubVersion>8.0.0-beta.23463.2</MicrosoftSourceLinkGitHubVersion>
<MicrosoftSourceLinkGitLabVersion>8.0.0-beta.23463.2</MicrosoftSourceLinkGitLabVersion>
<MicrosoftSourceLinkBitbucketGitVersion>8.0.0-beta.23463.2</MicrosoftSourceLinkBitbucketGitVersion>
</PropertyGroup>
<!-- Get .NET Framework reference assemblies from NuGet packages -->
<PropertyGroup>
Expand All @@ -191,7 +191,7 @@
<PropertyGroup>
<FluentAssertionsVersion>6.11.0</FluentAssertionsVersion>
<FluentAssertionsJsonVersion>6.1.0</FluentAssertionsJsonVersion>
<MicrosoftDotNetXUnitExtensionsVersion>8.0.0-beta.23451.1</MicrosoftDotNetXUnitExtensionsVersion>
<MicrosoftDotNetXUnitExtensionsVersion>8.0.0-beta.23461.2</MicrosoftDotNetXUnitExtensionsVersion>
<MoqPackageVersion>4.18.4</MoqPackageVersion>
<XunitCombinatorialVersion>1.3.2</XunitCombinatorialVersion>
<MicrosoftDotNetInstallerWindowsSecurityTestDataPackageVersion>6.0.0-beta.22262.1</MicrosoftDotNetInstallerWindowsSecurityTestDataPackageVersion>
Expand Down
35 changes: 35 additions & 0 deletions eng/restore-toolset.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,39 @@ function InstallDotNetSharedFramework([string]$version) {
}
}

# Let's clear out the stage-zero folders that map to the current runtime to keep stage 2 clean
function CleanOutStage0ToolsetsAndRuntimes {
$GlobalJson = Get-Content -Raw -Path (Join-Path $RepoRoot 'global.json') | ConvertFrom-Json
$dotnetSdkVersion = $GlobalJson.tools.dotnet
$dotnetRoot = $env:DOTNET_INSTALL_DIR
$versionPath = Join-Path $dotnetRoot '.version'
$aspnetRuntimePath = [IO.Path]::Combine( $dotnetRoot, 'shared' ,'Microsoft.AspNetCore.App')
$coreRuntimePath = [IO.Path]::Combine( $dotnetRoot, 'shared' ,'Microsoft.NETCore.App')
$wdRuntimePath = [IO.Path]::Combine( $dotnetRoot, 'shared', 'Microsoft.WindowsDesktop.App')
$sdkPath = Join-Path $dotnetRoot 'sdk'
$majorVersion = $dotnetSdkVersion.Substring(0,1)

if (Test-Path($versionPath)) {
$lastInstalledSDK = Get-Content -Raw -Path ($versionPath)
if ($lastInstalledSDK -ne $dotnetSdkVersion)
{
$dotnetSdkVersion | Out-File -FilePath $versionPath -NoNewline
Remove-Item (Join-Path $aspnetRuntimePath "$majorVersion.*") -Recurse
Remove-Item (Join-Path $coreRuntimePath "$majorVersion.*") -Recurse
Remove-Item (Join-Path $wdRuntimePath "$majorVersion.*") -Recurse
Remove-Item (Join-Path $sdkPath "$majorVersion.*") -Recurse
Remove-Item (Join-Path $dotnetRoot "packs") -Recurse
Remove-Item (Join-Path $dotnetRoot "sdk-manifests") -Recurse
Remove-Item (Join-Path $dotnetRoot "templates") -Recurse
throw "Installed a new SDK, deleting existing shared frameworks and sdk folders. Please rerun build"
}
}
else
{
$dotnetSdkVersion | Out-File -FilePath $versionPath -NoNewline
}
}

InitializeCustomSDKToolset

CleanOutStage0ToolsetsAndRuntimes
48 changes: 48 additions & 0 deletions eng/restore-toolset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,52 @@ export NUGET_PACKAGES=$NUGET_PACKAGES
echo "$scriptContents" > ${scriptPath}
}

# ReadVersionFromJson [json key]
function ReadGlobalVersion {
local key=$1

if command -v jq &> /dev/null; then
_ReadGlobalVersion="$(jq -r ".[] | select(has(\"$key\")) | .\"$key\"" "$global_json_file")"
elif [[ "$(cat "$global_json_file")" =~ \"$key\"[[:space:]\:]*\"([^\"]+) ]]; then
_ReadGlobalVersion=${BASH_REMATCH[1]}
fi

if [[ -z "$_ReadGlobalVersion" ]]; then
Write-PipelineTelemetryError -category 'Build' "Error: Cannot find \"$key\" in $global_json_file"
ExitWithExitCode 1
fi
}

function CleanOutStage0ToolsetsAndRuntimes {
ReadGlobalVersion "dotnet"
local dotnetSdkVersion=$_ReadGlobalVersion
local dotnetRoot=$DOTNET_INSTALL_DIR
local versionPath="$dotnetRoot/.version"
local majorVersion="${dotnetSdkVersion:0:1}"
local aspnetRuntimePath="$dotnetRoot/shared/Microsoft.AspNetCore.App/$majorVersion.*"
local coreRuntimePath="$dotnetRoot/shared/Microsoft.NETCore.App/$majorVersion.*"
local wdRuntimePath="$dotnetRoot/shared/Microsoft.WindowsDesktop.App/$majorVersion.*"
local sdkPath="$dotnetRoot/sdk/$majorVersion.*"

if [ -f "$versionPath" ]; then
local lastInstalledSDK=$(cat $versionPath)
if [[ "$lastInstalledSDK" != "$dotnetSdkVersion" ]]; then
echo $dotnetSdkVersion > $versionPath
rm -rf $aspnetRuntimePath
rm -rf $coreRuntimePath
rm -rf $wdRuntimePath
rm -rf $sdkPath
rm -rf "$dotnetRoot/packs"
rm -rf "$dotnetRoot/sdk-manifests"
rm -rf "$dotnetRoot/templates"
Write-PipelineTelemetryError -category 'Build' "Found old version of SDK, cleaning out folder. Please run build.sh again"
ExitWithExitCode 1
fi
else
echo $dotnetSdkVersion > $versionPath
fi
}

InitializeCustomSDKToolset

CleanOutStage0ToolsetsAndRuntimes
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.23451.1",
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23451.1"
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.23461.2",
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23461.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,14 @@
<EmbeddedResource Include="BlazorHotReload.js" />
</ItemGroup>

<ItemGroup Condition="'$(DotNetBuildFromSource)' == 'true'">
<!-- Reference 6.0.2 targeting packs in Source Build - this was the earliest version after the API surface stabilized -->
<FrameworkReference
Update="Microsoft.AspNetCore.App"
TargetingPackVersion="6.0.2" />
<FrameworkReference
Update="Microsoft.NETCore.App"
TargetingPackVersion="6.0.2" />
</ItemGroup>

</Project>
23 changes: 5 additions & 18 deletions src/Cli/dotnet/CommonOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,7 @@ internal static IEnumerable<string> ResolveArchOptionToRuntimeIdentifier(string
return Array.Empty<string>();
}

var selfContainedSpecified = (parseResult.GetResult(SelfContainedOption) ?? parseResult.GetResult(NoSelfContainedOption)) is not null;
return ResolveRidShorthandOptions(null, arg, selfContainedSpecified);
return ResolveRidShorthandOptions(null, arg);
}

internal static IEnumerable<string> ResolveOsOptionToRuntimeIdentifier(string arg, ParseResult parseResult)
Expand All @@ -212,24 +211,12 @@ internal static IEnumerable<string> ResolveOsOptionToRuntimeIdentifier(string ar
throw new GracefulException(CommonLocalizableStrings.CannotSpecifyBothRuntimeAndOsOptions);
}

var selfContainedSpecified = (parseResult.GetResult(SelfContainedOption) ?? parseResult.GetResult(NoSelfContainedOption)) is not null;
if (parseResult.BothArchAndOsOptionsSpecified())
{
return ResolveRidShorthandOptions(arg, ArchOptionValue(parseResult), selfContainedSpecified);
}

return ResolveRidShorthandOptions(arg, null, selfContainedSpecified);
var arch = parseResult.BothArchAndOsOptionsSpecified() ? ArchOptionValue(parseResult) : null;
return ResolveRidShorthandOptions(arg, arch);
}

private static IEnumerable<string> ResolveRidShorthandOptions(string os, string arch, bool userSpecifiedSelfContainedOption)
{
var properties = new string[] { $"-property:RuntimeIdentifier={ResolveRidShorthandOptionsToRuntimeIdentifier(os, arch)}" };
if (!userSpecifiedSelfContainedOption)
{
properties = properties.Append("-property:SelfContained=false").ToArray();
}
return properties;
}
private static IEnumerable<string> ResolveRidShorthandOptions(string os, string arch) =>
new string[] { $"-property:RuntimeIdentifier={ResolveRidShorthandOptionsToRuntimeIdentifier(os, arch)}" };

internal static string ResolveRidShorthandOptionsToRuntimeIdentifier(string os, string arch)
{
Expand Down
Loading

0 comments on commit bfbca53

Please sign in to comment.