| 
1 | 1 | <!-- When altering this file, include @dotnet/product-construction as a reviewer. -->  | 
2 | 2 | 
 
  | 
3 | 3 | <Project>  | 
 | 4 | +  <PropertyGroup>  | 
 | 5 | +    <!-- TargetRid can be set by the orchestrator, so we need to set OutputRID to that as a default. -->  | 
 | 6 | +    <OutputRID Condition="'$(OutputRID)' == ''">$(TargetRid)</OutputRID>  | 
 | 7 | +  </PropertyGroup>  | 
 | 8 | + | 
 | 9 | +  <Import Project="$(MSBuildThisFileDirectory)OSArch.props" Condition="'$(_ImportedOSArchProps)' != 'true'" />  | 
 | 10 | +  <Import Project="$(MSBuildThisFileDirectory)RuntimeIdentifier.props" Condition="'$(_ImportedRuntimeIdentifierProps)' != 'true'" />  | 
4 | 11 | 
 
  | 
5 | 12 |   <PropertyGroup>  | 
6 | 13 |     <GitHubRepositoryName>runtime</GitHubRepositoryName>  | 
7 | 14 | 
 
  | 
8 | 15 |     <BaseInnerSourceBuildCommand Condition="'$(OS)' == 'Windows_NT'">.\build.cmd</BaseInnerSourceBuildCommand>  | 
9 | 16 |     <BaseInnerSourceBuildCommand Condition="'$(OS)' != 'Windows_NT'">./build.sh</BaseInnerSourceBuildCommand>  | 
10 | 17 | 
 
  | 
11 |  | -    <_hostRid>$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)</_hostRid>  | 
12 |  | -    <!-- TargetRid names what gets built. -->  | 
13 |  | -    <TargetRid Condition="'$(TargetRid)' == ''">$(_hostRid)</TargetRid>  | 
14 |  | - | 
15 |  | -    <!-- Split e.g. 'fedora.33-x64' into 'fedora.33' and 'x64'. -->  | 
16 |  | -    <_targetRidPlatformIndex>$(TargetRid.LastIndexOf('-'))</_targetRidPlatformIndex>  | 
17 |  | -    <TargetArch>$(TargetRid.Substring($(_targetRidPlatformIndex)).TrimStart('-'))</TargetArch>  | 
18 |  | -    <TargetOS>$(TargetRid.Substring(0, $(_targetRidPlatformIndex)))</TargetOS>  | 
19 |  | - | 
20 |  | -    <_hostRidPlatformIndex>$(_hostRid.LastIndexOf('-'))</_hostRidPlatformIndex>  | 
21 |  | -    <_hostArch>$(_hostRid.Substring($(_hostRidPlatformIndex)).TrimStart('-'))</_hostArch>  | 
22 |  | - | 
23 | 18 |     <LogVerbosity Condition="'$(LogVerbosity)' == ''">minimal</LogVerbosity>  | 
24 | 19 |   </PropertyGroup>  | 
25 | 20 | 
 
  | 
26 |  | -  <!-- Keep this list in sync with https://github.com/dotnet/sdk/blob/main/src/SourceBuild/content/Directory.Build.props#L23 -->  | 
27 |  | -  <PropertyGroup Label="ShortStacks">  | 
28 |  | -    <ShortStack Condition="'$(TargetOS)' == 'wasi'">true</ShortStack>  | 
29 |  | -    <ShortStack Condition="'$(TargetOS)' == 'browser'">true</ShortStack>  | 
30 |  | -    <ShortStack Condition="'$(TargetOS)' == 'ios'">true</ShortStack>  | 
31 |  | -    <ShortStack Condition="'$(TargetOS)' == 'iossimulator'">true</ShortStack>  | 
32 |  | -    <ShortStack Condition="'$(TargetOS)' == 'tvos'">true</ShortStack>  | 
33 |  | -    <ShortStack Condition="'$(TargetOS)' == 'tvossimulator'">true</ShortStack>  | 
34 |  | -    <ShortStack Condition="'$(TargetOS)' == 'maccatalyst'">true</ShortStack>  | 
35 |  | -    <ShortStack Condition="'$(TargetOS)' == 'android'">true</ShortStack>  | 
36 |  | -    <ShortStack Condition="'$(TargetOS)' == 'linux-bionic'">true</ShortStack>  | 
37 |  | -    <!-- Mono LLVM builds are short -->  | 
38 |  | -    <ShortStack Condition="'$(DotNetBuildMonoEnableLLVM)' == 'true' or '$(DotNetBuildMonoAOTEnableLLVM)' == 'true'">true</ShortStack>  | 
39 |  | -  </PropertyGroup>  | 
40 |  | - | 
41 |  | -  <!--  | 
42 |  | -    Allow the VMR orchestrator to control whether or not to build rid-specific artifacts,  | 
43 |  | -    but provide defaults until the VMR orchestrator provides controls in all scenarios.  | 
44 |  | -  -->  | 
45 |  | -  <PropertyGroup Condition="'$(EnableDefaultRidSpecificArtifacts)' == ''">  | 
46 |  | -    <!-- Source-build always needs all artifacts to be published. -->  | 
47 |  | -    <EnableDefaultRidSpecificArtifacts Condition="'$(DotNetBuildSourceOnly)' != ''">false</EnableDefaultRidSpecificArtifacts>  | 
48 |  | -    <!-- Short-stack builds should always only publish RID-specific artifacts. -->  | 
49 |  | -    <EnableDefaultRidSpecificArtifacts Condition="'$(ShortStack)' == 'true'">true</EnableDefaultRidSpecificArtifacts>  | 
50 |  | -    <!-- If no override is specified, don't use RID-specific publishing. Instead, publish everything. -->  | 
51 |  | -    <EnableDefaultRidSpecificArtifacts Condition="'$(EnableDefaultRidSpecificArtifacts)' == ''">false</EnableDefaultRidSpecificArtifacts>  | 
52 |  | -  </PropertyGroup>  | 
53 |  | - | 
54 | 21 |   <Target Name="GetRuntimeSourceBuildCommandConfiguration"  | 
55 | 22 |           BeforeTargets="GetSourceBuildCommandConfiguration">  | 
56 | 23 |     <PropertyGroup>  | 
 | 
63 | 30 |       <InnerBuildArgs Condition="'$(DotNetBuildOrchestrator)' == 'true' and '$(Sign)' == 'true'">$(InnerBuildArgs) $(FlagParameterPrefix)sign</InnerBuildArgs>  | 
64 | 31 |       <InnerBuildArgs>$(InnerBuildArgs) $(FlagParameterPrefix)pack</InnerBuildArgs>  | 
65 | 32 | 
 
  | 
66 |  | -      <InnerBuildArgs>$(InnerBuildArgs) $(FlagParameterPrefix)arch $(TargetArch)</InnerBuildArgs>  | 
67 |  | -      <InnerBuildArgs Condition="'$(DotNetBuildSourceOnly)' != 'true'">$(InnerBuildArgs) $(FlagParameterPrefix)os $(TargetOS)</InnerBuildArgs>  | 
68 |  | -      <InnerBuildArgs Condition="'$(CrossBuild)' == 'true' or ('$(TargetArch)' != '$(_hostArch)' and '$(ShortStack)' != 'true')">$(InnerBuildArgs) $(FlagParameterPrefix)cross</InnerBuildArgs>  | 
 | 33 | +      <InnerBuildArgs>$(InnerBuildArgs) $(FlagParameterPrefix)arch $(TargetArchitecture)</InnerBuildArgs>  | 
 | 34 | +      <InnerBuildArgs Condition="'$(_portableOS)' == 'win'">$(InnerBuildArgs) $(FlagParameterPrefix)os windows</InnerBuildArgs>  | 
 | 35 | +      <InnerBuildArgs>$(InnerBuildArgs) $(FlagParameterPrefix)os $(_portableOS)</InnerBuildArgs>  | 
 | 36 | +      <!-- Mobile builds are never "cross" builds as they don't have a rootfs-based filesystem build. -->  | 
 | 37 | +      <InnerBuildArgs Condition="'$(CrossBuild)' == 'true' or ('$(TargetArchitecture)' != '$(BuildArchitecture)' and '$(TargetsMobile)' != 'true')">$(InnerBuildArgs) $(FlagParameterPrefix)cross</InnerBuildArgs>  | 
69 | 38 |       <InnerBuildArgs>$(InnerBuildArgs) $(FlagParameterPrefix)configuration $(Configuration)</InnerBuildArgs>  | 
70 | 39 |       <InnerBuildArgs>$(InnerBuildArgs) $(FlagParameterPrefix)verbosity $(LogVerbosity)</InnerBuildArgs>  | 
71 | 40 |       <InnerBuildArgs>$(InnerBuildArgs) $(FlagParameterPrefix)nodereuse $(ArcadeFalseBoolBuildArg)</InnerBuildArgs>  | 
72 | 41 |       <InnerBuildArgs>$(InnerBuildArgs) $(FlagParameterPrefix)warnAsError $(ArcadeFalseBoolBuildArg)</InnerBuildArgs>  | 
73 | 42 |       <InnerBuildArgs Condition="'$(DotNetBuildUseMonoRuntime)' == 'true'">$(InnerBuildArgs) $(FlagParameterPrefix)usemonoruntime</InnerBuildArgs>  | 
74 | 43 |       <!-- TODO: This parameter is only available on the Unix script. Intentional? -->  | 
75 |  | -      <InnerBuildArgs Condition="'$(OS)' != 'Windows_NT'">$(InnerBuildArgs) --outputrid $(TargetRid)</InnerBuildArgs>  | 
76 |  | -      <!-- PackageOS and ToolsOS control the rids of prebuilts consumed by the build.  | 
77 |  | -           They are set to RuntimeOS so they match with the build SDK rid. -->  | 
78 |  | -      <InnerBuildArgs Condition="'$(RuntimeOS)' != ''">$(InnerBuildArgs) /p:PackageOS=$(RuntimeOS) /p:ToolsOS=$(RuntimeOS)</InnerBuildArgs>  | 
79 |  | -      <!-- BaseOS is an expected known rid in the graph that TargetRid is compatible with.  | 
80 |  | -           It's used to add TargetRid in the graph if the parent can't be detected. -->  | 
 | 44 | +      <InnerBuildArgs Condition="'$(OS)' != 'Windows_NT'">$(InnerBuildArgs) --outputrid $(OutputRID)</InnerBuildArgs>  | 
 | 45 | +      <!-- BaseOS is an expected known rid in the graph that OutputRID is compatible with.  | 
 | 46 | +           It's used to add OutputRID in the graph if the parent can't be detected. -->  | 
81 | 47 |       <InnerBuildArgs>$(InnerBuildArgs) /p:AdditionalRuntimeIdentifierParent=$(BaseOS) /p:BaseOS=$(BaseOS)</InnerBuildArgs>  | 
82 | 48 |       <!-- Pass through special build modes controlled by properties -->  | 
83 | 49 |       <InnerBuildArgs Condition="'$(DotNetBuildRuntimeWasmEnableThreads)' == 'true'">$(InnerBuildArgs) /p:WasmEnableThreads=true</InnerBuildArgs>  | 
 | 
0 commit comments