diff options
Diffstat (limited to 'tests/publishdependency.targets')
-rw-r--r-- | tests/publishdependency.targets | 189 |
1 files changed, 182 insertions, 7 deletions
diff --git a/tests/publishdependency.targets b/tests/publishdependency.targets index 554b1eee78..9e286fc3ba 100644 --- a/tests/publishdependency.targets +++ b/tests/publishdependency.targets @@ -3,18 +3,50 @@ <UsingTask TaskName="PrereleaseResolveNuGetPackageAssets" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll"/> <ItemGroup> - <TestTargetFramework Include=".NETCoreApp,Version=v1.0"> - <Folder>netcoreapp1.0</Folder> + <TestTargetFramework Include=".NETCoreApp,Version=v1.1"> + <Folder>netcoreapp1.1</Folder> </TestTargetFramework> </ItemGroup> + <PropertyGroup> + <!-- defined in buildtools packaging.targets, but we need this before targets are imported --> + <PackagePlatform Condition="'$(PackagePlatform)' == ''">$(__BuildArch)</PackagePlatform> + <PackagePlatform Condition="'$(PackagePlatform)' == 'amd64'">x64</PackagePlatform> + <MinOSForArch>win7</MinOSForArch> + <MinOSForArch Condition="'$(PackagePlatform)' == 'arm'">win8</MinOSForArch> + <MinOSForArch Condition="'$(PackagePlatform)' == 'arm64'">win10</MinOSForArch> + </PropertyGroup> + + <ItemGroup> + <CoreRootProjectLockJsonFiles Include="$(SourceDir)Common\test_runtime\project.lock.json"/> + <CoreRootProjectLockJsonFiles Include="$(SourceDir)Common\test_dependencies\project.lock.json"/> + </ItemGroup> + + <ItemGroup> + <NonWindowsProjectLockJsonFiles Include="@(CoreRootProjectLockJsonFiles)"/> + <NonWindowsProjectLockJsonFiles Include="$(SourceDir)Common\build_against_pkg_dependencies\project.lock.json"/> + </ItemGroup> + + <ItemGroup> + <RefProjectLockJsonFiles Include="$(SourceDir)Common\targeting_pack_ref\project.lock.json"/> + </ItemGroup> + + <ItemGroup> + <ProductProjectLockJsonFiles Include="$(SourceDir)Common\build_against_pkg_dependencies\project.lock.json"/> + </ItemGroup> + <ItemGroup> - <ProjectLockJsonFiles Include="$(SourceDir)Common\test_runtime\project.lock.json"/> - <ProjectLockJsonFiles Include="$(SourceDir)Common\test_dependencies\project.lock.json"/> + <CrossGenFiles Include="..\packages\runtime.$(MinOSForArch)-$(PackagePlatform).Microsoft.NETCore.Runtime.CoreCLR\$(CoreClrPackageVersion)\tools\crossgen.exe"/> </ItemGroup> + <PropertyGroup> + <ProductDestination>$(ProjectDir)\..\bin\Product\$(BuildOS).$(BuildArch).$(BuildType)</ProductDestination> + <RefDestination>$(ProductDestination)\ref</RefDestination> + <CoreOverlay>$(CORE_ROOT)\..\coreoverlay</CoreOverlay> + </PropertyGroup> + <Target Name="CopyDependecyToCoreRoot" - Inputs="@(ProjectLockJsonFiles)" + Inputs="@(CoreRootProjectLockJsonFiles)" Outputs="$(CORE_ROOT)\*.*"> <MSBuild Projects="$(SourceDir)Common\test_runtime\test_runtime.csproj"/> @@ -23,12 +55,12 @@ <!-- This will use the overridden PrereleaseResolveNuGetPackageAssets, which outputs copy local items for the xunit wrapper projects --> - <PrereleaseResolveNuGetPackageAssets AllowFallbackOnTargetSelection="true" + <PrereleaseResolveNuGetPackageAssets AllowFallbackOnTargetSelection="false" IncludeFrameworkReferences="false" NuGetPackagesDirectory="$(PackagesDir)" RuntimeIdentifier="$(TestNugetRuntimeId)" ProjectLanguage="$(Language)" - ProjectLockFile="%(ProjectLockJsonFiles.Identity)" + ProjectLockFile="%(CoreRootProjectLockJsonFiles.Identity)" TargetMonikers="@(TestTargetFramework)"> <Output TaskParameter="ResolvedAnalyzers" ItemName="Analyzer" /> <Output TaskParameter="ResolvedReferences" ItemName="Reference" /> @@ -58,4 +90,147 @@ </Copy> </Target> + <Target Name="CopyNonWindowsDependecyToCoreRoot" + Inputs="@(NonWindowsProjectLockJsonFiles)" + Outputs="$(CoreOverlay)\*.*"> + + <MSBuild Projects="$(SourceDir)Common\test_runtime\test_runtime.csproj"/> + + <MSBuild Projects="$(SourceDir)Common\test_dependencies\test_dependencies.csproj"/> + + <MSBuild Projects="$(SourceDir)Common\build_against_pkg_dependencies\build_against_pkg_dependencies.csproj"/> + + <!-- This will use the overridden PrereleaseResolveNuGetPackageAssets, which outputs copy local items + for the xunit wrapper projects --> + <PrereleaseResolveNuGetPackageAssets AllowFallbackOnTargetSelection="true" + IncludeFrameworkReferences="false" + NuGetPackagesDirectory="$(PackagesDir)" + RuntimeIdentifier="$(RuntimeId)" + ProjectLanguage="$(Language)" + ProjectLockFile="%(NonWindowsProjectLockJsonFiles.Identity)" + TargetMonikers="@(TestTargetFramework)"> + <Output TaskParameter="ResolvedAnalyzers" ItemName="Analyzer" /> + <Output TaskParameter="ResolvedReferences" ItemName="Reference" /> + <Output TaskParameter="ResolvedCopyLocalItems" ItemName="RunTimeCopyLocal" /> + </PrereleaseResolveNuGetPackageAssets> + <ItemGroup> + <RunTimeDependecyExclude Include="$(CoreOverlay)\**\*.*" /> + <RunTimeDependecyExcludeFiles Include="@(RunTimeDependecyExclude -> '%(FileName)%(Extension)')" /> + <RunTimeDependecyExcludeFiles Include="@(RunTimeDependecyExclude -> '%(FileName).ni%(Extension)')" /> + <RunTimeDependecyExcludeFiles Include="@(RunTimeDependecyExclude -> '%(FileName).pdb')" /> + <AllResolvedRuntimeDependencies Include="@(RunTimeCopyLocal -> '%(FileName)%(Extension)')"> + <File>%(Identity)</File> + </AllResolvedRuntimeDependencies> + <RunTimeDependecyCopyLocalFile Include="@(AllResolvedRuntimeDependencies)" Exclude="@(RunTimeDependecyExcludeFiles)"/> + <RunTimeDependecyCopyLocal Include="@(RunTimeDependecyCopyLocalFile -> '%(File)')" /> + </ItemGroup> + + <Copy + SourceFiles="@(RunTimeDependecyCopyLocal)" + DestinationFolder="$(CoreOverlay)" + SkipUnchangedFiles="$(SkipCopyUnchangedFiles)" + OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" + Retries="$(CopyRetryCount)" + RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)" + UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)"> + <Output TaskParameter="DestinationFiles" ItemName="FileWrites" /> + </Copy> + + <ItemGroup> + <NonWindowsCrossGenFiles Include="..\packages\runtime.$(RuntimeID).Microsoft.NETCore.Runtime.CoreCLR\$(CoreClrPackageVersion)\tools\crossgen"/> + </ItemGroup> + + <Copy + SourceFiles="@(NonWindowsCrossGenFiles)" + DestinationFolder="$(CoreOverlay)" + SkipUnchangedFiles="$(SkipCopyUnchangedFiles)" + OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" + Retries="$(CopyRetryCount)" + RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)" + UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)"> + <Output TaskParameter="DestinationFiles" ItemName="FileWrites" /> + </Copy> + + </Target> + + <Target Name="CopyDependencyToRef" + Inputs="@(RefProjectLockJsonFiles)" + Outputs="$(RefDestination)\*.*"> + + <MSBuild Projects="$(SourceDir)Common\targeting_pack_ref\targeting_pack_ref.csproj"/> + + <!-- This will use the overridden PrereleaseResolveNuGetPackageAssets, which outputs copy local items + for the xunit wrapper projects --> + <PrereleaseResolveNuGetPackageAssets AllowFallbackOnTargetSelection="true" + IncludeFrameworkReferences="false" + NuGetPackagesDirectory="$(PackagesDir)" + RuntimeIdentifier="$(TestNugetRuntimeId)" + ProjectLanguage="$(Language)" + ProjectLockFile="%(RefProjectLockJsonFiles.Identity)" + TargetMonikers="@(TestTargetFramework)"> + <Output TaskParameter="ResolvedAnalyzers" ItemName="RefAnalyzer" /> + <Output TaskParameter="ResolvedReferences" ItemName="RefReference" /> + <Output TaskParameter="ResolvedCopyLocalItems" ItemName="RefRunTimeCopyLocal" /> + </PrereleaseResolveNuGetPackageAssets> + + <Copy + SourceFiles="@(RefRunTimeCopyLocal)" + DestinationFolder="$(RefDestination)" + SkipUnchangedFiles="$(SkipCopyUnchangedFiles)" + OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" + Retries="$(CopyRetryCount)" + RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)" + UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)"> + <Output TaskParameter="DestinationFiles" ItemName="FileWrites" /> + </Copy> + </Target> + + <Target Name="CopyDependencyToProduct" + Inputs="@(ProductProjectLockJsonFiles)" + Outputs="$(ProductDestination)\*.*"> + + <MSBuild Projects="$(SourceDir)Common\build_against_pkg_dependencies\build_against_pkg_dependencies.csproj"/> + + <!-- This will use the overridden PrereleaseResolveNuGetPackageAssets, which outputs copy local items + for the xunit wrapper projects --> + <PrereleaseResolveNuGetPackageAssets AllowFallbackOnTargetSelection="true" + IncludeFrameworkReferences="false" + NuGetPackagesDirectory="$(PackagesDir)" + RuntimeIdentifier="$(TestNugetRuntimeId)" + ProjectLanguage="$(Language)" + ProjectLockFile="%(ProductProjectLockJsonFiles.Identity)" + TargetMonikers="@(TestTargetFramework)"> + <Output TaskParameter="ResolvedAnalyzers" ItemName="RefAnalyzer" /> + <Output TaskParameter="ResolvedReferences" ItemName="RefReference" /> + <Output TaskParameter="ResolvedCopyLocalItems" ItemName="RefRunTimeCopyLocal" /> + </PrereleaseResolveNuGetPackageAssets> + + <Copy + SourceFiles="@(RefRunTimeCopyLocal)" + DestinationFolder="$(ProductDestination)" + SkipUnchangedFiles="$(SkipCopyUnchangedFiles)" + OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" + Retries="$(CopyRetryCount)" + RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)" + UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)"> + <Output TaskParameter="DestinationFiles" ItemName="FileWrites" /> + </Copy> + </Target> + + <Target Name="CopyCrossgenToProduct" + Outputs="$(ProductDestination)\crossgen.exe;$(CoreOverlay)\crossgen.exe"> + + <Copy + SourceFiles="@(CrossGenFiles)" + DestinationFolder="$(ProductDestination)" + SkipUnchangedFiles="$(SkipCopyUnchangedFiles)" + OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" + Retries="$(CopyRetryCount)" + RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)" + UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)"> + <Output TaskParameter="DestinationFiles" ItemName="FileWrites" /> + </Copy> + + </Target> + </Project> |