Skip to content

Commit

Permalink
Move corehost.proj to corehost directory (#57036)
Browse files Browse the repository at this point in the history
* Move corehost.proj to corehost directory

* Simplify host version overriding
  • Loading branch information
am11 authored Aug 9, 2021
1 parent 7a799ce commit 25bb59d
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 82 deletions.
38 changes: 38 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,42 @@
<FileWrites Include="$(_NETStandardCompatErrorFilePath)" />
</ItemGroup>
</Target>

<!--
Arcade SDK versioning is defined by static properties in a targets file: work around this by
moving properties based on versioning into a target.
-->
<Target Name="GetProductVersions">
<PropertyGroup>
<IncludePreReleaseLabelInPackageVersion Condition="'$(DotNetFinalVersionKind)' != 'release'">true</IncludePreReleaseLabelInPackageVersion>
<IncludePreReleaseLabelInPackageVersion Condition="'$(SuppressFinalPackageVersion)' == 'true'">true</IncludePreReleaseLabelInPackageVersion>
<IncludePreReleaseLabelInPackageVersion Condition="'$(IsShipping)' != 'true'">true</IncludePreReleaseLabelInPackageVersion>

<IncludeBuildNumberInPackageVersion Condition="'$(StabilizePackageVersion)' != 'true'">true</IncludeBuildNumberInPackageVersion>
<IncludeBuildNumberInPackageVersion Condition="'$(SuppressFinalPackageVersion)' == 'true'">true</IncludeBuildNumberInPackageVersion>
<IncludeBuildNumberInPackageVersion Condition="'$(IsShipping)' != 'true'">true</IncludeBuildNumberInPackageVersion>

<ProductVersionSuffix Condition="'$(IncludePreReleaseLabelInPackageVersion)' == 'true'">-$(VersionSuffix)</ProductVersionSuffix>
<ProductBandVersion Condition="'$(ProductBandVersion)' == ''">$(MajorVersion).$(MinorVersion)</ProductBandVersion>
<ProductionVersion Condition="'$(ProductionVersion)' == ''">$(ProductBandVersion).$(PatchVersion)</ProductionVersion>
<ProductVersion>$(ProductionVersion)$(ProductVersionSuffix)</ProductVersion>

<SharedFrameworkNugetVersion>$(ProductVersion)</SharedFrameworkNugetVersion>
<NuGetVersion>$(SharedFrameworkNugetVersion)</NuGetVersion>
<InstallersRelativePath>Runtime/$(SharedFrameworkNugetVersion)/</InstallersRelativePath>

<!--
By default, we are always building the nuget packages for HostPolicy, HostFXR and
Dotnet/AppHost. Thus, the properties (below) are always set to $(ProductVersion).
However, there are scenarios when only some of these components will change (e.g. during
servicing, we may only change HostPolicy but not HostFXR and Dotnet/AppHost). In such cases,
pass the appropriate version value(s) as argument to the build command in order to override;
e.g. 'build -p:HostPolicyVersion=x.y.z ...'
-->
<HostVersion Condition="'$(HostVersion)' == ''">$(ProductVersion)</HostVersion>
<AppHostVersion Condition="'$(AppHostVersion)' == ''">$(ProductVersion)</AppHostVersion>
<HostResolverVersion Condition="'$(HostResolverVersion)' == ''">$(ProductVersion)</HostResolverVersion>
<HostPolicyVersion Condition="'$(HostPolicyVersion)' == ''">$(ProductVersion)</HostPolicyVersion>
</PropertyGroup>
</Target>
</Project>
2 changes: 1 addition & 1 deletion eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@

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

Expand Down
13 changes: 0 additions & 13 deletions src/installer/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,4 @@
want to ensure we use the correct packages. -->
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
</PropertyGroup>

<!-- Set up the default output and intermediate paths -->
<PropertyGroup>
<OSPlatformConfig>$(OutputRid).$(Configuration)</OSPlatformConfig>
<BaseOutputRootPath>$(ArtifactsBinDir)$(OSPlatformConfig)\</BaseOutputRootPath>
<IntermediateOutputRootPath>$(ArtifactsObjDir)$(OSPlatformConfig)\</IntermediateOutputRootPath>

<!-- Produce assets into the specified blob feed. -->
<AssetOutputPath Condition="'$(DotNetOutputBlobFeedDir)' != ''">$(DotNetOutputBlobFeedDir)assets/</AssetOutputPath>
<AssetOutputPath Condition="'$(AssetOutputPath)'==''">$(ArtifactsShippingPackagesDir)</AssetOutputPath>

<SymbolPackageOutputPath Condition="'$(SymbolPackageOutputPath)'==''">$(ArtifactsShippingPackagesDir)</SymbolPackageOutputPath>
</PropertyGroup>
</Project>
63 changes: 0 additions & 63 deletions src/installer/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -16,67 +16,4 @@

<!-- Provide default targets which can be hooked onto or overridden as necessary -->
<Target Name="Pack" />

<!--
Arcade SDK versioning is defined by static properties in a targets file: work around this by
moving properties based on versioning into a target.
-->
<Target Name="GetProductVersions">
<PropertyGroup>
<IncludePreReleaseLabelInPackageVersion Condition="'$(DotNetFinalVersionKind)' != 'release'">true</IncludePreReleaseLabelInPackageVersion>
<IncludePreReleaseLabelInPackageVersion Condition="'$(SuppressFinalPackageVersion)' == 'true'">true</IncludePreReleaseLabelInPackageVersion>
<IncludePreReleaseLabelInPackageVersion Condition="'$(IsShipping)' != 'true'">true</IncludePreReleaseLabelInPackageVersion>

<IncludeBuildNumberInPackageVersion Condition="'$(StabilizePackageVersion)' != 'true'">true</IncludeBuildNumberInPackageVersion>
<IncludeBuildNumberInPackageVersion Condition="'$(SuppressFinalPackageVersion)' == 'true'">true</IncludeBuildNumberInPackageVersion>
<IncludeBuildNumberInPackageVersion Condition="'$(IsShipping)' != 'true'">true</IncludeBuildNumberInPackageVersion>

<ProductVersionSuffix Condition="'$(IncludePreReleaseLabelInPackageVersion)' == 'true'">-$(VersionSuffix)</ProductVersionSuffix>
<ProductBandVersion Condition="'$(ProductBandVersion)' == ''">$(MajorVersion).$(MinorVersion)</ProductBandVersion>
<ProductionVersion Condition="'$(ProductionVersion)' == ''">$(ProductBandVersion).$(PatchVersion)</ProductionVersion>
<ProductVersion>$(ProductionVersion)$(ProductVersionSuffix)</ProductVersion>

<SharedFrameworkNugetVersion>$(ProductVersion)</SharedFrameworkNugetVersion>
<NuGetVersion>$(SharedFrameworkNugetVersion)</NuGetVersion>
<InstallersRelativePath>Runtime/$(SharedFrameworkNugetVersion)/</InstallersRelativePath>

<!--
By default, we are always building the nuget packages for HostPolicy, HostFXR and
Dotnet/AppHost. Thus, the "UseShipped*" properties (below) are always set to false.
However, there are scenarios when some of these components will not change (e.g. during
servicing, we may only change HostPolicy but not HostFXR and Dotnet/AppHost). In such cases,
set the appropriate "UseShipped*" property below to true and the corresponding "*Version"
property to the desired version so that we use the last shipped version of the package.
-->

<!-- The host/apphost package versions are only updated whenever there is a change in the components -->
<UseShippedHostPackage>false</UseShippedHostPackage>
<HostVersion Condition="'$(UseShippedHostPackage)' != 'true'">$(ProductVersion)</HostVersion>
<HostVersion Condition="'$(UseShippedHostPackage)' == 'true'">2.0.0</HostVersion>

<!-- The AppHostVersion is used for all hosts that aren't dotnet.exe -->
<UseShippedAppHostPackage>false</UseShippedAppHostPackage>
<AppHostVersion Condition="'$(UseShippedAppHostPackage)' != 'true'">$(ProductVersion)</AppHostVersion>
<AppHostVersion Condition="'$(UseShippedAppHostPackage)' == 'true'">2.0.0</AppHostVersion>

<!--
The FXR Resolver package version is only updated whenever there is a change in it.
If there is ever a need to use a shipped version of the package, then set the property
below to true.
-->
<UseShippedHostResolverPackage>false</UseShippedHostResolverPackage>
<HostResolverVersion Condition="'$(UseShippedHostResolverPackage)' != 'true'">$(ProductVersion)</HostResolverVersion>
<HostResolverVersion Condition="'$(UseShippedHostResolverPackage)' == 'true'">2.0.0</HostResolverVersion>

<!--
Host Policy package version is only updated whenever there is a change in it.
If there is ever a need to use a shipped version of the package, then set the property
below to true.
-->
<UseShippedHostPolicyPackage>false</UseShippedHostPolicyPackage>
<HostPolicyVersion Condition="'$(UseShippedHostPolicyPackage)' != 'true'">$(ProductVersion)</HostPolicyVersion>
<HostPolicyVersion Condition="'$(UseShippedHostPolicyPackage)' == 'true'">2.0.0</HostPolicyVersion>
</PropertyGroup>
</Target>
</Project>
2 changes: 1 addition & 1 deletion src/installer/pkg/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<PropertyGroup>
<Platform>$(TargetArchitecture)</Platform>
<DotNetHostBinDir>$(BaseOutputRootPath)corehost</DotNetHostBinDir>
<DotNetHostBinDir>$(ArtifactsBinDir)$(OutputRid).$(Configuration)\corehost</DotNetHostBinDir>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<IncrementalNativeBuild Condition="'$(IncrementalNativeBuild)' == ''">true</IncrementalNativeBuild>
<BuildCoreHostDependsOn>GetProductVersions;GenerateNativeVersionFile</BuildCoreHostDependsOn>
<BuildCoreHostDependsOn Condition="'$(DisableSourceLink)' != 'true'">$(BuildCoreHostDependsOn);InitializeSourceControlInformationFromSourceControlManager</BuildCoreHostDependsOn>
<IntermediateOutputRootPath>$(ArtifactsObjDir)$(OutputRid).$(Configuration)\</IntermediateOutputRootPath>
</PropertyGroup>

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

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

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

<PropertyGroup>
<BuildScript>$([MSBuild]::NormalizePath('$(MSBuildThisFileDirectory)', 'build.cmd'))</BuildScript>

<BuildArgs>$(Configuration) $(TargetArchitecture) apphostver $(AppHostVersion) hostver $(HostVersion) fxrver $(HostResolverVersion) policyver $(HostPolicyVersion) commit $([MSBuild]::ValueOrDefault('$(SourceRevisionId)', 'N/A')) rid $(OutputRid)</BuildArgs>
<BuildArgs Condition="'$(PortableBuild)' == 'true'">$(BuildArgs) portable</BuildArgs>
<BuildArgs Condition="'$(IncrementalNativeBuild)' == 'true'">$(BuildArgs) incremental-native-build</BuildArgs>
Expand All @@ -94,8 +98,8 @@
IgnoreStandardErrorWarningFormat because Arcade sets WarnAsError and there's an existing
warning in the native build.
-->
<Message Text="$(SharedNativeRoot)corehost\build.cmd $(BuildArgs)" Importance="High"/>
<Exec Command="$(SharedNativeRoot)corehost\build.cmd $(BuildArgs)" IgnoreStandardErrorWarningFormat="true"/>
<Message Text="&quot;$(BuildScript)&quot; $(BuildArgs)" Importance="High"/>
<Exec Command="&quot;$(BuildScript)&quot; $(BuildArgs)" IgnoreStandardErrorWarningFormat="true"/>
</Target>

<Target Name="PrependWindowsHeaderIncludeToVersionHeaderFile"
Expand Down

0 comments on commit 25bb59d

Please sign in to comment.