Move CoreCLR to the modern build tools and dnx
[platform/upstream/coreclr.git] / tests / publishdependency.targets
1 <?xml version="1.0" encoding="utf-8"?>
2 <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
4   <UsingTask TaskName="ResolveNuGetPackageAssets" AssemblyFile="$(ToolsDir)Microsoft.DotNet.Build.Tasks.dll"/>
5   
6   <ItemGroup>
7     <TestTargetFramework Include="DNXCore,Version=v5.0">
8       <Folder>dnxcore50</Folder>
9     </TestTargetFramework>
10   </ItemGroup>
11   
12   <ItemGroup>
13     <AllProjectJsonLockFiles Include="$(SourceDir)**\*\project.lock.json"/>
14   </ItemGroup>
15
16   <Target Name="CopyDependecyToCoreRoot"
17     Inputs="@(AllProjectJsonLockFiles)"
18     Outputs="$(CORE_ROOT)\*.*">
19     
20     <ItemGroup>
21       <ProjectJsonLockFileExclude Include="$(SourceDir).nuget\project.lock.json" />
22       <ProjectJsonLockFileExclude Include="$(SourceDir)Test*\**\project.lock.json" />
23       <ProjectJsonLockFileExclude Include="$(SourceDir)Common\Coreclr.TestWrapper\**\project.lock.json" />
24       <ProjectJsonLockFileExclude Include="$(SourceDir)packages\**\*\project.lock.json" />
25     </ItemGroup>
26
27     <ItemGroup>
28       <ProjectLockJsonFiles Include="@(AllProjectJsonLockFiles)"  Exclude="@(ProjectJsonLockFileExclude)"/>
29     </ItemGroup>
30     
31     <!-- This will use the overridden ResolveNuGetPackageAssets, which outputs copy local items
32          for the xunit wrapper projects -->
33     <ResolveNuGetPackageAssets  Architecture="$(PlatformTarget)"
34                                 Configuration="$(Configuration)"
35                                 Language="$(Language)"
36                                 PackageRoot="$(PackagesDir)"
37                                 ProjectLockFile="%(ProjectLockJsonFiles.Identity)"
38                                 TargetFrameworkMonikers="@(TestTargetFramework)"
39                                 TargetPlatformMonikers="$(TargetPlatformMoniker)">
40
41       <Output TaskParameter="ResolvedAnalyzers" ItemName="Analyzer" />
42       <Output TaskParameter="ResolvedReferences" ItemName="Reference" />
43       <Output TaskParameter="ResolvedCopyLocalItems" ItemName="RunTimeCopyLocal" />
44     </ResolveNuGetPackageAssets>
45
46     <ItemGroup>
47       <RunTimeDependecyExclude Include="$(CORE_ROOT)\**\*.*"  />
48       <RunTimeDependecyExcludeFiles Include="@(RunTimeDependecyExclude -> '%(FileName)%(Extension)')" />
49       <RunTimeDependecyExcludeFiles Include="@(RunTimeDependecyExclude -> '%(FileName).ni%(Extension)')" />
50       <RunTimeDependecyExcludeFiles Include="@(RunTimeDependecyExclude -> '%(FileName).pdb')" />
51       <AllResolvedRuntimeDependencies Include="@(RunTimeCopyLocal -> '%(FileName)%(Extension)')">
52         <File>%(Identity)</File>
53       </AllResolvedRuntimeDependencies>
54       <RunTimeDependecyCopyLocalFile Include="@(AllResolvedRuntimeDependencies)"  Exclude="@(RunTimeDependecyExcludeFiles)"/>
55       <RunTimeDependecyCopyLocal Include="@(RunTimeDependecyCopyLocalFile -> '%(File)')"  />
56     </ItemGroup>
57     
58     <Copy
59       SourceFiles="@(RunTimeDependecyCopyLocal)"
60       DestinationFolder="$(CORE_ROOT)"
61       SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
62       OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
63       Retries="$(CopyRetryCount)"
64       RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
65       UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)">
66       <Output TaskParameter="DestinationFiles" ItemName="FileWrites" />
67     </Copy>
68   </Target>
69
70 </Project>