Merge pull request #11860 from rartemev/fix_tests_build_4
[platform/upstream/coreclr.git] / src / .nuget / dir.props
1 <?xml version="1.0" encoding="utf-8"?>
2 <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3   <Import Project="$(MSBuildThisFileDirectory)..\..\dir.props" />
4
5   <PropertyGroup>
6     <!-- defined in buildtools packaging.targets, but we need this before targets are imported -->
7     <PackagePlatform>AnyCPU</PackagePlatform>
8     
9     <!-- build the transport package which includes product and symbols in addition to standard packages -->
10     <CreatePackedPackage Condition="'$(CreatePackedPackage)' == ''">true</CreatePackedPackage>
11
12     <!-- Distro rid is passed as runtimeos-arch-->
13     <_parseDistroRid>$(__DistroRid)</_parseDistroRid>
14     <_parseDistroRid Condition="'$(_parseDistroRid)' == '' and '$(__BuildOS)' == 'OSX'">osx.10.12-x64</_parseDistroRid>
15     <_distroRidIndex>$(_parseDistroRid.IndexOfAny("-"))</_distroRidIndex>
16     <_archRidIndex>$([MSBuild]::Add($(_distroRidIndex), 1))</_archRidIndex>
17     <OSRid Condition="'$(OSRid)' == '' and '$(_distroRidIndex)' != '-1'">$(_parseDistroRid.SubString(0, $(_distroRidIndex)))</OSRid>
18     <OSRid Condition="'$(OSRid)' == ''">win10</OSRid>
19
20     <ArchGroup Condition="'$(ArchGroup)' == '' and '$(_archRidIndex)' != '0'">$(_parseDistroRid.SubString($(_archRidIndex)))</ArchGroup>
21     <ArchGroup Condition="'$(ArchGroup)' == '' and '$(Platform)' != ''">$(Platform)</ArchGroup>
22     <ArchGroup Condition="'$(ArchGroup)' == ''">$(BuildArch)</ArchGroup>
23
24     <RuntimeOS Condition="'$(RuntimeOS)' == ''">$(OSRid)</RuntimeOS>
25
26     <SupportedPackageOSGroups Condition="'$(SupportedPackageOSGroups)' == ''">Windows_NT;OSX;Linux</SupportedPackageOSGroups>
27     <SupportedPackageOSGroups>;$(SupportedPackageOSGroups);</SupportedPackageOSGroups>
28
29     <!-- Identify OS family based upon the RuntimeOS, which could be distro specific (e.g. osx.10.12) or 
30          portable (e.g. osx). 
31     -->
32     <_runtimeOSVersionIndex>$(RuntimeOS.IndexOfAny(".-0123456789"))</_runtimeOSVersionIndex>
33     <_runtimeOSFamily Condition="'$(_runtimeOSVersionIndex)' != '-1'">$(RuntimeOS.SubString(0, $(_runtimeOSVersionIndex)))</_runtimeOSFamily>
34     <_runtimeOSFamily Condition="'$(_runtimeOSVersionIndex)' == '-1'">$(RuntimeOS)</_runtimeOSFamily>
35     <_isSupportedOSGroup>true</_isSupportedOSGroup>
36   </PropertyGroup>
37
38   <!-- derive an OS Group based on the OS Family -->
39   <PropertyGroup>
40     <_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == '' and '$(_runtimeOSFamily)' == 'osx'">OSX</_derivedPackageTargetOSGroup>
41     <_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == '' and '$(_runtimeOSFamily)' == 'win'">Windows_NT</_derivedPackageTargetOSGroup>
42     <_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == '' and '$(__BuildOS)' != ''">$(__BuildOS)</_derivedPackageTargetOSGroup>
43     <_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == ''">Linux</_derivedPackageTargetOSGroup>
44
45     <_isSupportedOSGroup Condition="!$(SupportedPackageOSGroups.Contains(';$(_derivedPackageTargetOSGroup);'))">false</_isSupportedOSGroup>
46   </PropertyGroup>
47
48   <!-- _packageTargetOSGroup is used to control the runtime package imports, don't import runtime package targets for 
49        an unsupported OS Group -->
50   <PropertyGroup Condition="'$(PackageTargetRuntime)' != '' and '$(_isSupportedOSGroup)' == 'true'">
51     <_packageTargetOSGroup>$(_derivedPackageTargetOSGroup)</_packageTargetOSGroup>
52   </PropertyGroup>
53
54   <PropertyGroup>
55     <SkipPackageFileCheck>true</SkipPackageFileCheck>
56     <OutputPath>$(PackageOutputPath)</OutputPath>
57   </PropertyGroup>
58
59   <PropertyGroup Condition="'$(IsLineupPackage)' == 'true'">
60     <SkipValidatePackage>true</SkipValidatePackage>
61     <IncludeRuntimeJson>true</IncludeRuntimeJson>
62   </PropertyGroup>
63
64   <Choose>
65     <When Condition="'$(PackageRID)' != ''" />
66     <When Condition="'$(_runtimeOSFamily)' == 'win'">
67       <PropertyGroup>
68         <RIDPlatform>win7</RIDPlatform>
69         <RIDPlatform Condition="'$(ArchGroup)' == 'arm'">win8</RIDPlatform>
70         <RIDPlatform Condition="'$(ArchGroup)' == 'arm64'">win10</RIDPlatform>
71         
72         <!-- Set the platform part of the RID if we are doing a portable build -->
73         <RIDPlatform Condition="'$(PortableBuild)' == 'true'">win</RIDPlatform>
74         <PackageRID>$(RIDPlatform)-$(ArchGroup)</PackageRID>
75       </PropertyGroup>
76     </When>
77     <When Condition="'$(_runtimeOSFamily)' == 'osx'">
78       <PropertyGroup>
79         <PackageRID>osx.10.12-$(ArchGroup)</PackageRID>
80         <!-- Set the platform part of the RID if we are doing a portable build -->
81         <PackageRID Condition="'$(PortableBuild)' == 'true'">osx-$(ArchGroup)</PackageRID>
82       </PropertyGroup>
83     </When>
84     <When Condition="'$(_runtimeOSFamily)' == 'rhel'">
85       <PropertyGroup>
86         <PackageRID>rhel.7-$(ArchGroup)</PackageRID>
87         <!-- Set the platform part of the RID if we are doing a portable build -->
88         <PackageRID Condition="'$(PortableBuild)' == 'true'">linux-$(ArchGroup)</PackageRID>
89       </PropertyGroup>
90     </When>
91     <Otherwise>
92       <PropertyGroup>
93         <PackageRID>$(RuntimeOS)-$(ArchGroup)</PackageRID>
94         <!-- Set the platform part of the RID if we are doing a portable build -->
95         <PackageRID Condition="'$(PortableBuild)' == 'true'">linux-$(ArchGroup)</PackageRID>
96       </PropertyGroup>
97     </Otherwise>
98   </Choose>
99
100   <!-- Determine per-platform native binary extensions. -->
101   <Choose>
102     <When Condition="'$(_runtimeOSFamily)' == 'win'" />
103     <When Condition="'$(_runtimeOSFamily)' == 'osx'">
104       <PropertyGroup>
105         <LibraryFileExtension>.dylib</LibraryFileExtension>
106         <SymbolFileExtension>.dwarf</SymbolFileExtension>
107       </PropertyGroup>
108     </When>
109     <Otherwise>
110       <PropertyGroup>
111         <LibraryFileExtension>.so</LibraryFileExtension>
112         <SymbolFileExtension>.dbg</SymbolFileExtension>
113       </PropertyGroup>
114     </Otherwise>
115   </Choose>
116
117   <ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';Linux;'))">
118     <OfficialBuildRID Include="linux-x64" />
119     <OfficialBuildRID Include="linux-arm">
120       <Platform>arm</Platform>
121     </OfficialBuildRID>
122     <OfficialBuildRID Include="tizen.4.0.0-armel">
123       <Platform>armel</Platform>
124     </OfficialBuildRID>
125   </ItemGroup>
126   <ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';OSX;'))">
127     <OfficialBuildRID Include="osx-x64" />
128   </ItemGroup>
129   <ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';Windows_NT;'))">
130     <OfficialBuildRID Include="win-x86">
131       <Platform>x86</Platform>
132     </OfficialBuildRID>
133     <OfficialBuildRID Include="win-x64" />
134     <OfficialBuildRID Include="win-arm">
135       <Platform>arm</Platform>
136     </OfficialBuildRID>
137     <OfficialBuildRID Include="win-arm64">
138       <Platform>arm64</Platform>
139     </OfficialBuildRID>
140   </ItemGroup>
141   <ItemGroup>
142     <!-- Ensure we have a RID-specific package for the current build, even if it isn't in our official set, but 
143          don't build the RID-specific package if we're in an unsupported os family -->
144     <BuildRID Include="@(OfficialBuildRID)" Exclude="$(PackageRID)"/>
145     <BuildRID Include="$(PackageRID)"
146               Condition="'$(_isSupportedOSGroup)' == 'true'">
147       <Platform Condition="'$(ArchGroup)' == 'x64'">amd64</Platform>
148       <Platform Condition="'$(ArchGroup)' != 'x64'">$(ArchGroup)</Platform>
149     </BuildRID>
150   </ItemGroup>
151
152   <ItemGroup>
153     <_project Include="@(BuildRID)">
154       <Platform Condition="'%(Platform)' == ''">amd64</Platform>
155       <PackageTargetRuntime>%(Identity)</PackageTargetRuntime>
156       <AdditionalProperties>PackageTargetRuntime=%(Identity);Platform=%(Platform)</AdditionalProperties>
157     </_project>
158
159     <_buildRidProjects Include="@(_project->'$(MSBuildProjectName).pkgproj')" />
160     <!-- Only include rid projects for a builds file, not for a lineup package -->
161     <Project Condition="'$(IsLineupPackage)' != 'true'" Include="@(_buildRidProjects)" />
162   </ItemGroup>
163
164   <ItemGroup Condition="'$(IsLineupPackage)' == 'true'">
165     <!-- Include project references for a lineup package to generate the runtime.json file -->
166     <ProjectReference Include="@(_buildRidProjects)" />
167   </ItemGroup>
168 </Project>