Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSantiago Fernandez Madero <safern@microsoft.com>2020-11-13 04:27:41 +0300
committerGitHub <noreply@github.com>2020-11-13 04:27:41 +0300
commit4c102bdf5c68fa5f027b224a23e11c24e385c49b (patch)
treeabbaac6ff3a8e79d0640264380d694f738e19317
parentce1d60ff19d76506eca59d21af47151d0fceb55c (diff)
Fix trimming linker tests (#44613)
-rw-r--r--Directory.Build.targets8
-rw-r--r--eng/testing/linker/SupportFiles/Directory.Build.props4
-rw-r--r--eng/testing/linker/SupportFiles/Directory.Build.targets20
-rw-r--r--eng/testing/linker/project.csproj.template1
-rw-r--r--eng/testing/linker/trimmingTests.targets4
5 files changed, 22 insertions, 15 deletions
diff --git a/Directory.Build.targets b/Directory.Build.targets
index 9d18986a3f8..68aa63fa324 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -29,19 +29,19 @@
-->
<ItemGroup>
<KnownFrameworkReference Include="Microsoft.NETCore.App"
- DefaultRuntimeFrameworkVersion="5.0.0-rc.1.20451.14"
+ DefaultRuntimeFrameworkVersion="$(MicrosoftNETCoreAppVersion)"
IsTrimmable="true"
- LatestRuntimeFrameworkVersion="5.0.0-rc.1.20451.14"
+ LatestRuntimeFrameworkVersion="$(MicrosoftNETCoreAppVersion)"
RuntimeFrameworkName="Microsoft.NETCore.App"
RuntimePackNamePatterns="Microsoft.NETCore.App.Runtime.**RID**"
RuntimePackRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm;win-arm64;win-x64;win-x86;ios-arm64;ios-arm;ios-x64;ios-x86;tvos-arm64;tvos-x64;android-arm64;android-arm;android-x64;android-x86;browser-wasm"
TargetFramework="$(NetCoreAppCurrent)"
TargetingPackName="Microsoft.NETCore.App.Ref"
- TargetingPackVersion="5.0.0-rc.1.20451.14" />
+ TargetingPackVersion="$(MicrosoftNETCoreAppVersion)" />
<KnownAppHostPack Include="Microsoft.NETCore.App"
AppHostPackNamePattern="Microsoft.NETCore.App.Host.**RID**"
- AppHostPackVersion="5.0.0-rc.1.20451.14"
+ AppHostPackVersion="$(MicrosoftNETCoreAppVersion)"
AppHostRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm;win-arm64;win-x64;win-x86"
TargetFramework="$(NetCoreAppCurrent)" />
</ItemGroup>
diff --git a/eng/testing/linker/SupportFiles/Directory.Build.props b/eng/testing/linker/SupportFiles/Directory.Build.props
index 4f2c8b61a1e..a2276bf20f9 100644
--- a/eng/testing/linker/SupportFiles/Directory.Build.props
+++ b/eng/testing/linker/SupportFiles/Directory.Build.props
@@ -8,4 +8,8 @@
<PlatformManifestFile />
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
</PropertyGroup>
+
+ <ItemGroup>
+ <FrameworkReference Include="Microsoft.NETCore.App" />
+ </ItemGroup>
</Project>
diff --git a/eng/testing/linker/SupportFiles/Directory.Build.targets b/eng/testing/linker/SupportFiles/Directory.Build.targets
index 3318b0f4010..0a59507942a 100644
--- a/eng/testing/linker/SupportFiles/Directory.Build.targets
+++ b/eng/testing/linker/SupportFiles/Directory.Build.targets
@@ -1,18 +1,20 @@
<Project>
<Target Name="RestoreProject">
<MSBuild Projects="$(MSBuildProjectFullPath)"
- Properties="Configuration=$(Configuration)"
+ Properties="Configuration=$(Configuration);ForceEvaluation=true"
Targets="Restore" />
</Target>
- <Target Name="AddFrameworkReference">
+ <Target Name="RemoveRuntimePackFromDownloadItem"
+ AfterTargets="ProcessFrameworkReferences">
<ItemGroup>
- <FrameworkReference Include="Microsoft.NETCore.App" />
+ <PackageDownload Remove="@(PackageDownload)"
+ Condition="$([System.String]::Copy('%(Identity)').StartsWith('Microsoft.NETCore.App.Runtime'))" />
</ItemGroup>
</Target>
<Target Name="UpdateRuntimePack"
- DependsOnTargets="AddFrameworkReference;ResolveFrameworkReferences">
+ DependsOnTargets="ResolveFrameworkReferences">
<ItemGroup>
<ResolvedRuntimePack Update="@(ResolvedRuntimePack)" PackageDirectory="$(RuntimePackDir)" />
<ResolvedTargetingPack Update="@(ResolvedTargetingPack)" Path="$(TargetingPackDir)" />
@@ -31,23 +33,23 @@
</ItemGroup>
</Target>
- <Target Name="PublishTrimmed" DependsOnTargets="RestoreProject;UpdateRuntimePack;Publish" />
+ <Target Name="PublishTrimmed" DependsOnTargets="ProcessFrameworkReferences;RestoreProject;UpdateRuntimePack;Publish" />
<ItemGroup>
<KnownFrameworkReference Include="Microsoft.NETCore.App"
- DefaultRuntimeFrameworkVersion="5.0.0-rc.1.20451.14"
+ DefaultRuntimeFrameworkVersion="$(MicrosoftNETCoreAppVersion)"
IsTrimmable="true"
- LatestRuntimeFrameworkVersion="5.0.0-rc.1.20451.14"
+ LatestRuntimeFrameworkVersion="$(MicrosoftNETCoreAppVersion)"
RuntimeFrameworkName="Microsoft.NETCore.App"
RuntimePackNamePatterns="Microsoft.NETCore.App.Runtime.**RID**"
RuntimePackRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm;win-arm64;win-x64;win-x86;ios-arm64;ios-arm;ios-x64;ios-x86;tvos-arm64;tvos-x64;android-arm64;android-arm;android-x64;android-x86;browser-wasm"
TargetFramework="net6.0"
TargetingPackName="Microsoft.NETCore.App.Ref"
- TargetingPackVersion="5.0.0-rc.1.20451.14" />
+ TargetingPackVersion="$(MicrosoftNETCoreAppVersion)" />
<KnownAppHostPack Include="Microsoft.NETCore.App"
AppHostPackNamePattern="Microsoft.NETCore.App.Host.**RID**"
- AppHostPackVersion="5.0.0-rc.1.20451.14"
+ AppHostPackVersion="$(MicrosoftNETCoreAppVersion)"
AppHostRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm;win-arm64;win-x64;win-x86"
TargetFramework="net6.0" />
</ItemGroup>
diff --git a/eng/testing/linker/project.csproj.template b/eng/testing/linker/project.csproj.template
index d335783fc44..eddb438480c 100644
--- a/eng/testing/linker/project.csproj.template
+++ b/eng/testing/linker/project.csproj.template
@@ -7,6 +7,7 @@
<RuntimePackDir>{RuntimePackDir}</RuntimePackDir>
<TargetingPackDir>{TargetingPackDir}</TargetingPackDir>
<NETCoreAppMaximumVersion>{NetCoreAppMaximumVersion}</NETCoreAppMaximumVersion>
+ <MicrosoftNETCoreAppVersion>{MicrosoftNETCoreAppVersion}</MicrosoftNETCoreAppVersion>
<!-- These can be removed once we get an SDK with https://github.com/mono/linker/pull/1385. -->
<LinkerNoWarn>IL2026</LinkerNoWarn>
diff --git a/eng/testing/linker/trimmingTests.targets b/eng/testing/linker/trimmingTests.targets
index 4a9152fbd5f..c88f9e204e9 100644
--- a/eng/testing/linker/trimmingTests.targets
+++ b/eng/testing/linker/trimmingTests.targets
@@ -2,7 +2,6 @@
<PropertyGroup>
<TrimmingTestDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'trimmingTests'))</TrimmingTestDir>
<TrimmingTestProjectsDir>$([MSBuild]::NormalizeDirectory('$(TrimmingTestDir)', 'projects'))</TrimmingTestProjectsDir>
- <TestDotNetPath>$([MSBuild]::NormalizePath('$(DotNetRoot)', 'dotnet'))</TestDotNetPath>
<ProjectTemplate>$(MSBuildThisFileDirectory)project.csproj.template</ProjectTemplate>
</PropertyGroup>
@@ -73,6 +72,7 @@
<MakeDir Directories="$(_projectDir)" />
<WriteLinesToFile File="$(_projectFile)"
Lines="$([System.IO.File]::ReadAllText('$(ProjectTemplate)')
+ .Replace('{MicrosoftNETCoreAppVersion}', '$(MicrosoftNETCoreAppVersion)')
.Replace('{NetCoreAppCurrent}', '$(NetCoreAppCurrent)')
.Replace('{NetCoreAppMaximumVersion}', '$(NetCoreAppMaximumVersion)')
.Replace('{RuntimePackDir}', '%(TestConsoleApps.RuntimePackDirectory)')
@@ -93,7 +93,7 @@
<Target Name="PublishTrimmedProjects"
DependsOnTargets="GenerateProjects">
<PropertyGroup>
- <TestPublishTrimmedCommand>"$(TestDotNetPath)"</TestPublishTrimmedCommand>
+ <TestPublishTrimmedCommand>"$(DotNetTool)"</TestPublishTrimmedCommand>
<TestPublishTrimmedCommand>$(TestPublishTrimmedCommand) build /t:PublishTrimmed</TestPublishTrimmedCommand>
<TestPublishTrimmedCommand>$(TestPublishTrimmedCommand) /nr:false</TestPublishTrimmedCommand>
<TestPublishTrimmedCommand>$(TestPublishTrimmedCommand) /warnaserror</TestPublishTrimmedCommand>