Skip to content

Commit 25bb59d

Browse files
authored
Move corehost.proj to corehost directory (#57036)
* Move corehost.proj to corehost directory * Simplify host version overriding
1 parent 7a799ce commit 25bb59d

File tree

6 files changed

+48
-82
lines changed

6 files changed

+48
-82
lines changed

Directory.Build.targets

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,42 @@
105105
<FileWrites Include="$(_NETStandardCompatErrorFilePath)" />
106106
</ItemGroup>
107107
</Target>
108+
109+
<!--
110+
Arcade SDK versioning is defined by static properties in a targets file: work around this by
111+
moving properties based on versioning into a target.
112+
-->
113+
<Target Name="GetProductVersions">
114+
<PropertyGroup>
115+
<IncludePreReleaseLabelInPackageVersion Condition="'$(DotNetFinalVersionKind)' != 'release'">true</IncludePreReleaseLabelInPackageVersion>
116+
<IncludePreReleaseLabelInPackageVersion Condition="'$(SuppressFinalPackageVersion)' == 'true'">true</IncludePreReleaseLabelInPackageVersion>
117+
<IncludePreReleaseLabelInPackageVersion Condition="'$(IsShipping)' != 'true'">true</IncludePreReleaseLabelInPackageVersion>
118+
119+
<IncludeBuildNumberInPackageVersion Condition="'$(StabilizePackageVersion)' != 'true'">true</IncludeBuildNumberInPackageVersion>
120+
<IncludeBuildNumberInPackageVersion Condition="'$(SuppressFinalPackageVersion)' == 'true'">true</IncludeBuildNumberInPackageVersion>
121+
<IncludeBuildNumberInPackageVersion Condition="'$(IsShipping)' != 'true'">true</IncludeBuildNumberInPackageVersion>
122+
123+
<ProductVersionSuffix Condition="'$(IncludePreReleaseLabelInPackageVersion)' == 'true'">-$(VersionSuffix)</ProductVersionSuffix>
124+
<ProductBandVersion Condition="'$(ProductBandVersion)' == ''">$(MajorVersion).$(MinorVersion)</ProductBandVersion>
125+
<ProductionVersion Condition="'$(ProductionVersion)' == ''">$(ProductBandVersion).$(PatchVersion)</ProductionVersion>
126+
<ProductVersion>$(ProductionVersion)$(ProductVersionSuffix)</ProductVersion>
127+
128+
<SharedFrameworkNugetVersion>$(ProductVersion)</SharedFrameworkNugetVersion>
129+
<NuGetVersion>$(SharedFrameworkNugetVersion)</NuGetVersion>
130+
<InstallersRelativePath>Runtime/$(SharedFrameworkNugetVersion)/</InstallersRelativePath>
131+
132+
<!--
133+
By default, we are always building the nuget packages for HostPolicy, HostFXR and
134+
Dotnet/AppHost. Thus, the properties (below) are always set to $(ProductVersion).
135+
However, there are scenarios when only some of these components will change (e.g. during
136+
servicing, we may only change HostPolicy but not HostFXR and Dotnet/AppHost). In such cases,
137+
pass the appropriate version value(s) as argument to the build command in order to override;
138+
e.g. 'build -p:HostPolicyVersion=x.y.z ...'
139+
-->
140+
<HostVersion Condition="'$(HostVersion)' == ''">$(ProductVersion)</HostVersion>
141+
<AppHostVersion Condition="'$(AppHostVersion)' == ''">$(ProductVersion)</AppHostVersion>
142+
<HostResolverVersion Condition="'$(HostResolverVersion)' == ''">$(ProductVersion)</HostResolverVersion>
143+
<HostPolicyVersion Condition="'$(HostPolicyVersion)' == ''">$(ProductVersion)</HostPolicyVersion>
144+
</PropertyGroup>
145+
</Target>
108146
</Project>

eng/Subsets.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@
290290

291291
<!-- Host sets -->
292292
<ItemGroup Condition="$(_subset.Contains('+host.native+'))">
293-
<CorehostProjectToBuild Include="$(InstallerProjectRoot)corehost.proj" SignPhase="Binaries" BuildInParallel="false" />
293+
<CorehostProjectToBuild Include="$(SharedNativeRoot)corehost\corehost.proj" SignPhase="Binaries" BuildInParallel="false" />
294294
<ProjectToBuild Include="@(CorehostProjectToBuild)" Pack="true" Category="host" />
295295
</ItemGroup>
296296

src/installer/Directory.Build.props

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,4 @@
1515
want to ensure we use the correct packages. -->
1616
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
1717
</PropertyGroup>
18-
19-
<!-- Set up the default output and intermediate paths -->
20-
<PropertyGroup>
21-
<OSPlatformConfig>$(OutputRid).$(Configuration)</OSPlatformConfig>
22-
<BaseOutputRootPath>$(ArtifactsBinDir)$(OSPlatformConfig)\</BaseOutputRootPath>
23-
<IntermediateOutputRootPath>$(ArtifactsObjDir)$(OSPlatformConfig)\</IntermediateOutputRootPath>
24-
25-
<!-- Produce assets into the specified blob feed. -->
26-
<AssetOutputPath Condition="'$(DotNetOutputBlobFeedDir)' != ''">$(DotNetOutputBlobFeedDir)assets/</AssetOutputPath>
27-
<AssetOutputPath Condition="'$(AssetOutputPath)'==''">$(ArtifactsShippingPackagesDir)</AssetOutputPath>
28-
29-
<SymbolPackageOutputPath Condition="'$(SymbolPackageOutputPath)'==''">$(ArtifactsShippingPackagesDir)</SymbolPackageOutputPath>
30-
</PropertyGroup>
3118
</Project>

src/installer/Directory.Build.targets

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -16,67 +16,4 @@
1616

1717
<!-- Provide default targets which can be hooked onto or overridden as necessary -->
1818
<Target Name="Pack" />
19-
20-
<!--
21-
Arcade SDK versioning is defined by static properties in a targets file: work around this by
22-
moving properties based on versioning into a target.
23-
-->
24-
<Target Name="GetProductVersions">
25-
<PropertyGroup>
26-
<IncludePreReleaseLabelInPackageVersion Condition="'$(DotNetFinalVersionKind)' != 'release'">true</IncludePreReleaseLabelInPackageVersion>
27-
<IncludePreReleaseLabelInPackageVersion Condition="'$(SuppressFinalPackageVersion)' == 'true'">true</IncludePreReleaseLabelInPackageVersion>
28-
<IncludePreReleaseLabelInPackageVersion Condition="'$(IsShipping)' != 'true'">true</IncludePreReleaseLabelInPackageVersion>
29-
30-
<IncludeBuildNumberInPackageVersion Condition="'$(StabilizePackageVersion)' != 'true'">true</IncludeBuildNumberInPackageVersion>
31-
<IncludeBuildNumberInPackageVersion Condition="'$(SuppressFinalPackageVersion)' == 'true'">true</IncludeBuildNumberInPackageVersion>
32-
<IncludeBuildNumberInPackageVersion Condition="'$(IsShipping)' != 'true'">true</IncludeBuildNumberInPackageVersion>
33-
34-
<ProductVersionSuffix Condition="'$(IncludePreReleaseLabelInPackageVersion)' == 'true'">-$(VersionSuffix)</ProductVersionSuffix>
35-
<ProductBandVersion Condition="'$(ProductBandVersion)' == ''">$(MajorVersion).$(MinorVersion)</ProductBandVersion>
36-
<ProductionVersion Condition="'$(ProductionVersion)' == ''">$(ProductBandVersion).$(PatchVersion)</ProductionVersion>
37-
<ProductVersion>$(ProductionVersion)$(ProductVersionSuffix)</ProductVersion>
38-
39-
<SharedFrameworkNugetVersion>$(ProductVersion)</SharedFrameworkNugetVersion>
40-
<NuGetVersion>$(SharedFrameworkNugetVersion)</NuGetVersion>
41-
<InstallersRelativePath>Runtime/$(SharedFrameworkNugetVersion)/</InstallersRelativePath>
42-
43-
<!--
44-
By default, we are always building the nuget packages for HostPolicy, HostFXR and
45-
Dotnet/AppHost. Thus, the "UseShipped*" properties (below) are always set to false.
46-
47-
However, there are scenarios when some of these components will not change (e.g. during
48-
servicing, we may only change HostPolicy but not HostFXR and Dotnet/AppHost). In such cases,
49-
set the appropriate "UseShipped*" property below to true and the corresponding "*Version"
50-
property to the desired version so that we use the last shipped version of the package.
51-
-->
52-
53-
<!-- The host/apphost package versions are only updated whenever there is a change in the components -->
54-
<UseShippedHostPackage>false</UseShippedHostPackage>
55-
<HostVersion Condition="'$(UseShippedHostPackage)' != 'true'">$(ProductVersion)</HostVersion>
56-
<HostVersion Condition="'$(UseShippedHostPackage)' == 'true'">2.0.0</HostVersion>
57-
58-
<!-- The AppHostVersion is used for all hosts that aren't dotnet.exe -->
59-
<UseShippedAppHostPackage>false</UseShippedAppHostPackage>
60-
<AppHostVersion Condition="'$(UseShippedAppHostPackage)' != 'true'">$(ProductVersion)</AppHostVersion>
61-
<AppHostVersion Condition="'$(UseShippedAppHostPackage)' == 'true'">2.0.0</AppHostVersion>
62-
63-
<!--
64-
The FXR Resolver package version is only updated whenever there is a change in it.
65-
If there is ever a need to use a shipped version of the package, then set the property
66-
below to true.
67-
-->
68-
<UseShippedHostResolverPackage>false</UseShippedHostResolverPackage>
69-
<HostResolverVersion Condition="'$(UseShippedHostResolverPackage)' != 'true'">$(ProductVersion)</HostResolverVersion>
70-
<HostResolverVersion Condition="'$(UseShippedHostResolverPackage)' == 'true'">2.0.0</HostResolverVersion>
71-
72-
<!--
73-
Host Policy package version is only updated whenever there is a change in it.
74-
If there is ever a need to use a shipped version of the package, then set the property
75-
below to true.
76-
-->
77-
<UseShippedHostPolicyPackage>false</UseShippedHostPolicyPackage>
78-
<HostPolicyVersion Condition="'$(UseShippedHostPolicyPackage)' != 'true'">$(ProductVersion)</HostPolicyVersion>
79-
<HostPolicyVersion Condition="'$(UseShippedHostPolicyPackage)' == 'true'">2.0.0</HostPolicyVersion>
80-
</PropertyGroup>
81-
</Target>
8219
</Project>

src/installer/pkg/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<PropertyGroup>
55
<Platform>$(TargetArchitecture)</Platform>
6-
<DotNetHostBinDir>$(BaseOutputRootPath)corehost</DotNetHostBinDir>
6+
<DotNetHostBinDir>$(ArtifactsBinDir)$(OutputRid).$(Configuration)\corehost</DotNetHostBinDir>
77
</PropertyGroup>
88

99
<PropertyGroup>

src/installer/corehost.proj renamed to src/native/corehost/corehost.proj

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<IncrementalNativeBuild Condition="'$(IncrementalNativeBuild)' == ''">true</IncrementalNativeBuild>
99
<BuildCoreHostDependsOn>GetProductVersions;GenerateNativeVersionFile</BuildCoreHostDependsOn>
1010
<BuildCoreHostDependsOn Condition="'$(DisableSourceLink)' != 'true'">$(BuildCoreHostDependsOn);InitializeSourceControlInformationFromSourceControlManager</BuildCoreHostDependsOn>
11+
<IntermediateOutputRootPath>$(ArtifactsObjDir)$(OutputRid).$(Configuration)\</IntermediateOutputRootPath>
1112
</PropertyGroup>
1213

1314
<!-- Target that builds dotnet, hostfxr and hostpolicy with the same version as what NetCoreApp will be built for
@@ -19,6 +20,7 @@
1920
DependsOnTargets="$(BuildCoreHostDependsOn)">
2021
<PropertyGroup>
2122
<CMakeBuildDir>$(IntermediateOutputRootPath)corehost\cmake\</CMakeBuildDir>
23+
<BuildScript>$([MSBuild]::NormalizePath('$(MSBuildThisFileDirectory)', 'build.sh'))</BuildScript>
2224

2325
<BuildArgs>$(Configuration) $(TargetArchitecture) -apphostver "$(AppHostVersion)" -hostver "$(HostVersion)" -fxrver "$(HostResolverVersion)" -policyver "$(HostPolicyVersion)" -commithash "$([MSBuild]::ValueOrDefault('$(SourceRevisionId)', 'N/A'))" -os $(TargetOS)</BuildArgs>
2426
<BuildArgs>$(BuildArgs) -cmakeargs "-DVERSION_FILE_PATH=$(NativeVersionFile)"</BuildArgs>
@@ -37,8 +39,8 @@
3739
Use IgnoreStandardErrorWarningFormat because Arcade sets WarnAsError and there's an existing
3840
warning in the macOS build when dsymutil tries to strip symbols.
3941
-->
40-
<Message Text="$(SharedNativeRoot)corehost\build.sh $(BuildArgs)" Importance="High"/>
41-
<Exec Command="$(SharedNativeRoot)corehost\build.sh $(BuildArgs)" IgnoreStandardErrorWarningFormat="true"/>
42+
<Message Text="&quot;$(BuildScript)&quot; $(BuildArgs)" Importance="High"/>
43+
<Exec Command="&quot;$(BuildScript)&quot; $(BuildArgs)" IgnoreStandardErrorWarningFormat="true"/>
4244
</Target>
4345

4446
<Target Name="BuildCoreHostWindows"
@@ -79,6 +81,8 @@
7981
!Exists('$(IntermediateOutputRootPath)hostResourceFiles\%(HostFiles.Identity)\version_info.h')"/>
8082

8183
<PropertyGroup>
84+
<BuildScript>$([MSBuild]::NormalizePath('$(MSBuildThisFileDirectory)', 'build.cmd'))</BuildScript>
85+
8286
<BuildArgs>$(Configuration) $(TargetArchitecture) apphostver $(AppHostVersion) hostver $(HostVersion) fxrver $(HostResolverVersion) policyver $(HostPolicyVersion) commit $([MSBuild]::ValueOrDefault('$(SourceRevisionId)', 'N/A')) rid $(OutputRid)</BuildArgs>
8387
<BuildArgs Condition="'$(PortableBuild)' == 'true'">$(BuildArgs) portable</BuildArgs>
8488
<BuildArgs Condition="'$(IncrementalNativeBuild)' == 'true'">$(BuildArgs) incremental-native-build</BuildArgs>
@@ -94,8 +98,8 @@
9498
IgnoreStandardErrorWarningFormat because Arcade sets WarnAsError and there's an existing
9599
warning in the native build.
96100
-->
97-
<Message Text="$(SharedNativeRoot)corehost\build.cmd $(BuildArgs)" Importance="High"/>
98-
<Exec Command="$(SharedNativeRoot)corehost\build.cmd $(BuildArgs)" IgnoreStandardErrorWarningFormat="true"/>
101+
<Message Text="&quot;$(BuildScript)&quot; $(BuildArgs)" Importance="High"/>
102+
<Exec Command="&quot;$(BuildScript)&quot; $(BuildArgs)" IgnoreStandardErrorWarningFormat="true"/>
99103
</Target>
100104

101105
<Target Name="PrependWindowsHeaderIncludeToVersionHeaderFile"

0 commit comments

Comments
 (0)