Skip to content

Commit

Permalink
Simplify usage of the installer and shared framework SDKs based on im…
Browse files Browse the repository at this point in the history
…provements in the tooling (#109710)
  • Loading branch information
jkoritzinsky authored Dec 20, 2024
1 parent 347a568 commit ec1e561
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 72 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.SharedFramework.Sdk" />
<Project Sdk="Microsoft.NET.Sdk">
<Sdk Name="Microsoft.DotNet.SharedFramework.Sdk" />

<PropertyGroup>
<!-- Crossgen is not used for Mono -->
Expand All @@ -11,7 +10,6 @@
<ArchiveName>dotnet-crossgen2</ArchiveName>
<SharedFrameworkHostFileNameOverride>crossgen2</SharedFrameworkHostFileNameOverride>
<GenerateInstallers>false</GenerateInstallers>
<HostJsonTargetPath>tools/</HostJsonTargetPath>
<PermitDllAndExeFilesLackingFileVersion>true</PermitDllAndExeFilesLackingFileVersion>
<!-- Publishing as single-file or NativeAOT means we can't examine the interior DLLs -->
<ShouldVerifyClosure>false</ShouldVerifyClosure>
Expand Down Expand Up @@ -72,23 +70,4 @@
<_SymbolFilesToPackage Include="@(_Crossgen2SymbolFilesToPackage)" TargetPath="tools/" />
</ItemGroup>
</Target>

<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.SharedFramework.Sdk" />

<Target Name="GetFilesToPublish">
<MSBuild Projects="$(MSBuildProjectFullPath)"
Targets="_GetAllSharedFrameworkFiles"
RemoveProperties="OutputPath;SymbolsOutputPath">
<Output TaskParameter="TargetOutputs" ItemName="_FilesToPackage" />
</MSBuild>
<ItemGroup>
<_PackagedFilesToPublish Include="@(_FilesToPackage)" Condition="'%(_FilesToPackage.PackOnly)' != 'true'" />
</ItemGroup>
<ItemGroup>
<FilesToPublish Include="@(_PackagedFilesToPublish)"
TargetPath="" />
</ItemGroup>
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,4 @@
<HeatOutputFileElementToStabilize Include="native\singlefilehost.exe" ReplacementId="staticapphosttemplateapphostexe" />
<HeatOutputFileElementToStabilize Include="native\comhost.dll" ReplacementId="comhosttemplatecomhostdll" />
</ItemGroup>

<Target Name="AddLinuxPackageInformation" BeforeTargets="GetDebInstallerJsonProperties;GetRpmInstallerJsonProperties">
<ItemGroup>
<RpmOwnedDirectory Include="$(LinuxInstallRoot)/packs/Microsoft.NETCore.App.Host.$(RuntimeIdentifier)" />
<RpmOwnedDirectory Include="$(LinuxInstallRoot)/packs/Microsoft.NETCore.App.Host.$(RuntimeIdentifier)/$(Version)" />
<RpmOwnedDirectory Include="$(LinuxInstallRoot)/packs/Microsoft.NETCore.App.Host.$(RuntimeIdentifier)/$(Version)/runtimes" />
<RpmOwnedDirectory Include="$(LinuxInstallRoot)/packs/Microsoft.NETCore.App.Host.$(RuntimeIdentifier)/$(Version)/runtimes/$(RuntimeIdentifier)" />
<RpmOwnedDirectory Include="$(LinuxInstallRoot)/packs/Microsoft.NETCore.App.Host.$(RuntimeIdentifier)/$(Version)/runtimes/$(RuntimeIdentifier)/native" />
</ItemGroup>
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,4 @@
<FilesToPackage Include="@(Analyzer)" ExcludeFromValidation="true" TargetPath="analyzers/%(RecursiveDir)" />
</ItemGroup>
</Target>

<Target Name="AddLinuxPackageInformation" BeforeTargets="GetDebInstallerJsonProperties;GetRpmInstallerJsonProperties">
<ItemGroup>
<RpmOwnedDirectory Include="$(LinuxInstallRoot)/packs/Microsoft.NETCore.App.Ref" />
<RpmOwnedDirectory Include="$(LinuxInstallRoot)/packs/Microsoft.NETCore.App.Ref/$(Version)" />
<RpmOwnedDirectory Include="$(LinuxInstallRoot)/packs/Microsoft.NETCore.App.Ref/$(Version)/data" />
<RpmOwnedDirectory Include="$(LinuxInstallRoot)/packs/Microsoft.NETCore.App.Ref/$(Version)/analyzers" />
<RpmOwnedDirectory Include="$(LinuxInstallRoot)/packs/Microsoft.NETCore.App.Ref/$(Version)/ref" />
<RpmOwnedDirectory Include="$(LinuxInstallRoot)/packs/Microsoft.NETCore.App.Ref/$(Version)/ref/$(TargetFramework)" />
</ItemGroup>
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,6 @@
<IgnoredDuplicateType Include="Internal.Runtime.CompilerHelpers.LibraryInitializer" />
</ItemGroup>

<Target Name="AddLinuxPackageInformation" BeforeTargets="GetDebInstallerJsonProperties;GetRpmInstallerJsonProperties">
<ItemGroup>
<LinuxPackageDependency Include="dotnet-hostfxr-$(MajorVersion).$(MinorVersion);dotnet-runtime-deps-$(MajorVersion).$(MinorVersion)" Version="$(InstallerPackageVersion)" />
<RpmOwnedDirectory Include="$(LinuxInstallRoot)/shared/$(MicrosoftNetCoreAppFrameworkName);$(LinuxInstallRoot)/shared/$(MicrosoftNetCoreAppFrameworkName)/$(Version)" />
</ItemGroup>
</Target>

<!-- Mobile and NativeAOT use a different hosting model, so we don't include the .NET host components. -->
<ItemGroup Condition="'$(TargetsMobile)' != 'true' and '$(BuildNativeAOTRuntimePack)' != 'true'">
<_HostFiles Include="$(DotNetHostBinDir)/$(LibPrefix)hostpolicy$(LibSuffix)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Archives" Version="$(MicrosoftDotNetBuildTasksArchivesVersion)" />
<LinuxPackageDependency Include="dotnet-hostfxr-$(MajorVersion).$(MinorVersion);dotnet-runtime-deps-$(MajorVersion).$(MinorVersion)" Version="$(InstallerPackageVersion)" />
</ItemGroup>

<Import Project="Microsoft.NETCore.App.Runtime.props" />
Expand Down
20 changes: 9 additions & 11 deletions src/installer/pkg/sfx/installers/dotnet-host.proj
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,15 @@
DestinationFolder="$(SymbolsOutputPath)" />
</Target>

<Target Name="AddLinuxPackageInformation" BeforeTargets="GetDebInstallerJsonProperties;GetRpmInstallerJsonProperties">
<ItemGroup Condition="'$(GenerateDeb)' == 'true'">
<LinuxPackageDependency Include="libc6;libgcc1;libstdc++6" />
</ItemGroup>
<ItemGroup>
<DebSymlink Include="/usr/bin/dotnet" LinkTarget="../share/dotnet/dotnet" />
<DebControlProperty Include="Conflicts" Value="dotnet, dotnet-nightly" />
<RpmConflicts Include="dotnet;dotnet-nightly" />
<RpmOwnedDirectory Include="/usr/share/dotnet" />
</ItemGroup>
</Target>
<ItemGroup Condition="'$(GenerateDeb)' == 'true'">
<LinuxPackageDependency Include="libc6;libgcc1;libstdc++6" />
</ItemGroup>

<ItemGroup>
<LinuxPackageSymlink Include="/usr/bin/dotnet" LinkTarget="../share/dotnet/dotnet" />
<LinuxPackageConflicts Include="dotnet;dotnet-nightly" />
<RpmOwnedDirectory Include="/usr/share/dotnet" />
</ItemGroup>

<PropertyGroup>
<_MacOSIntermediatesPath>$(IntermediateOutputPath)macos/</_MacOSIntermediatesPath>
Expand Down
19 changes: 9 additions & 10 deletions src/installer/pkg/sfx/installers/dotnet-hostfxr.proj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<InstallerName>dotnet-hostfxr</InstallerName>
<InstallerName Condition="'$(TargetOS)' == 'osx'">dotnet-hostfxr-internal</InstallerName>
<PackageBrandNameSuffix>Host FX Resolver</PackageBrandNameSuffix>
<PlatformPackageType>ToolPack</PlatformPackageType>
<VSInsertionShortComponentName>NetCore.HostFXR</VSInsertionShortComponentName>
<WixIncludeRegistryKeys>true</WixIncludeRegistryKeys>
<RegKeyProductName>hostfxr</RegKeyProductName>
Expand Down Expand Up @@ -39,13 +38,13 @@
DestinationFolder="$(SymbolsOutputPath)" />
</Target>

<Target Name="AddLinuxPackageInformation" BeforeTargets="GetDebInstallerJsonProperties;GetRpmInstallerJsonProperties">
<ItemGroup Condition="'$(GenerateDeb)' == 'true'">
<LinuxPackageDependency Include="libc6;libgcc1;libstdc++6" />
</ItemGroup>
<ItemGroup>
<LinuxPackageDependency Include="dotnet-host" Version="$(InstallerPackageVersion)" />
<RpmOwnedDirectory Include="/usr/share/dotnet/host;/usr/share/dotnet/host/fxr;/usr/share/dotnet/host/fxr/$(Version)" />
</ItemGroup>
</Target>
<ItemGroup Condition="'$(GenerateDeb)' == 'true'">
<LinuxPackageDependency Include="libc6;libgcc1;libstdc++6" />
</ItemGroup>

<ItemGroup>
<LinuxPackageDependency Include="dotnet-host" Version="$(InstallerPackageVersion)" />
<RpmOwnedDirectory Include="/usr/share/dotnet/host;/usr/share/dotnet/host/fxr;/usr/share/dotnet/host/fxr/$(Version)" />
</ItemGroup>

</Project>

0 comments on commit ec1e561

Please sign in to comment.