[Tizen] Set obj dir to be TargetRid specific
[platform/upstream/coreclr.git] / tests / src / Common / CoreFX / CoreFX.depproj
1 <?xml version="1.0" encoding="utf-8"?>
2 <Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
3   <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
4   <PropertyGroup>
5       <RestoreOutputPath>$(SourceDir)Common\CoreFX\obj-$(TargetRid)</RestoreOutputPath>
6       <Language>C#</Language>
7       <NugetTargetMoniker>.NETCoreApp,Version=v3.1</NugetTargetMoniker>
8       <TargetFramework>netcoreapp3.1</TargetFramework>
9       <RuntimeFrameworkVersion>$(MicrosoftNETCoreAppVersion)</RuntimeFrameworkVersion>
10       <ContainsPackageReferences>true</ContainsPackageReferences>
11       <CLRTestKind>SharedLibrary</CLRTestKind>
12       <IsTestProject>false</IsTestProject>
13       <MicrosoftDiagnosticsRuntimePackageVersion>1.0.5</MicrosoftDiagnosticsRuntimePackageVersion>
14   </PropertyGroup>
15
16   <!-- Switch RuntimeIdentifier according to currently targeted OSGroup -->
17   <PropertyGroup>
18       <RuntimeIdentifier Condition="'$(OSGroup)' == 'Windows_NT'">win-$(Platform)</RuntimeIdentifier>
19       <RuntimeIdentifier Condition="'$(OSGroup)' == 'Linux'">linux-$(Platform)</RuntimeIdentifier>
20       <RuntimeIdentifier Condition="'$(OSGroup)' == 'OSX'">osx-$(Platform)</RuntimeIdentifier>
21       <NugetRuntimeIdentifier>$(RuntimeIdentifier)</NugetRuntimeIdentifier>
22
23       <!-- Set AdditionalRestoreArgs so the _DnuRestoreCommandFull in Tools\packageresolve.targets
24            passes these on to 'dotnet restore'. This is needed so all the various dirs.props files
25            set up the target architecture correctly, so $(Platform) above gets set correctly, among
26            other things. (Note that _DnuRestoreCommandFull doesn't properly set
27            TargetGroup/ConfigurationGroup/ArchGroup, and even if they are set, it isn't used by
28            the various dirs.props files.)
29       -->
30       <AdditionalRestoreArgs>/p:__BuildOS=$(__BuildOS) /p:__BuildType=$(__BuildType) /p:__BuildArch=$(__BuildArch)</AdditionalRestoreArgs>
31   </PropertyGroup>
32
33   <ItemGroup>
34
35     <!-- Workaround to exclude runtime assets from this package while we fix a bug in CoreFx -->
36     <PackageReference Include="System.IO.FileSystem.AccessControl" Version="$(SystemIOFileSystemAccessControlVersion)" ExcludeAssets="Runtime" />
37
38     <!-- Microsoft.Private.CoreFx.OOB is a meta-package that contains references to most of what we need -->
39     <PackageReference Include="Microsoft.Private.CoreFx.OOB" Version="$(MicrosoftPrivateCoreFxNETCoreAppVersion)" />
40
41     <!-- dotnet.exe -->
42     <PackageReference Include="Microsoft.NETCore.DotNetHost" Version="$(MicrosoftNETCoreAppVersion)" />
43
44     <!-- hostfxr.dll -->
45     <PackageReference Include="Microsoft.NETCore.DotNetHostResolver" Version="$(MicrosoftNETCoreAppVersion)" />
46
47     <!-- hostpolicy.dll -->
48     <PackageReference Include="Microsoft.NETCore.DotNetHostPolicy" Version="$(MicrosoftNETCoreAppVersion)" />
49
50   </ItemGroup>
51
52   <!-- Target SetupTestingHost needs to run after "AfterResolveReferences" so @(ReferenceCopyLocalPaths) is
53        set up, and before "BeforeCompile" because @(ReferenceCopyLocalPaths) is cleared out during the
54        compile phase.
55   -->
56   <Target Name="SetupTestingHost" AfterTargets="AfterResolveReferences" BeforeTargets="BeforeCompile">
57
58     <Error Condition="'$(CORE_ROOT)' == ''"
59            Text="CORE_ROOT variable is not set." />
60
61     <PropertyGroup Condition="'$(OSGroup)'=='Windows_NT'">
62       <HostFxrFileName>hostfxr</HostFxrFileName>
63       <HostFxrFileExtension>dll</HostFxrFileExtension>
64       <DotnetExecutableName>dotnet.exe</DotnetExecutableName>
65       <HostPolicyFileName>hostpolicy</HostPolicyFileName>
66       <HostPolicyExtension>dll</HostPolicyExtension>
67     </PropertyGroup>
68
69     <PropertyGroup Condition="'$(OSGroup)'!='Windows_NT'">
70       <HostFxrFileName>libhostfxr</HostFxrFileName>
71       <HostFxrFileExtension Condition="'$(OSGroup)' == 'Linux' Or '$(OSGroup)' == 'FreeBSD'">so</HostFxrFileExtension>
72       <HostFxrFileExtension Condition="$(OSGroup) =='OSX'">dylib</HostFxrFileExtension>
73       <HostPolicyFileName>libhostpolicy</HostPolicyFileName>
74       <HostPolicyExtension>$(HostFxrFileExtension)</HostPolicyExtension>
75       <DotnetExecutableName>dotnet</DotnetExecutableName>
76     </PropertyGroup>
77
78     <ItemGroup>
79       <!-- Workaround for packages on which Microsoft.NetCoreApp expresses a dependency
80            The <PackageToInclude> element doesn't allow a version to be specified and we end up with clashing assembly versions in Core_Root
81       -->
82       <!--
83       <NetCoreAppPackagedAssemblies Include="System.Text.Encoding.CodePages.dll"/>
84       -->
85
86       <!-- Use xunit dependencies defined in CoreFX.depproj instead of conflicting versions from test dependencies. -->
87       <TestDependenciesToExclude Include="$(CORE_ROOT)\**\xunit*"/>
88
89       <!-- Exclude subdirectories that contain cross-architecture (possibly cross-bitness) crossgen/JIT -->
90       <TestDependenciesToExclude Include="$(CORE_ROOT)\**\x64\*"/>
91
92       <!-- Don't include all the nuget files -->
93       <TestDependenciesToExclude Include="$(CORE_ROOT)\.nuget\**\*"/>
94
95       <CoreCLRBinariesToExclude Include="@(NetCoreAppPackagedAssemblies);@(TestDependenciesToExclude -> '%(Identity)')" />
96     </ItemGroup>
97
98     <ItemGroup>
99       <!-- REVIEW: do we need to copy recursively (and flatten the structure into a single destination folder)? Can we just copy
100            the top level? Or, should we preserve the hierarchy?
101       -->
102       <CoreCLRBinaries Include="$(CORE_ROOT)\**\*.*" Exclude="$(CORE_ROOT)\**\@(CoreCLRBinariesToExclude -> '%(Identity)' )" />
103     </ItemGroup>
104
105     <ItemGroup>
106       <HostFxFile Include="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.Filename)' == '$(HostFxrFileName)'" />
107       <DotnetExe Include="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.Filename)' == 'dotnet'" />
108       <HostPolicyFile Include="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.Filename)' == '$(HostPolicyFileName)'" />
109     </ItemGroup>
110
111     <Copy SourceFiles="@(HostFxFile)"
112           DestinationFolder="$(NETCoreAppTestHostFxrPath)"
113           SkipUnchangedFiles="true"
114           UseHardlinksIfPossible="true" />
115
116     <Copy SourceFiles="@(HostPolicyFile)"
117           DestinationFolder="$(NETCoreAppTestSharedFrameworkPath)"
118           SkipUnchangedFiles="true"
119           UseHardlinksIfPossible="true" />
120
121     <Copy SourceFiles="@(DotnetExe)"
122           DestinationFolder="$(TestHostRootPath)"
123           SkipUnchangedFiles="true"
124           UseHardlinksIfPossible="true"  />
125
126     <Copy SourceFiles="@(CoreCLRBinaries)"
127           DestinationFolder="$(NETCoreAppTestSharedFrameworkPath)"
128           SkipUnchangedFiles="true" />
129
130     <Exec Command="chmod +x $(TestHostRootPath)%(DotnetExe.Filename)%(DotnetExe.Extension)" Condition="'$(OSGroup)' != 'Windows_NT'"/>
131   </Target>
132
133   <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
134
135   <PropertyGroup>
136     <ProjectAssetsFile>$(SourceDir)Common\CoreFX\obj-$(TargetRid)\project.assets.json</ProjectAssetsFile>
137   </PropertyGroup>
138 </Project>