Don't set PortableBuild=... on non source-build (#18395)

This commit is contained in:
Viktor Hofer 2024-01-25 22:46:29 +01:00 committed by GitHub
parent 8062881104
commit f1a28efa00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 21 additions and 14 deletions

View file

@ -1,13 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OverrideTargetRid>$(TargetRid)</OverrideTargetRid>
<OverrideTargetRid Condition="'$(TargetOS)' == 'osx'">osx-$(TargetArchitecture)</OverrideTargetRid>
<OverrideTargetRid Condition="'$(TargetOS)' == 'freebsd'">freebsd-$(TargetArchitecture)</OverrideTargetRid>
<OverrideTargetRid Condition="'$(TargetOS)' == 'windows'">win-$(TargetArchitecture)</OverrideTargetRid>
<_portableRidOverridden Condition="'$(TargetRid)' != '$(OverrideTargetRid)'">true</_portableRidOverridden>
<_portableRidOverridden Condition="'$(TargetRid)' == '$(OverrideTargetRid)'">false</_portableRidOverridden>
<!-- AspNetCore doesn't have a root build script but one under the eng folder. --> <!-- AspNetCore doesn't have a root build script but one under the eng folder. -->
<BuildScript>$(ProjectDirectory)eng\build$(ShellExtension)</BuildScript> <BuildScript>$(ProjectDirectory)eng\build$(ShellExtension)</BuildScript>
@ -20,11 +13,22 @@
<BuildArgs Condition="'$(OverrideTargetArch)' != ''">$(BuildArgs) $(FlagParameterPrefix)arch $(OverrideTargetArch)</BuildArgs> <BuildArgs Condition="'$(OverrideTargetArch)' != ''">$(BuildArgs) $(FlagParameterPrefix)arch $(OverrideTargetArch)</BuildArgs>
<BuildArgs Condition="'$(DotNetBuildVertical)' != 'true' or '$(BuildOS)' != 'windows'">$(BuildArgs) $(FlagParameterPrefix)no-build-repo-tasks</BuildArgs> <BuildArgs Condition="'$(DotNetBuildVertical)' != 'true' or '$(BuildOS)' != 'windows'">$(BuildArgs) $(FlagParameterPrefix)no-build-repo-tasks</BuildArgs>
<BuildArgs Condition="'$(DotNetBuildVertical)' != 'true' or '$(BuildOS)' != 'windows'">$(BuildArgs) $(FlagParameterPrefix)no-build-nodejs</BuildArgs> <BuildArgs Condition="'$(DotNetBuildVertical)' != 'true' or '$(BuildOS)' != 'windows'">$(BuildArgs) $(FlagParameterPrefix)no-build-nodejs</BuildArgs>
<BuildArgs>$(BuildArgs) /p:PortableBuild=$(_portableRidOverridden) /p:TargetRuntimeIdentifier=$(OverrideTargetRid)</BuildArgs>
<LogVerbosityOptOut>true</LogVerbosityOptOut> <LogVerbosityOptOut>true</LogVerbosityOptOut>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(DotNetBuildFromSource)' == 'true'">
<OverrideTargetRid>$(TargetRid)</OverrideTargetRid>
<OverrideTargetRid Condition="'$(TargetOS)' == 'osx'">osx-$(TargetArchitecture)</OverrideTargetRid>
<OverrideTargetRid Condition="'$(TargetOS)' == 'freebsd'">freebsd-$(TargetArchitecture)</OverrideTargetRid>
<OverrideTargetRid Condition="'$(TargetOS)' == 'windows'">win-$(TargetArchitecture)</OverrideTargetRid>
<_portableRidOverridden Condition="'$(TargetRid)' != '$(OverrideTargetRid)'">true</_portableRidOverridden>
<_portableRidOverridden Condition="'$(TargetRid)' == '$(OverrideTargetRid)'">false</_portableRidOverridden>
<BuildArgs>$(BuildArgs) /p:PortableBuild=$(_portableRidOverridden)</BuildArgs>
<BuildArgs>$(BuildArgs) /p:TargetRuntimeIdentifier=$(OverrideTargetRid)</BuildArgs>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<RepositoryReference Include="arcade" /> <RepositoryReference Include="arcade" />
<RepositoryReference Include="source-build-externals" Condition="'$(DotNetBuildFromSource)' == 'true'" /> <RepositoryReference Include="source-build-externals" Condition="'$(DotNetBuildFromSource)' == 'true'" />

View file

@ -30,8 +30,8 @@
<BuildArgs>$(BuildArgs) /p:DOTNET_INSTALL_DIR=$(DotNetRoot)</BuildArgs> <BuildArgs>$(BuildArgs) /p:DOTNET_INSTALL_DIR=$(DotNetRoot)</BuildArgs>
<BuildArgs Condition="'$(TargetOS)' != 'windows'">$(BuildArgs) /p:AspNetCoreInstallerRid=$(OverrideTargetRid)</BuildArgs> <BuildArgs Condition="'$(TargetOS)' != 'windows'">$(BuildArgs) /p:AspNetCoreInstallerRid=$(OverrideTargetRid)</BuildArgs>
<!-- core-sdk always wants to build portable on OSX and FreeBSD --> <!-- installer always wants to build portable on FreeBSD -->
<BuildArgs Condition="'$(TargetOS)' == 'freebsd'">$(BuildArgs) /p:PortableBuild=true</BuildArgs> <BuildArgs Condition="'$(TargetOS)' == 'freebsd' and '$(DotNetBuildFromSource)' == 'true'">$(BuildArgs) /p:PortableBuild=true</BuildArgs>
<BuildArgs Condition="'$(TargetOS)' != 'windows'">$(BuildArgs) /p:CoreSetupRid=$(OverrideTargetRid)</BuildArgs> <BuildArgs Condition="'$(TargetOS)' != 'windows'">$(BuildArgs) /p:CoreSetupRid=$(OverrideTargetRid)</BuildArgs>
<!-- Consume the source-built Core-Setup and toolset. This line must be removed to source-build CLI without source-building Core-Setup first. --> <!-- Consume the source-built Core-Setup and toolset. This line must be removed to source-build CLI without source-building Core-Setup first. -->

View file

@ -14,10 +14,6 @@
<_platformIndex>$(NETCoreSdkPortableRuntimeIdentifier.LastIndexOf('-'))</_platformIndex> <_platformIndex>$(NETCoreSdkPortableRuntimeIdentifier.LastIndexOf('-'))</_platformIndex>
<BaseOS>$(NETCoreSdkPortableRuntimeIdentifier.Substring(0, $(_platformIndex)))-$(TargetArchitecture)</BaseOS> <BaseOS>$(NETCoreSdkPortableRuntimeIdentifier.Substring(0, $(_platformIndex)))-$(TargetArchitecture)</BaseOS>
<PortableBuild Condition="'$(PortableBuild)' == ''">false</PortableBuild>
<BuildNonPortable>true</BuildNonPortable>
<BuildNonPortable Condition="'$(PortableBuild)' == 'true'">false</BuildNonPortable>
<!-- Use the repo root build script --> <!-- Use the repo root build script -->
<BuildScript>$(ProjectDirectory)build$(ShellExtension)</BuildScript> <BuildScript>$(ProjectDirectory)build$(ShellExtension)</BuildScript>
@ -26,6 +22,13 @@
<BuildArgs>$(BuildArgs) /p:TargetRid=$(OverrideTargetRid)</BuildArgs> <BuildArgs>$(BuildArgs) /p:TargetRid=$(OverrideTargetRid)</BuildArgs>
<BuildArgs>$(BuildArgs) /p:RuntimeOS=$(RuntimeOS)</BuildArgs> <BuildArgs>$(BuildArgs) /p:RuntimeOS=$(RuntimeOS)</BuildArgs>
<BuildArgs>$(BuildArgs) /p:BaseOS=$(BaseOS)</BuildArgs> <BuildArgs>$(BuildArgs) /p:BaseOS=$(BaseOS)</BuildArgs>
</PropertyGroup>
<PropertyGroup Condition="'$(DotNetBuildFromSource)' == 'true'">
<PortableBuild Condition="'$(PortableBuild)' == ''">false</PortableBuild>
<BuildNonPortable>true</BuildNonPortable>
<BuildNonPortable Condition="'$(PortableBuild)' == 'true'">false</BuildNonPortable>
<BuildArgs>$(BuildArgs) /p:PortableBuild=$(PortableBuild)</BuildArgs> <BuildArgs>$(BuildArgs) /p:PortableBuild=$(PortableBuild)</BuildArgs>
<BuildArgs>$(BuildArgs) /p:SourceBuildNonPortable=$(BuildNonPortable)</BuildArgs> <BuildArgs>$(BuildArgs) /p:SourceBuildNonPortable=$(BuildNonPortable)</BuildArgs>
<BuildArgs>$(BuildArgs) /p:UsingToolMicrosoftNetCompilers=false</BuildArgs> <BuildArgs>$(BuildArgs) /p:UsingToolMicrosoftNetCompilers=false</BuildArgs>