Skip to content

Commit 017de82

Browse files
eerhardtmmitche
authored andcommitted
Remove references to PlatformAbstractions. (dotnet#763)
* Remove references to PlatformAbstractions. This will allow us to remove the PlatformAbstractions library from dotnet/runtime. I needed to update the SDK used so I can use the new RuntimeInformation.RuntimeIdentifier API that is only in .NET 5. Contributes to dotnet/runtime#3470 * Remove leftover UsingTask * Add back CrossGenRootPath to sign binaries * Fix the tests by updating the TFM to 5.0
1 parent fc915c4 commit 017de82

File tree

9 files changed

+9
-118
lines changed

9 files changed

+9
-118
lines changed

Directory.Build.props

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@
4747
<LocalBuildToolsTaskFile>$(LocalBuildToolsTaskDir)local.tasks.dll</LocalBuildToolsTaskFile>
4848
</PropertyGroup>
4949

50-
<PropertyGroup>
51-
<HostMachineInfoProps>$(ObjDir)HostMachineInfo.props</HostMachineInfoProps>
52-
</PropertyGroup>
53-
5450
<PropertyGroup>
5551
<!--
5652
This name is used to create a GIT repository URL https://github.com/dotnet/$(GitHubRepositoryName) used to find source code for debugging
@@ -76,6 +72,9 @@
7672
<RunningOnUnix Condition="'$(OS)'!='Windows_NT'">true</RunningOnUnix>
7773

7874
<RunningOnCore Condition="'$(MSBuildRuntimeType)' == 'core'">true</RunningOnCore>
75+
76+
<HostRuntimeIdentifier Condition="'$(HostRuntimeIdentifier)' == '' and '$(RunningOnCore)' == 'true'">$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)</HostRuntimeIdentifier>
77+
<HostRuntimeIdentifier Condition="'$(HostRuntimeIdentifier)' == '' and '$(RunningOnCore)' != 'true'">win-$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString().ToLowerInvariant)</HostRuntimeIdentifier>
7978
</PropertyGroup>
8079

8180
<PropertyGroup>
@@ -163,11 +162,8 @@
163162
<ExeSuffix Condition="'$(OSGroup)'=='Windows_NT'">.exe</ExeSuffix>
164163
</PropertyGroup>
165164

166-
<Import Project="$(HostMachineInfoProps)"
167-
Condition="Exists('$(HostMachineInfoProps)')" />
168-
169-
<PropertyGroup Condition="'$(OutputRid)' == '' and '$(HostMachineRid)' != ''">
170-
<OutputRid>$(HostMachineRid.Remove($(HostMachineRid.LastIndexOf('-'))))-$(TargetArchitecture)</OutputRid>
165+
<PropertyGroup Condition="'$(OutputRid)' == '' and '$(HostRuntimeIdentifier)' != ''">
166+
<OutputRid>$(HostRuntimeIdentifier.Remove($(HostRuntimeIdentifier.LastIndexOf('-'))))-$(TargetArchitecture)</OutputRid>
171167
</PropertyGroup>
172168

173169
<!-- Portable -->

Directory.Build.targets

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<!-- Provide default targets which can be hooked onto or overridden as necessary -->
77
<Target Name="Pack" />
88

9-
<UsingTask TaskName="GetTargetMachineInfo" AssemblyFile="$(LocalBuildToolsTaskFile)" />
109
<UsingTask TaskName="RegenerateReadmeTable" AssemblyFile="$(LocalBuildToolsTaskFile)" />
1110

1211
<PropertyGroup>
@@ -61,26 +60,6 @@
6160
<Target Name="GetInstallerLocations"
6261
DependsOnTargets="GetProductVersions" />
6362

64-
<Target Name="CreateHostMachineInfoFile">
65-
<GetTargetMachineInfo>
66-
<Output PropertyName="HostMachineRid" TaskParameter="RuntimeIdentifier" />
67-
</GetTargetMachineInfo>
68-
69-
<PropertyGroup>
70-
<HostMachineInfoPropsContent>
71-
&lt;Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
72-
&lt;PropertyGroup&gt;
73-
&lt;HostMachineRid&gt;$(HostMachineRid)&lt;/HostMachineRid&gt;
74-
&lt;/PropertyGroup&gt;
75-
&lt;/Project&gt;
76-
</HostMachineInfoPropsContent>
77-
</PropertyGroup>
78-
79-
<WriteLinesToFile File="$(HostMachineInfoProps)"
80-
Lines="$(HostMachineInfoPropsContent)"
81-
Overwrite="True" />
82-
</Target>
83-
8463
<Target Name="GetLatestCommitHash"
8564
Condition="'$(LatestCommit)' == ''">
8665
<!-- Get the latest commit hash -->

eng/Build.props

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@
7979
Properties="RepoRoot=$(RepoRoot)"
8080
Targets="
8181
Restore;
82-
Build;
83-
CreateHostMachineInfoFile"/>
82+
Build"/>
8483

8584
<WriteLinesToFile
8685
File="$(RepoTasksOutputFile)"

eng/Signing.props

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,7 @@
2424
</ItemGroup>
2525

2626
<ItemGroup Condition="'$(SignBinaries)' == 'true'">
27-
<ItemsToSign Include="$(BaseOutputRootPath)corehost/**/hostfxr.dll" />
28-
<ItemsToSign Include="$(BaseOutputRootPath)corehost/**/hostpolicy.dll" />
29-
<ItemsToSign Include="$(BaseOutputRootPath)corehost/**/dotnet.exe" />
30-
<ItemsToSign Include="$(BaseOutputRootPath)corehost/**/ijwhost.dll" />
31-
<ItemsToSign Include="$(BaseOutputRootPath)corehost/**/winrthost.dll" />
32-
<ItemsToSign Include="$(BaseOutputRootPath)corehost/**/nethost.dll" />
33-
3427
<ItemsToSign Include="$(CrossGenRootPath)**/*.dll" />
35-
36-
<ItemsToSign Include="$(ArtifactsBinDir)Microsoft.DotNet.PlatformAbstractions/**/*.dll" />
37-
<ItemsToSign Include="$(ArtifactsBinDir)Microsoft.Extensions.DependencyModel/**/*.dll" />
38-
<ItemsToSign Include="$(ArtifactsBinDir)Microsoft.NET.HostModel/**/*.dll" />
3928
</ItemGroup>
4029

4130
<ItemGroup Condition="'$(SignMsiFiles)' == 'true'">

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"tools": {
3-
"dotnet": "3.1.101"
3+
"dotnet": "5.0.100-preview.5.20228.8"
44
},
55
"msbuild-sdks": {
66
"Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20201.2",

src/windowsdesktop/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<TestRestoreNuGetConfigFile>$(ObjDir)TestNuGetConfig\NuGet.config</TestRestoreNuGetConfigFile>
1010
<InternalNupkgCacheDir>$(ObjDir)ExtraNupkgsForTestRestore\</InternalNupkgCacheDir>
1111
<TestArchitectures>$(TargetArchitecture)</TestArchitectures>
12-
<TestInfraTargetFramework>netcoreapp3.0</TestInfraTargetFramework>
12+
<TestInfraTargetFramework>netcoreapp5.0</TestInfraTargetFramework>
1313
</PropertyGroup>
1414

1515
</Project>

src/windowsdesktop/Directory.Build.targets

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,8 @@
5757
</Target>
5858

5959
<Target Name="DetermineTestOutputDirectory">
60-
<GetTargetMachineInfo>
61-
<Output TaskParameter="RuntimeIdentifier" PropertyName="_HostRid" />
62-
</GetTargetMachineInfo>
63-
6460
<PropertyGroup>
65-
<TestTargetRid Condition="'$(TestTargetRid)' == ''">$(_HostRid)</TestTargetRid>
61+
<TestTargetRid Condition="'$(TestTargetRid)' == ''">$(HostRuntimeIdentifier)</TestTargetRid>
6662
<TestsOutputName Condition="'$(TestsOutputName)' == ''">$(MSBuildProjectName)</TestsOutputName>
6763

6864
<TestsOutputRootDir Condition="'$(TestsOutputRootDir)' == ''">$(ArtifactsDir)tests/$(ConfigurationGroup)/</TestsOutputRootDir>

tools-local/tasks/GetTargetMachineInfo.cs

Lines changed: 0 additions & 67 deletions
This file was deleted.

tools-local/tasks/local.tasks.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<ItemGroup>
1818
<PackageReference Include="NuGet.ProjectModel" Version="$(NugetProjectModelVersion)" />
1919
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.1.0" />
20-
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="2.1.0" />
2120
</ItemGroup>
2221

2322
<ItemGroup Condition="'$(TargetFramework)' != 'net46'">

0 commit comments

Comments
 (0)