未验证 提交 fcad78b2 编写于 作者: E Eric StJohn 提交者: GitHub

Change package testing to use RuntimeTargets rather than RID-specific restore (#53575)

* Change package testing to use RuntimeTargets rather than RID-specific restore

* Upload binlogs for package testing

* Address feedback

Simplify outer build of package tests to just use InnerTargets extension point.

Use Helix's work-item isolated packages folder

Give a better name to binlogs

* Cleanup old suppressions

* Use ReferenceCopyLocalPaths for runtime testing

This item will be conflict-resolved whereas RuntimeCopyLocalItems was not.

Also fix the case where a package intentionally provides no assets (yet installs)

* Don't include runtime dependencies when reference was excluded by conflict resolution

* Fix import conventions in outer build

* Workaround conflict resolution on .NETStandard runtime

.NETStandard doesn't conflict resolve runtime assets.
Workaround by feeding .NETStandard references as runtime for purposes of conflict resolution.
上级 01774462
<Project>
<PropertyGroup>
<RuntimeFrameworkVersion>$(MicrosoftNETCoreAppVersion)</RuntimeFrameworkVersion>
</PropertyGroup>
<ItemGroup>
<KnownFrameworkReference Remove="Microsoft.AspNetCore.App" />
<KnownFrameworkReference Remove="Microsoft.WindowsDesktop.App" />
......
......@@ -4,10 +4,6 @@
<PropertyGroup>
<ShouldVerifyClosure>true</ShouldVerifyClosure>
<ShouldVerifyTypes>true</ShouldVerifyTypes>
<!-- ensure that we get runtime assemblies in ReferenceCopyLocalPaths -->
<SelfContained>true</SelfContained>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<ItemGroup>
......
<Project>
<ItemGroup Condition="'$(RuntimeIdentifier)' != ''">
<IgnoredTypes Include="System.Collections.StructuralComparisons" />
<IgnoredTypes Include="System.Threading.WaitHandleExtensions" />
<IgnoredTypes Include="System.Console" />
<IgnoredTypes Include="System.BitConverter" />
<IgnoredTypes Include="System.IO.Path" />
<IgnoredTypes Include="System.IServiceProvider" />
<IgnoredTypes Include="System.IO.FileAccess" />
<IgnoredTypes Include="System.IO.UnmanagedMemoryAccessor" />
<IgnoredTypes Include="System.IO.UnmanagedMemoryStream" />
<IgnoredTypes Include="System.Runtime.CompilerServices.RuntimeOps" />
<IgnoredTypes Include="System.Net.Sockets.IPAddressExtensions" />
<IgnoredTypes Include="System.Collections.ObjectModel.KeyedCollection`2" />
<IgnoredTypes Include="System.Collections.ObjectModel.ReadOnlyDictionary`2" />
<IgnoredTypes Include="System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection" />
<IgnoredTypes Include="System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection" />
<IgnoredTypes Include="System.Security.Principal.IIdentity" />
<IgnoredTypes Include="System.Security.Principal.IPrincipal" />
<IgnoredTypes Include="System.Security.Principal.TokenImpersonationLevel" />
<IgnoredTypes Include="System.Threading.CountdownEvent" />
<IgnoredTypes Include="System.Threading.IOCompletionCallback" />
<IgnoredTypes Include="System.Threading.NativeOverlapped" />
<IgnoredTypes Include="System.DBNull" />
<IgnoredTypes Include="System.Runtime.Serialization.OnDeserializedAttribute" />
<IgnoredTypes Include="System.Runtime.Serialization.OnDeserializingAttribute" />
<IgnoredTypes Include="System.Runtime.Serialization.OnSerializingAttribute" />
<IgnoredTypes Include="System.Runtime.Serialization.OnSerializedAttribute" />
<IgnoredTypes Include="System.Runtime.Serialization.SerializationException" />
<IgnoredTypes Include="System.Runtime.Serialization.StreamingContext" />
</ItemGroup>
</Project>
\ No newline at end of file
<Project>
<ItemGroup Condition="'$(RuntimeIdentifier)' != ''">
<IgnoredTypes Include="System.Collections.StructuralComparisons" />
<IgnoredTypes Include="System.Threading.WaitHandleExtensions" />
<IgnoredTypes Include="System.Console" />
<IgnoredTypes Include="System.BitConverter" />
<IgnoredTypes Include="System.IO.Path" />
<IgnoredTypes Include="System.IServiceProvider" />
<IgnoredTypes Include="System.Text.NormalizationForm" />
<IgnoredTypes Include="System.Globalization.IdnMapping" />
<IgnoredTypes Include="System.IO.FileAccess" />
<IgnoredTypes Include="System.IO.UnmanagedMemoryAccessor" />
<IgnoredTypes Include="System.IO.UnmanagedMemoryStream" />
<IgnoredTypes Include="System.Runtime.CompilerServices.RuntimeOps" />
<IgnoredTypes Include="System.Net.Sockets.IPAddressExtensions" />
<IgnoredTypes Include="System.Collections.ObjectModel.KeyedCollection`2" />
<IgnoredTypes Include="System.Collections.ObjectModel.ReadOnlyDictionary`2" />
<IgnoredTypes Include="System.Collections.ObjectModel.ReadOnlyDictionary`2/KeyCollection" />
<IgnoredTypes Include="System.Collections.ObjectModel.ReadOnlyDictionary`2/ValueCollection" />
<IgnoredTypes Include="System.Security.Principal.IIdentity" />
<IgnoredTypes Include="System.Security.Principal.IPrincipal" />
<IgnoredTypes Include="System.Security.Principal.TokenImpersonationLevel" />
<IgnoredTypes Include="System.Threading.CountdownEvent" />
<IgnoredTypes Include="System.Threading.IOCompletionCallback" />
<IgnoredTypes Include="System.Threading.NativeOverlapped" />
<IgnoredTypes Include="System.DBNull" />
<IgnoredTypes Include="System.Runtime.Serialization.OnDeserializedAttribute" />
<IgnoredTypes Include="System.Runtime.Serialization.OnDeserializingAttribute" />
<IgnoredTypes Include="System.Runtime.Serialization.OnSerializingAttribute" />
<IgnoredTypes Include="System.Runtime.Serialization.OnSerializedAttribute" />
<IgnoredTypes Include="System.Runtime.Serialization.SerializationException" />
<IgnoredTypes Include="System.Runtime.Serialization.StreamingContext" />
</ItemGroup>
</Project>
\ No newline at end of file
<Project>
<ItemGroup Condition="'$(RuntimeIdentifier)' != ''">
<!-- NETCoreApp2.0 had experimental versions of Span and ReadOnlySpan
which we don't match the final API nor were they ship-quality -->
<IgnoredTypes Include="System.ReadOnlySpan`1" />
<IgnoredTypes Include="System.Span`1" />
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -14,4 +14,12 @@
<!-- windows.winmd is not part of the framework -->
<IgnoredReference Include="Windows" />
</ItemGroup>
<!-- Include NETStandard assemblies when considering runtime assets for conflict resolution
works around https://github.com/dotnet/sdk/issues/18129 -->
<Target Name="IncludeNetStandardConflictResolution" BeforeTargets="_HandlePackageFileConflicts">
<ItemGroup>
<_RuntimeAssetsForConflictResolution Include="@(Reference)" Condition="'%(Reference.NuGetPackageId)' == 'NETStandard.Library' or '%(Reference.NuGetPackageId)' == 'NETStandard.Library.Ref'" />
</ItemGroup>
</Target>
</Project>
\ No newline at end of file
<Project>
<!-- Issue https://github.com/dotnet/runtime/issues/29209 NS2.1 overlaps with existing ns2.0 libs -->
<ItemGroup>
<!-- System.Buffers -->
<IgnoredTypes Include="System.Buffers.ArrayPool`1" />
<!-- System.Memory -->
<IgnoredTypes Include="System.Buffers.Binary.BinaryPrimitives" />
<IgnoredTypes Include="System.Buffers.BuffersExtensions" />
<IgnoredTypes Include="System.Buffers.IBufferWriter`1" />
<IgnoredTypes Include="System.Buffers.IMemoryOwner`1" />
<IgnoredTypes Include="System.Buffers.IPinnable" />
<IgnoredTypes Include="System.Buffers.MemoryHandle" />
<IgnoredTypes Include="System.Buffers.MemoryManager`1" />
<IgnoredTypes Include="System.Buffers.MemoryPool`1" />
<IgnoredTypes Include="System.Buffers.OperationStatus" />
<IgnoredTypes Include="System.Buffers.ReadOnlySequence`1" />
<IgnoredTypes Include="System.Buffers.ReadOnlySequence`1/Enumerator" />
<IgnoredTypes Include="System.Buffers.ReadOnlySequenceSegment`1" />
<IgnoredTypes Include="System.Buffers.StandardFormat" />
<IgnoredTypes Include="System.Buffers.Text.Base64" />
<IgnoredTypes Include="System.Buffers.Text.Utf8Formatter" />
<IgnoredTypes Include="System.Buffers.Text.Utf8Parser" />
<IgnoredTypes Include="System.Memory`1" />
<IgnoredTypes Include="System.MemoryExtensions" />
<IgnoredTypes Include="System.ReadOnlyMemory`1" />
<IgnoredTypes Include="System.ReadOnlySpan`1" />
<IgnoredTypes Include="System.ReadOnlySpan`1/Enumerator" />
<IgnoredTypes Include="System.Runtime.InteropServices.MemoryMarshal" />
<IgnoredTypes Include="System.Runtime.InteropServices.SequenceMarshal" />
<IgnoredTypes Include="System.SequencePosition" />
<IgnoredTypes Include="System.Span`1" />
<IgnoredTypes Include="System.Span`1/Enumerator" />
<!-- System.Numerics.Vectors -->
<IgnoredTypes Include="System.Numerics.Matrix3x2" />
<IgnoredTypes Include="System.Numerics.Matrix4x4" />
<IgnoredTypes Include="System.Numerics.Plane" />
<IgnoredTypes Include="System.Numerics.Quaternion" />
<IgnoredTypes Include="System.Numerics.Vector" />
<IgnoredTypes Include="System.Numerics.Vector`1" />
<IgnoredTypes Include="System.Numerics.Vector2" />
<IgnoredTypes Include="System.Numerics.Vector3" />
<IgnoredTypes Include="System.Numerics.Vector4" />
<!-- System.Reflection.DispatchProxy -->
<IgnoredTypes Include="System.Reflection.DispatchProxy" />
<!-- System.Reflection.Emit -->
<IgnoredTypes Include="System.Reflection.Emit.AssemblyBuilder" />
<IgnoredTypes Include="System.Reflection.Emit.AssemblyBuilderAccess" />
<IgnoredTypes Include="System.Reflection.Emit.ConstructorBuilder" />
<IgnoredTypes Include="System.Reflection.Emit.EnumBuilder" />
<IgnoredTypes Include="System.Reflection.Emit.EventBuilder" />
<IgnoredTypes Include="System.Reflection.Emit.FieldBuilder" />
<IgnoredTypes Include="System.Reflection.Emit.GenericTypeParameterBuilder" />
<IgnoredTypes Include="System.Reflection.Emit.MethodBuilder" />
<IgnoredTypes Include="System.Reflection.Emit.ModuleBuilder" />
<IgnoredTypes Include="System.Reflection.Emit.PropertyBuilder" />
<IgnoredTypes Include="System.Reflection.Emit.TypeBuilder" />
<!-- System.Reflection.Emit.ILGeneration -->
<IgnoredTypes Include="System.Reflection.Emit.CustomAttributeBuilder" />
<IgnoredTypes Include="System.Reflection.Emit.ILGenerator" />
<IgnoredTypes Include="System.Reflection.Emit.Label" />
<IgnoredTypes Include="System.Reflection.Emit.LocalBuilder" />
<IgnoredTypes Include="System.Reflection.Emit.ParameterBuilder" />
<IgnoredTypes Include="System.Reflection.Emit.SignatureHelper" />
<!-- System.Reflection.Emit.Lightweight -->
<IgnoredTypes Include="System.Reflection.Emit.DynamicMethod" />
<!-- System.Threading.Tasks.Extensions -->
<IgnoredTypes Include="System.Runtime.CompilerServices.AsyncMethodBuilderAttribute" />
<IgnoredTypes Include="System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder" />
<IgnoredTypes Include="System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder`1" />
<IgnoredTypes Include="System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable" />
<IgnoredTypes Include="System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable/ConfiguredValueTaskAwaiter" />
<IgnoredTypes Include="System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1" />
<IgnoredTypes Include="System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1/ConfiguredValueTaskAwaiter" />
<IgnoredTypes Include="System.Runtime.CompilerServices.ValueTaskAwaiter" />
<IgnoredTypes Include="System.Runtime.CompilerServices.ValueTaskAwaiter`1" />
<IgnoredTypes Include="System.Threading.Tasks.Sources.IValueTaskSource" />
<IgnoredTypes Include="System.Threading.Tasks.Sources.IValueTaskSource`1" />
<IgnoredTypes Include="System.Threading.Tasks.Sources.ValueTaskSourceOnCompletedFlags" />
<IgnoredTypes Include="System.Threading.Tasks.Sources.ValueTaskSourceStatus" />
<IgnoredTypes Include="System.Threading.Tasks.ValueTask" />
<IgnoredTypes Include="System.Threading.Tasks.ValueTask`1" />
</ItemGroup>
</Project>
\ No newline at end of file
<Project>
<PropertyGroup>
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile259</TargetFrameworkProfile>
</PropertyGroup>
</Project>
\ No newline at end of file
<Project>
<PropertyGroup>
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile111</TargetFrameworkProfile>
</PropertyGroup>
</Project>
\ No newline at end of file
<Project>
<PropertyGroup>
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile7</TargetFrameworkProfile>
</PropertyGroup>
</Project>
\ No newline at end of file
<Project>
<PropertyGroup>
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile7</TargetFrameworkProfile>
</PropertyGroup>
</Project>
\ No newline at end of file
<Project>
<PropertyGroup>
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile44</TargetFrameworkProfile>
</PropertyGroup>
</Project>
\ No newline at end of file
<Project>
<PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' != ''">
<_targetFrameworkVersionIndex>$(TargetFramework.IndexOfAny(".-0123456789"))</_targetFrameworkVersionIndex>
<_targetFrameworkIdentifier Condition="'$(_runtimeOSVersionIndex)' != '-1'">$(TargetFramework.SubString(0, $(_targetFrameworkVersionIndex)))</_targetFrameworkIdentifier>
<!-- For net5.0 and later use netcoreapp folder. -->
<_targetFrameworkIdentifier Condition="'$(_targetFrameworkIdentifier)' == 'net' and !$(TargetFramework.StartsWith('net4'))">netcoreapp</_targetFrameworkIdentifier>
</PropertyGroup>
<PropertyGroup>
<ToolsDir>$(MSBuildThisFileDirectory)tools\</ToolsDir>
<RestoreSources>
......@@ -14,6 +16,9 @@
https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6-transport/nuget/v3/index.json;
$(LocalPackagesPath)
</RestoreSources>
<!-- Make sure the SDK raises the runtime items so that they are passed to conflict resolution -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<Import Project="tools\build\Packaging.common.targets" />
......@@ -21,8 +26,8 @@
<Import Project="frameworkSettings\$(_targetFrameworkIdentifier)\*.targets" />
<Import Project="frameworkSettings\$(TargetFramework)\*.targets" />
<Import Project="packageSettings\$(TestPackageId)\*.targets" />
<Import Project="packageSettings\$(TestPackageId)\$(_targetFrameworkIdentifier)\*.targets" />
<Import Project="packageSettings\$(TestPackageId)\$(TargetFramework)\*.targets" />
<Import Condition="'$(_targetFrameworkIdentifier)' != ''" Project="packageSettings\$(TestPackageId)\$(_targetFrameworkIdentifier)\*.targets" />
<Import Condition="'$(TargetFramework)' != ''" Project="packageSettings\$(TestPackageId)\$(TargetFramework)\*.targets" />
<ItemGroup>
<!-- Type duplicated: https://github.com/dotnet/runtime/issues/33998 -->
......@@ -31,17 +36,14 @@
<IgnoredTypes Include="System.Collections.Generic.CollectionExtensions" />
</ItemGroup>
<Target Name="LogBeginTest">
<PropertyGroup>
<_message>Testing $(TestPackageID) TFM=$(TargetFramework)</_message>
<_message Condition="'$(RuntimeIdentifier)' != ''">$(_message) RID=$(RuntimeIdentifier)</_message>
</PropertyGroup>
<Message Importance="High" Text="$(_message)" />
<Message Importance="High" Text="Testing $(TestPackageID) TFM=$(TargetFramework)" />
</Target>
<Target Name="VerifyReferenceClosure"
DependsOnTargets="ResolveReferences"
Condition="'$(ShouldVerifyClosure)' == 'true' and '$(RuntimeIdentifier)' == ''">
Condition="'$(ShouldVerifyClosure)' == 'true'">
<ItemGroup>
<_refClosureFileNames Include="@(ReferencePath->'%(FileName)')">
<Original>%(Identity)</Original>
......@@ -57,7 +59,7 @@
<Target Name="VerifyReferenceTypes"
DependsOnTargets="ResolveReferences"
Condition="'$(ShouldVerifyTypes)' == 'true' and '$(RuntimeIdentifier)' == ''">
Condition="'$(ShouldVerifyTypes)' == 'true'">
<ItemGroup>
<_refTypesFileNames Include="@(ReferencePath->'%(FileName)')">
<Original>%(Identity)</Original>
......@@ -71,11 +73,37 @@
IgnoredTypes="@(IgnoredTypes)" />
</Target>
<Target Name="PrepareForRuntimeTesting" DependsOnTargets="ResolveReferences">
<ItemGroup>
<ReferenceLibToTest Include="@(ReferencePath)" Condition="'%(ReferencePath.NuGetPackageId)' == '$(TestPackageId)'" />
<RuntimeLibToTest Include="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' == '$(TestPackageId)'" />
<RuntimeLibToTest Condition="'%(RuntimeLibToTest.RuntimeIdentifier)' == ''" RuntimeIdentifier="none" />
</ItemGroup>
<ItemGroup>
<RuntimeLibToTestDependency Include="@(ReferencePath)" Condition="'%(ReferencePath.NuGetPackageId)' != '$(TestPackageId)'" />
<!-- Some dependent packages may be excluded from compile, consider these as candiates as well.-->
<ReferenceCopyLocalPaths Original="%(Identity)" />
<_referenceCopyLocalPathsPackages Include="@(ReferenceCopyLocalPaths->'%(NuGetPackageId)')"
Condition="'%(ReferenceCopyLocalPaths.RuntimeIdentifier)' == ''"
Exclude="@(ReferencePath->'%(NuGetPackageId)');$(TestPackageId)" />
<RuntimeLibToTestDependency Include="@(_referenceCopyLocalPathsPackages->'%(Original)')" />
</ItemGroup>
<Error Condition="'@(RuntimeLibToTest)' == '' AND '@(ReferenceLibToTest)' != ''" Text="Could not locate any runtime items from Package $(TestPackageID)" />
<Message Condition="'@(RuntimeLibToTest)' != ''" Importance="High" Text="Testing $(TestPackageID) runtime on TFM=$(TargetFramework) RIDs=@(RuntimeLibToTest->'%(RuntimeIdentifier)'->Distinct())" />
</Target>
<Target Name="VerifyRuntimeClosure"
DependsOnTargets="ResolveReferences"
Condition="'$(ShouldVerifyClosure)' == 'true' and '$(RuntimeIdentifier)' != '' and '$(SkipVerifyClosureForRuntime)' != 'true'">
Inputs="%(RuntimeLibToTest.RuntimeIdentifier)"
Outputs="unused"
DependsOnTargets="PrepareForRuntimeTesting"
Condition="'$(ShouldVerifyClosure)' == 'true' and '$(SkipVerifyClosureForRuntime)' != 'true'">
<Message Importance="High" Text="Testing closure for $(TestPackageID) TFM=$(TargetFramework) RID=%(RuntimeLibToTest.RuntimeIdentifier)" />
<ItemGroup>
<_runClosureFileNames Include="@(ReferenceCopyLocalPaths->'%(FileName)')">
<_runClosureFileNames Include="@(RuntimeLibToTestDependency->'%(FileName)');@(RuntimeLibToTest->'%(FileName)')">
<Original>%(Identity)</Original>
</_runClosureFileNames>
<_runClosureFileNamesFiltered Include="@(_runClosureFileNames)" Exclude="@(ExcludeFromClosure);@(ExcludeFromClosure->'%(Identity).ni')"/>
......@@ -88,10 +116,13 @@
</Target>
<Target Name="VerifyRuntimeTypes"
DependsOnTargets="ResolveReferences"
Condition="'$(ShouldVerifyTypes)' == 'true' and '$(RuntimeIdentifier)' != ''">
Inputs="%(RuntimeLibToTest.RuntimeIdentifier)"
Outputs="unused"
DependsOnTargets="PrepareForRuntimeTesting"
Condition="'$(ShouldVerifyTypes)' == 'true'">
<Message Importance="High" Text="Testing for duplicate types for $(TestPackageID) TFM=$(TargetFramework) RID=%(RuntimeLibToTest.RuntimeIdentifier)" />
<ItemGroup>
<_runTypesFileNames Include="@(ReferenceCopyLocalPaths->'%(FileName)')">
<_runTypesFileNames Include="@(RuntimeLibToTestDependency->'%(FileName)');@(RuntimeLibToTest->'%(FileName)')">
<Original>%(Identity)</Original>
</_runTypesFileNames>
<_runTypesFileNamesFiltered Include="@(_runTypesFileNames)" Exclude="@(ExcludeFromTypes);@(ExcludeFromTypes->'%(Identity).ni')"/>
......@@ -105,55 +136,22 @@
<Target Name="VerifyNotDependsOnNetStandard"
DependsOnTargets="ResolveReferences"
Condition="'$(_ShortFrameworkIdentifier)' == 'net' AND '$(_TargetFrameworkVersionWithoutV)' &gt;= '4.6.1' AND '$(RuntimeIdentifier)' == '' AND '$(DisableVerifyNotDependsOnNetStandardTest)' != 'true'">
Condition="'$(_ShortFrameworkIdentifier)' == 'net' AND '$(_TargetFrameworkVersionWithoutV)' &gt;= '4.6.1' AND '$(DisableVerifyNotDependsOnNetStandardTest)' != 'true'">
<Error Condition="'$(DependsOnNetStandard)' == 'true'" Text="Package $(TestPackageId) requires netstandard shims when targeting $(TargetFramework)" />
</Target>
<PropertyGroup>
<_testDependsOn>
<TestDependsOn>
LogBeginTest;
VerifyNotDependsOnNetStandard;
VerifyReferenceClosure;
VerifyReferenceTypes;
VerifyRuntimeClosure;
VerifyRuntimeTypes;
</_testDependsOn>
</TestDependsOn>
<InnerTargets>Test</InnerTargets>
</PropertyGroup>
<!-- inner target to be called by outer Test Target -->
<Target Name="_test"
DependsOnTargets="$(_testDependsOn)">
<MakeDir Directories="$(IntermediateOutputPath)" />
<Touch AlwaysCreate="true" Files="$(IntermediateOutputPath)\$(RuntimeIdentifier).testComplete" />
</Target>
<Target Name="_getTestProjects">
<ItemGroup>
<_projectRuntime Include="$(RuntimeIdentifiers)" />
<!-- Run _test once without RID, then for each RID -->
<TestProject Include="$(MSBuildProjectFullPath)">
<Semaphore>$(IntermediateOutputPath)\.testComplete</Semaphore>
</TestProject>
<TestProject Include="$(MSBuildProjectFullPath)" Condition="'%(_projectRuntime.Identity)' != ''">
<Semaphore>$(IntermediateOutputPath)\%(_projectRuntime.Identity).testComplete</Semaphore>
<AdditionalProperties>RuntimeIdentifier=%(_projectRuntime.Identity)</AdditionalProperties>
</TestProject>
</ItemGroup>
</Target>
<PropertyGroup>
<TestDependsOn>_getTestProjects</TestDependsOn>
<!-- Runs ResolveReferences once up front in order to ensure we don't run it for the first time concurrently during testing.
This is needed to avoid sharing violations when RAR and ResolvePackageAssets write out state files. -->
<TestDependsOn Condition="'$(ShouldVerifyClosure)' == 'true' or '$(ShouldVerifyTypes)' == 'true'">$(TestDependsOn);ResolveReferences</TestDependsOn>
</PropertyGroup>
<!-- Runs all tests scenarios for this project -->
<Target Name="Test"
DependsOnTargets="$(TestDependsOn)"
Inputs="@(TestProject);$(MSBuildAllProjects);$(ProjectAssetsFile)"
Outputs="@(TestProject->'%(Semaphore)')">
<MSBuild Projects="@(TestProject)" Targets="_test" BuildInParallel="true" />
</Target>
<Target Name="Test" DependsOnTargets="$(TestDependsOn)"/>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>{TFM}</TargetFramework>
<RuntimeIdentifiers>{RIDs}</RuntimeIdentifiers>
<TargetFrameworks>{TFMs}</TargetFrameworks>
<TestPackageId>{PackageId}</TestPackageId>
<TestPackageVersion>{PackageVersion}</TestPackageVersion>
<!-- Turn off end of life target framework checks as we intentionally build older .NETCoreApp configurations. -->
......
......@@ -27,6 +27,6 @@
<Target Name="Test" DependsOnTargets="GetProjects">
<!-- We need to pass a dummy global property to force msbuild reevaluation after restoring the project to get implicit references added
and all generated props and targets imported in the test step. This is used to be able to call RestoreAndTest target when running in helix. -->
<MSBuild Projects="@(Project)" Targets="Test" BuildInParallel="true" Properties="$(_projectProperties);ForceMsbuildEvaluation=true" />
<MSBuild Projects="@(Project)" BuildInParallel="true" Properties="$(_projectProperties);ForceMsbuildEvaluation=true" />
</Target>
</Project>
\ No newline at end of file
......@@ -12,7 +12,6 @@
<PackageReports Condition="'@(PackagesToTest)' != ''" Include="@(PackagesToTest->'$(PackageReportDir)%(Identity).json')" />
<!-- support override via commandline -->
<RuntimesToInclude Condition="'$(RuntimesToInclude)' != ''" Include="$(RuntimesToInclude)" />
<TargetFrameworksToInclude Condition="'$(TargetFrameworksToInclude)' != ''" Include="$(TargetFrameworksToInclude)" />
<SymbolsPackages Include="$(LibrariesAllConfigShippingPackagesDir)*.symbols.nupkg" />
......@@ -26,9 +25,6 @@
<TestPackages Include="@(AllPackages)" Exclude="@(ExcludePackages)"/>
<TestPackagesPath Include="@(TestPackages->'%(PackagePath)')" />
<!-- we don't build alpine or older OSX versions -->
<RuntimesToExclude Include="alpine.3.4.3-x64;osx.10.10-x64;osx.10.11-x64;freebsd-x64" />
<!-- no targeting pack was ever shipped for net463 -->
<TargetFrameworksToExclude Include="net463" />
<TargetFrameworksToExclude Include="net47" />
......@@ -91,7 +87,7 @@
<ItemGroup>
<SupportedPackage>
<ProjectDir>$(TestProjectDir)%(Identity)/%(TargetFrameworkShort)/</ProjectDir>
<ProjectDir>$(TestProjectDir)%(Identity)/</ProjectDir>
</SupportedPackage>
<SupportedPackage>
<ProjectFile>%(ProjectDir)project.csproj</ProjectFile>
......@@ -114,23 +110,6 @@
</ItemGroup>
</Target>
<Target Name="UpdateRuntimeIdentifiers"
AfterTargets="GetSupportedPackages"
Inputs="%(SupportedPackage.Identity);%(SupportedPackage.TargetFrameworkShort)"
Outputs="unused">
<ItemGroup>
<_supportedPackageRuntimes Remove="@(_supportedPackageRuntimes)" />
<_supportedPackageRuntimes Include="%(SupportedPackage.RuntimeIdentifiers)" />
<_supportedPackageRuntimesToRemove Include="@(_supportedPackageRuntimes)" Exclude="@(RuntimesToInclude)" Condition="'@(RuntimesToInclude)' != ''" />
<_filteredSupportedPackageRuntimes Include="@(_supportedPackageRuntimes)" Exclude="@(RuntimesToExclude);@(_supportedPackageRuntimesToRemove)" />
<SupportedPackage>
<RuntimeIdentifiers>@(_filteredSupportedPackageRuntimes)</RuntimeIdentifiers>
</SupportedPackage>
</ItemGroup>
</Target>
<Target Name="GenerateProjects"
DependsOnTargets="GetSupportedPackages;CreateTestDir"
Inputs="@(TestPackagesPath);$(ProjectTemplate)"
......@@ -140,15 +119,14 @@
<_projectFile>%(SupportedPackage.ProjectFile)</_projectFile>
<_packageId>%(SupportedPackage.Identity)</_packageId>
<_packageVersion>%(SupportedPackage.Version)</_packageVersion>
<_projectTFM>%(SupportedPackage.TargetFrameworkShort)</_projectTFM>
<_projectRIDs>%(SupportedPackage.RuntimeIdentifiers)</_projectRIDs>
<_projectTFMs>@(SupportedPackage->'%(TargetFrameworkShort)')</_projectTFMs>
</PropertyGroup>
<MakeDir Directories="$(_projectDir)" />
<!-- Update project.json template -->
<!-- Update project.csproj template -->
<WriteLinesToFile
File="$(_projectFile)"
Lines="$([System.IO.File]::ReadAllText('$(ProjectTemplate)').Replace('{PackageId}', $(_packageId)).Replace('{PackageVersion}', $(_packageVersion)).Replace('{TFM}', $(_projectTFM)).Replace('{RIDs}', '$(_projectRIDs)'))"
Lines="$([System.IO.File]::ReadAllText('$(ProjectTemplate)').Replace('{PackageId}', $(_packageId)).Replace('{PackageVersion}', $(_packageVersion)).Replace('{TFMs}', $(_projectTFMs)))"
Overwrite="true" />
<Message Text="Generated $(_projectFile)" />
</Target>
......
......@@ -54,7 +54,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(TestPackages)' == 'true'">
<!-- Use Helix feature to include dotnet CLI for every workitem and add it to the path -->
<!-- Use Helix feature to include dotnet CLI for every workitem and add it to the path, this also gives us an isolated packages folder -->
<NeedsDotNetSdk>true</NeedsDotNetSdk>
<UseDotNetCliVersionFromGlobalJson>true</UseDotNetCliVersionFromGlobalJson>
......@@ -80,9 +80,9 @@
<PropertyGroup Condition="'$(TestPackages)' == 'true'">
<HelixCommand>dotnet msbuild %HELIX_CORRELATION_PAYLOAD%\test.msbuild</HelixCommand>
<HelixCommand>$(HelixCommand) /bl:%HELIX_WORKITEM_UPLOAD_ROOT%\%HELIX_WORKITEM_FRIENDLYNAME%.package.test.binlog</HelixCommand>
<HelixCommand>$(HelixCommand) /warnaserror</HelixCommand>
<HelixCommand>$(HelixCommand) /p:PackageTestProjectsDir=%HELIX_WORKITEM_PAYLOAD%</HelixCommand>
<HelixCommand>$(HelixCommand) /p:RestorePackagesPath=%HELIX_WORKITEM_PAYLOAD%\packages</HelixCommand>
<HelixCommand>$(HelixCommand) /p:LocalPackagesPath="%HELIX_CORRELATION_PAYLOAD%\packages\"</HelixCommand>
</PropertyGroup>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册