You've already forked linux-packaging-mono
Imported Upstream version 5.4.0.167
Former-commit-id: 5624ac747d633e885131e8349322922b6a59baaa
This commit is contained in:
parent
e49d6f06c0
commit
536cd135cc
37
external/corefx/pkg/test/frameworkSettings/net/settings.targets
vendored
Normal file
37
external/corefx/pkg/test/frameworkSettings/net/settings.targets
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<!-- Desktop has cycles and dangling refs -->
|
||||
<!-- ShouldVerifyClosure>true</ShouldVerifyClosure -->
|
||||
<ShouldVerifyTypes>true</ShouldVerifyTypes>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- these are part of the targeting pack but not actual assemblies -->
|
||||
<ExcludeReference Include="System.EnterpriseServices.Thunk;System.EnterpriseServices.Wrapper" />
|
||||
|
||||
<!-- these are part of the targeting pack but contain many duplicate types -->
|
||||
<ExcludeReference Include="PresentationFramework.Aero;PresentationFramework.Aero2;PresentationFramework.AeroLite;PresentationFramework.Classic;PresentationFramework.Luna;PresentationFramework.Royale" />
|
||||
|
||||
<!-- these duplicate types exist in the targeting pack -->
|
||||
<IgnoredTypes Include="XamlGeneratedNamespace.GeneratedInternalTypeHelper" />
|
||||
<IgnoredTypes Include="System.Deployment.Internal.CodeSigning.RSAPKCS1SHA256SignatureDescription" />
|
||||
<IgnoredTypes Include="System.ServiceModel.Channels.HttpRequestMessageExtensionMethods" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- this target must run before ResolvePackageDependenciesForBuild so
|
||||
that the SDK targets de-dup the References it adds against those
|
||||
that come from packages -->
|
||||
<Target Name="ReferenceEntireFramework"
|
||||
BeforeTargets="ResolvePackageDependenciesForBuild"
|
||||
DependsOnTargets="GetReferenceAssemblyPaths"
|
||||
Condition="'$(TargetFrameworkDirectory)' != ''">
|
||||
<ItemGroup>
|
||||
<!-- TargetFrameworkDirectory may contain many paths -->
|
||||
<_frameworkDirectoriesToInclude Include="$(TargetFrameworkDirectory)" />
|
||||
|
||||
<_allFrameworkReferences Include="%(_frameworkDirectoriesToInclude.Identity)\*.dll" />
|
||||
<Reference Include="@(_allFrameworkReferences->'%(FileName)')" Exclude="@(ExcludeReference)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Project>
|
||||
18
external/corefx/pkg/test/frameworkSettings/netcoreapp/settings.targets
vendored
Normal file
18
external/corefx/pkg/test/frameworkSettings/netcoreapp/settings.targets
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(ToolsDir)netfxreference.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<ShouldVerifyClosure>true</ShouldVerifyClosure>
|
||||
<ShouldVerifyTypes>true</ShouldVerifyTypes>
|
||||
|
||||
<!-- ensure that we get runtime assemblies in ReferenceCopyLocalPaths -->
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- intentionally dangling refs in shims -->
|
||||
<ExcludeFromClosure Include="@(NetFxReference)" />
|
||||
<IgnoredReference Include="@(NetFxReference)" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
27
external/corefx/pkg/test/frameworkSettings/netcoreapp1.0/settings.targets
vendored
Normal file
27
external/corefx/pkg/test/frameworkSettings/netcoreapp1.0/settings.targets
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<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" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
29
external/corefx/pkg/test/frameworkSettings/netcoreapp1.1/settings.targets
vendored
Normal file
29
external/corefx/pkg/test/frameworkSettings/netcoreapp1.1/settings.targets
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<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" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
7
external/corefx/pkg/test/frameworkSettings/netstandard/settings.targets
vendored
Normal file
7
external/corefx/pkg/test/frameworkSettings/netstandard/settings.targets
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ShouldVerifyClosure>true</ShouldVerifyClosure>
|
||||
<ShouldVerifyTypes>true</ShouldVerifyTypes>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
128
external/corefx/pkg/test/packageTest.targets
vendored
Normal file
128
external/corefx/pkg/test/packageTest.targets
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
|
||||
<PropertyGroup>
|
||||
<_targetFrameworkVersionIndex>$(TargetFramework.IndexOfAny(".-0123456789"))</_targetFrameworkVersionIndex>
|
||||
<_targetFrameworkIdentifier Condition="'$(_runtimeOSVersionIndex)' != '-1'">$(TargetFramework.SubString(0, $(_targetFrameworkVersionIndex)))</_targetFrameworkIdentifier>
|
||||
<ToolsDir>$(MSBuildThisFileDirectory)tools\</ToolsDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="tools\Packaging.common.targets" />
|
||||
<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" />
|
||||
|
||||
<Target Name="LogBeginTest">
|
||||
<PropertyGroup>
|
||||
<_message>Testing $(TestPackageID) TFM=$(TargetFramework)</_message>
|
||||
<_message Condition="'$(RuntimeIdentifier)' != ''">$(_message) RID=$(RuntimeIdentifier)</_message>
|
||||
</PropertyGroup>
|
||||
<Message Importance="High" Text="$(_message)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="VerifyReferenceClosure"
|
||||
DependsOnTargets="ResolveReferences"
|
||||
Condition="'$(ShouldVerifyClosure)' == 'true' AND '$(RuntimeIdentifier)' == ''">
|
||||
<ItemGroup>
|
||||
<_refClosureFileNames Include="@(ReferencePath->'%(FileName)')">
|
||||
<Original>%(Identity)</Original>
|
||||
</_refClosureFileNames>
|
||||
<_refClosureFileNamesFiltered Include="@(_refClosureFileNames)" Exclude="@(ExcludeFromClosure);@(ExcludeFromClosure->'%(Identity).ni')"/>
|
||||
<_refClosureFileFiltered Include="@(_refClosureFileNamesFiltered->'%(Original)')"/>
|
||||
</ItemGroup>
|
||||
|
||||
<VerifyClosure Condition="'@(_refClosureFileFiltered)' != ''"
|
||||
Sources="@(_refClosureFileFiltered)"
|
||||
IgnoredReferences="@(IgnoredReference)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="VerifyReferenceTypes"
|
||||
DependsOnTargets="ResolveReferences"
|
||||
Condition="'$(ShouldVerifyTypes)' == 'true' AND '$(RuntimeIdentifier)' == ''">
|
||||
<ItemGroup>
|
||||
<_refTypesFileNames Include="@(ReferencePath->'%(FileName)')">
|
||||
<Original>%(Identity)</Original>
|
||||
</_refTypesFileNames>
|
||||
<_refTypesFileNamesFiltered Include="@(_refTypesFileNames)" Exclude="@(ExcludeFromTypes);@(ExcludeFromTypes->'%(Identity).ni')"/>
|
||||
<_refTypesFileFiltered Include="@(_refTypesFileNamesFiltered->'%(Original)')"/>
|
||||
</ItemGroup>
|
||||
|
||||
<VerifyTypes Condition="'@(_refTypesFileFiltered)' != ''"
|
||||
Sources="@(_refTypesFileFiltered)"
|
||||
IgnoredTypes="@(IgnoredTypes)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="VerifyRuntimeClosure"
|
||||
DependsOnTargets="ResolveReferences"
|
||||
Condition="'$(ShouldVerifyClosure)' == 'true' AND '$(RuntimeIdentifier)' != '' AND '@(ReferenceCopyLocalPaths)' != ''">
|
||||
<ItemGroup>
|
||||
<_runClosureFileNames Include="@(ReferenceCopyLocalPaths->'%(FileName)')">
|
||||
<Original>%(Identity)</Original>
|
||||
</_runClosureFileNames>
|
||||
<_runClosureFileNamesFiltered Include="@(_runClosureFileNames)" Exclude="@(ExcludeFromClosure);@(ExcludeFromClosure->'%(Identity).ni')"/>
|
||||
<_runClosureFileFiltered Include="@(_runClosureFileNamesFiltered->'%(Original)')"/>
|
||||
</ItemGroup>
|
||||
|
||||
<VerifyClosure Condition="'@(_runClosureFileFiltered)' != ''"
|
||||
Sources="@(_runClosureFileFiltered)"
|
||||
IgnoredReferences="@(IgnoredReference)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="VerifyRuntimeTypes"
|
||||
DependsOnTargets="ResolveReferences"
|
||||
Condition="'$(ShouldVerifyTypes)' == 'true' AND '$(RuntimeIdentifier)' != ''">
|
||||
<ItemGroup>
|
||||
<_runTypesFileNames Include="@(ReferenceCopyLocalPaths->'%(FileName)')">
|
||||
<Original>%(Identity)</Original>
|
||||
</_runTypesFileNames>
|
||||
<_runTypesFileNamesFiltered Include="@(_runTypesFileNames)" Exclude="@(ExcludeFromTypes);@(ExcludeFromTypes->'%(Identity).ni')"/>
|
||||
<_runTypesFileFiltered Include="@(_runTypesFileNamesFiltered->'%(Original)')"/>
|
||||
</ItemGroup>
|
||||
|
||||
<VerifyTypes Condition="'@(_runTypesFileFiltered)' != ''"
|
||||
Sources="@(_runTypesFileFiltered)"
|
||||
IgnoredTypes="@(IgnoredTypes)" />
|
||||
</Target>
|
||||
|
||||
<PropertyGroup>
|
||||
<TestDependsOn>
|
||||
LogBeginTest;
|
||||
VerifyReferenceClosure;
|
||||
VerifyReferenceTypes;
|
||||
VerifyRuntimeClosure;
|
||||
VerifyRuntimeTypes;
|
||||
</TestDependsOn>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- inner target to be called by outer Test Target -->
|
||||
<Target Name="_test"
|
||||
DependsOnTargets="$(TestDependsOn)">
|
||||
<MakeDir Directories="$(IntermediateOutputPath)" />
|
||||
<Touch AlwaysCreate="true" Files="$(IntermediateOutputPath)\.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)">
|
||||
<Semaphore>$(IntermediateOutputPath)\%(_projectRuntime.Identity)\.testComplete</Semaphore>
|
||||
<AdditionalProperties>RuntimeIdentifier=%(_projectRuntime.Identity)</AdditionalProperties>
|
||||
</TestProject>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<!-- runs all tests scenarios for this project -->
|
||||
<Target Name="Test"
|
||||
DependsOnTargets="_getTestProjects"
|
||||
Inputs="@(TestProject);$(MSBuildAllProjects);$(ProjectAssetsFile)"
|
||||
Outputs="@(TestProject->'%(Semaphore)')">
|
||||
<MSBuild Projects="@(TestProject)" Targets="_test" BuildInParallel="true" />
|
||||
</Target>
|
||||
</Project>
|
||||
15
external/corefx/pkg/test/project.csproj.template
vendored
Normal file
15
external/corefx/pkg/test/project.csproj.template
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>{TFM}</TargetFramework>
|
||||
<RuntimeIdentifiers>{RIDs}</RuntimeIdentifiers>
|
||||
<TestPackageId>{PackageId}</TestPackageId>
|
||||
<TestPackageVersion>{PackageVersion}</TestPackageVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="{PackageId}" Version="{PackageVersion}" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), packageTest.targets))\packageTest.targets" />
|
||||
</Project>
|
||||
11
external/corefx/pkg/test/project.template.json
vendored
11
external/corefx/pkg/test/project.template.json
vendored
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"{PackageId}": "{PackageVersion}"
|
||||
},
|
||||
"frameworks": {
|
||||
"{TFM}": { }
|
||||
},
|
||||
"runtimes": {
|
||||
{RuntimeSection}
|
||||
}
|
||||
}
|
||||
25
external/corefx/pkg/test/test.msbuild
vendored
Normal file
25
external/corefx/pkg/test/test.msbuild
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Restore;Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<TestPackages Condition="'$(TestPackages)' != ''" Include="$(TestPackages)" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="GetProjects">
|
||||
<ItemGroup>
|
||||
<Project Condition="'@(TestPackages)' == ''" Include="projects\**\*.csproj" />
|
||||
<Project Condition="'@(TestPackages)' != ''" Include="projects\%(TestPackages.Identity)\**\*.csproj" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="Restore"
|
||||
Inputs="@(Project)"
|
||||
Outputs="@(Project->'%(RootDir)%(Directory)obj\project.assets.json')"
|
||||
DependsOnTargets="GetProjects">
|
||||
<MSBuild Projects="@(Project)" Targets="Restore" BuildInParallel="true" />
|
||||
<Touch Files="@(Project->'%(RootDir)%(Directory)obj\project.assets.json')" />
|
||||
</Target>
|
||||
|
||||
<Target Name="Test" DependsOnTargets="GetProjects">
|
||||
<MSBuild Projects="@(Project)" Targets="Test" BuildInParallel="true" />
|
||||
</Target>
|
||||
</Project>
|
||||
151
external/corefx/pkg/test/testPackages.proj
vendored
151
external/corefx/pkg/test/testPackages.proj
vendored
@@ -3,8 +3,13 @@
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReports Condition="'$(TestPackage)' == ''" Include="$(PackageReportDir)*.json" />
|
||||
<PackageReports Condition="'$(TestPackage)' != ''" Include="$(PackageReportDir)$(TestPackage).json" />
|
||||
<TestPackages Condition="'$(TestPackages)' != ''" Include="$(TestPackages)" />
|
||||
<PackageReports Condition="'@(TestPackages)' == ''" Include="$(PackageReportDir)*.json" />
|
||||
<PackageReports Condition="'@(TestPackages)' != ''" Include="@(TestPackages->'$(PackageReportDir)%(Identity).json')" />
|
||||
|
||||
<!-- support override via commandline -->
|
||||
<RuntimesToInclude Condition="'$(RuntimesToInclude)' != ''" Include="$(RuntimesToInclude)" />
|
||||
<TargetFrameworksToInclude Condition="'$(TargetFrameworksToInclude)' != ''" Include="$(TargetFrameworksToInclude)" />
|
||||
|
||||
<!-- restrict restore sources to the current build and publicly shipped packages -->
|
||||
<RestoreSource Include="$(PackageOutputPath)" />
|
||||
@@ -12,66 +17,154 @@
|
||||
|
||||
<!-- needed for SQLClient's SNI packages -->
|
||||
<RestoreSource Include="https:%2F%2Fdotnet.myget.org/F/dotnet-core/api/v3/index.json" />
|
||||
|
||||
<!-- we don't build alpine or older OSX versions -->
|
||||
<RuntimesToExclude Include="alpine.3.4.3-x64;osx.10.10-x64;osx.10.11-x64" />
|
||||
|
||||
<!-- no targeting pack was ever shipped for net463 -->
|
||||
<TargetFrameworksToExclude Include="net463" />
|
||||
<TargetFrameworksToExclude Include="net47" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<TestProjectDir>$(PackageOutputPath)projects/</TestProjectDir>
|
||||
<TestDir>$(PackageOutputPath)test/</TestDir>
|
||||
<TestProjectName>test.msbuild</TestProjectName>
|
||||
<TestProject>$(TestDir)$(TestProjectName)</TestProject>
|
||||
<TestToolsDir>$(TestDir)tools/</TestToolsDir>
|
||||
<TestProjectDir>$(TestDir)projects/</TestProjectDir>
|
||||
<TestPackageDir>$(BinDir)testPackages</TestPackageDir>
|
||||
<TestDotNetPath>$(TestToolsDir)/dotnet</TestDotNetPath>
|
||||
|
||||
<ProjectTemplate>project.csproj.template</ProjectTemplate>
|
||||
|
||||
<TestRestoreCommand>$(DotnetToolCommand)</TestRestoreCommand>
|
||||
<TestRestoreCommand>$(TestDotNetPath)</TestRestoreCommand>
|
||||
<TestRestoreCommand>$(TestRestoreCommand) restore</TestRestoreCommand>
|
||||
<TestRestoreCommand>$(TestRestoreCommand) @(RestoreSource->'-s %(Identity)', ' ')</TestRestoreCommand>
|
||||
<TestRestoreCommand>$(TestRestoreCommand) --packages "$(TestPackageDir)"</TestRestoreCommand>
|
||||
<TestRestoreCommand Condition="'$(TestPackages)' != ''">$(TestRestoreCommand) /p:TestPackages=$(TestPackages)</TestRestoreCommand>
|
||||
|
||||
<TestBuildCommand>$(TestDotNetPath)</TestBuildCommand>
|
||||
<TestBuildCommand>$(TestBuildCommand) msbuild</TestBuildCommand>
|
||||
<TestBuildCommand>$(TestBuildCommand) /t:Test</TestBuildCommand>
|
||||
<TestBuildCommand Condition="'$(TestPackages)' != ''">$(TestBuildCommand) /p:TestPackages=$(TestPackages)</TestBuildCommand>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<TestSupportFiles Include="$(DotnetCliPath)\**\*.*">
|
||||
<DestinationFolder>$(TestToolsDir)%(RecursiveDir)</DestinationFolder>
|
||||
</TestSupportFiles>
|
||||
<TestSupportFiles Include="$(SourceDir)shims\netfxreference.props">
|
||||
<DestinationFolder>$(TestToolsDir)</DestinationFolder>
|
||||
</TestSupportFiles>
|
||||
<TestSupportFiles Include="$(ToolsDir)Packaging.common.targets">
|
||||
<DestinationFolder>$(TestToolsDir)</DestinationFolder>
|
||||
</TestSupportFiles>
|
||||
<TestSupportFiles Include="$(ToolsDir)Microsoft.DotNet.Build.Tasks.Packaging.dll">
|
||||
<DestinationFolder>$(TestToolsDir)</DestinationFolder>
|
||||
</TestSupportFiles>
|
||||
<TestSupportFiles Include="$(ToolsDir)Newtonsoft.Json.dll">
|
||||
<DestinationFolder>$(TestToolsDir)</DestinationFolder>
|
||||
</TestSupportFiles>
|
||||
<TestSupportFiles Include="$(ToolsDir)NuGet.*.dll">
|
||||
<DestinationFolder>$(TestToolsDir)</DestinationFolder>
|
||||
</TestSupportFiles>
|
||||
<TestSupportFiles Include="**\*.targets">
|
||||
<DestinationFolder>$(TestDir)%(RecursiveDir)</DestinationFolder>
|
||||
</TestSupportFiles>
|
||||
<TestSupportFiles Include="$(TestProjectName)">
|
||||
<DestinationFolder>$(TestDir)</DestinationFolder>
|
||||
</TestSupportFiles>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="CreateTestDir"
|
||||
Inputs="@(TestSupportFiles)"
|
||||
Outputs="@(TestSupportFiles->'%(DestinationFolder)\%(FileName)%(Extension)')">
|
||||
<MakeDir Directories="%(TestSupportFiles.DestinationFolder)" />
|
||||
<Copy SourceFiles="@(TestSupportFiles)" DestinationFolder="%(TestSupportFiles.DestinationFolder)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="GetSupportedPackages">
|
||||
<GetSupportedPackagesFromPackageReports PackageReports="@(PackageReports)">
|
||||
<Output TaskParameter="SupportedPackages" ItemName="SupportedPackage"/>
|
||||
</GetSupportedPackagesFromPackageReports>
|
||||
|
||||
<ItemGroup>
|
||||
<SupportedPackage>
|
||||
<ProjectDir>$(TestProjectDir)%(Identity)/%(TargetFrameworkShort)/</ProjectDir>
|
||||
</SupportedPackage>
|
||||
<SupportedPackage>
|
||||
<ProjectFile>%(ProjectDir)project.csproj</ProjectFile>
|
||||
<AssetsFile>%(ProjectDir)obj/project.assets.json</AssetsFile>
|
||||
</SupportedPackage>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="UpdateTargetFrameworks" AfterTargets="GetSupportedPackages">
|
||||
<ItemGroup>
|
||||
<_supportedPackageByTargetFramework Include="@(SupportedPackage->'%(TargetFrameworkShort)')">
|
||||
<Original>%(Identity)</Original>
|
||||
</_supportedPackageByTargetFramework>
|
||||
|
||||
<_supportedPackageByTargetFrameworkToRemove Include="@(_supportedPackageByTargetFramework)" Exclude="@(TargetFrameworksToInclude)" Condition="'@(TargetFrameworksToInclude)' != ''" />
|
||||
<_filteredSupportedPackageByTargetFramework Include="@(_supportedPackageByTargetFramework)" Exclude="@(TargetFrameworksToExclude);@(_supportedPackageByTargetFrameworkToRemove)" />
|
||||
|
||||
<SupportedPackage Remove="@(SupportedPackage)" />
|
||||
<SupportedPackage Include="@(_filteredSupportedPackageByTargetFramework->'%(Original)')" />
|
||||
</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"
|
||||
Inputs="@(PackageReports)"
|
||||
Outputs="$(TestProjectDir)%(SupportedPackage.Identity)/%(SupportedPackage.TargetFramework)/project.json">
|
||||
<ItemGroup>
|
||||
<_projectRuntimes Remove="@(_projectRuntimes)" />
|
||||
<_projectRuntimes Include="%(SupportedPackage.RuntimeIdentifiers)" />
|
||||
</ItemGroup>
|
||||
|
||||
DependsOnTargets="GetSupportedPackages;CreateTestDir"
|
||||
Inputs="@(PackageReports);$(ProjectTemplate)"
|
||||
Outputs="%(SupportedPackage.ProjectFile)">
|
||||
<PropertyGroup>
|
||||
<_projectDir>$(TestProjectDir)%(SupportedPackage.Identity)/%(SupportedPackage.TargetFramework)/</_projectDir>
|
||||
<_projectFile>$(_projectDir)project.json</_projectFile>
|
||||
<_projectDir>%(SupportedPackage.ProjectDir)/</_projectDir>
|
||||
<_projectFile>%(SupportedPackage.ProjectFile)</_projectFile>
|
||||
<_packageId>%(SupportedPackage.Identity)</_packageId>
|
||||
<_packageVersion>%(SupportedPackage.Version)</_packageVersion>
|
||||
<_projectTFM>%(SupportedPackage.TargetFramework)</_projectTFM>
|
||||
<_projectRuntimeSection />
|
||||
<_projectRuntimeSection Condition="'@(_projectRuntimes)' != ''">@(_projectRuntimes->'"%(Identity)": {}', ', ')</_projectRuntimeSection>
|
||||
<_projectTFM>%(SupportedPackage.TargetFrameworkShort)</_projectTFM>
|
||||
<_projectRIDs>%(SupportedPackage.RuntimeIdentifiers)</_projectRIDs>
|
||||
</PropertyGroup>
|
||||
|
||||
<MakeDir Directories="$(_projectDir)" />
|
||||
<!-- Update project.json template -->
|
||||
<WriteLinesToFile
|
||||
File="$(_projectFile)"
|
||||
Lines="$([System.IO.File]::ReadAllText('project.template.json').Replace('{PackageId}', $(_packageId)).Replace('{PackageVersion}', $(_packageVersion)).Replace('{TFM}', $(_projectTFM)).Replace('{RuntimeSection}', $(_projectRuntimeSection)))"
|
||||
Lines="$([System.IO.File]::ReadAllText('$(ProjectTemplate)').Replace('{PackageId}', $(_packageId)).Replace('{PackageVersion}', $(_packageVersion)).Replace('{TFM}', $(_projectTFM)).Replace('{RIDs}', '$(_projectRIDs)'))"
|
||||
Overwrite="true" />
|
||||
<Message Text="Generated $(_projectFile)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="RestoreProjects"
|
||||
DependsOnTargets="GenerateProjects"
|
||||
Inputs="$(TestProjectDir)%(SupportedPackage.Identity)/%(SupportedPackage.TargetFramework)/project.json"
|
||||
Outputs="$(TestProjectDir)%(SupportedPackage.Identity)'%(SupportedPackage.TargetFramework)/project.lock.json">
|
||||
<PropertyGroup>
|
||||
<_projectDir>$(TestProjectDir)%(SupportedPackage.Identity)/%(SupportedPackage.TargetFramework)/</_projectDir>
|
||||
<_projectFile>$(_projectDir)project.json</_projectFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<Message Importance="High" Text="Testing $(_projectFile)" />
|
||||
<Exec Command="$(TestRestoreCommand) "$(_projectFile)"" StandardOutputImportance="Low" ContinueOnError="ErrorAndContinue" />
|
||||
DependsOnTargets="GenerateProjects">
|
||||
<Message Importance="High" Text="*** Restoring ***" />
|
||||
<Exec Command="$(TestRestoreCommand) "$(TestProject)"" StandardOutputImportance="High" />
|
||||
</Target>
|
||||
|
||||
<Target Name="BuildProjects"
|
||||
DependsOnTargets="RestoreProjects">
|
||||
<Message Importance="High" Text="*** Testing ***" />
|
||||
<Exec Command="$(TestBuildCommand) "$(TestProject)" /p:TestPackages=%(SupportedPackage.Identity)" StandardOutputImportance="High" />
|
||||
</Target>
|
||||
|
||||
<Target Name="Build" DependsOnTargets="RestoreProjects" />
|
||||
<Target Name="Build" DependsOnTargets="BuildProjects" />
|
||||
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
</Project>
|
||||
Reference in New Issue
Block a user