Merge pull request #13143 from shimingsg/v-shige/add-nogc
[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;Android;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)' == 'android'">Android</_derivedPackageTargetOSGroup>
42     <_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == '' and '$(_runtimeOSFamily)' == 'win'">Windows_NT</_derivedPackageTargetOSGroup>
43     <_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == '' and '$(__BuildOS)' != ''">$(__BuildOS)</_derivedPackageTargetOSGroup>
44     <_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == ''">Linux</_derivedPackageTargetOSGroup>
45
46     <_isSupportedOSGroup Condition="!$(SupportedPackageOSGroups.Contains(';$(_derivedPackageTargetOSGroup);'))">false</_isSupportedOSGroup>
47   </PropertyGroup>
48
49   <!-- _packageTargetOSGroup is used to control the runtime package imports, don't import runtime package targets for 
50        an unsupported OS Group -->
51   <PropertyGroup Condition="'$(PackageTargetRuntime)' != '' and '$(_isSupportedOSGroup)' == 'true'">
52     <!-- Android will use Linux package definitions -->
53     <_packageTargetOSGroup>$(_derivedPackageTargetOSGroup)</_packageTargetOSGroup>
54     <_packageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == 'Android'">Linux</_packageTargetOSGroup>
55   </PropertyGroup>
56   <PropertyGroup>
57     <SkipPackageFileCheck>true</SkipPackageFileCheck>
58     <OutputPath>$(PackageOutputPath)</OutputPath>
59   </PropertyGroup>
60
61   <PropertyGroup Condition="'$(IsLineupPackage)' == 'true'">
62     <SkipValidatePackage>true</SkipValidatePackage>
63     <IncludeRuntimeJson>true</IncludeRuntimeJson>
64   </PropertyGroup>
65
66   <Choose>
67     <When Condition="'$(PackageRID)' != ''" />
68     <When Condition="'$(_runtimeOSFamily)' == 'win'">
69       <PropertyGroup>
70         <RIDPlatform>win7</RIDPlatform>
71         <RIDPlatform Condition="'$(ArchGroup)' == 'arm'">win8</RIDPlatform>
72         <RIDPlatform Condition="'$(ArchGroup)' == 'arm64'">win10</RIDPlatform>
73         
74         <!-- Set the platform part of the RID if we are doing a portable build -->
75         <RIDPlatform Condition="'$(PortableBuild)' == 'true'">win</RIDPlatform>
76         <PackageRID>$(RIDPlatform)-$(ArchGroup)</PackageRID>
77       </PropertyGroup>
78     </When>
79     <When Condition="'$(_runtimeOSFamily)' == 'osx'">
80       <PropertyGroup>
81         <PackageRID>osx.10.12-$(ArchGroup)</PackageRID>
82         <!-- Set the platform part of the RID if we are doing a portable build -->
83         <PackageRID Condition="'$(PortableBuild)' == 'true'">osx-$(ArchGroup)</PackageRID>
84       </PropertyGroup>
85     </When>
86     <When Condition="'$(_runtimeOSFamily)' == 'android'">
87       <PropertyGroup>
88         <PackageRID>android.21-$(ArchGroup)</PackageRID>
89         <!-- Set the platform part of the RID if we are doing a portable build -->
90         <PackageRID Condition="'$(PortableBuild)' == '1'">android-$(ArchGroup)</PackageRID>
91       </PropertyGroup>
92     </When>
93     <When Condition="'$(_runtimeOSFamily)' == 'rhel'">
94       <PropertyGroup>
95         <PackageRID>rhel.7-$(ArchGroup)</PackageRID>
96         <!-- Set the platform part of the RID if we are doing a portable build -->
97         <PackageRID Condition="'$(PortableBuild)' == 'true'">linux-$(ArchGroup)</PackageRID>
98       </PropertyGroup>
99     </When>
100     <Otherwise>
101       <PropertyGroup>
102         <PackageRID>$(RuntimeOS)-$(ArchGroup)</PackageRID>
103         <!-- Set the platform part of the RID if we are doing a portable build -->
104         <PackageRID Condition="'$(PortableBuild)' == 'true'">linux-$(ArchGroup)</PackageRID>
105       </PropertyGroup>
106     </Otherwise>
107   </Choose>
108
109   <!-- Determine per-platform native binary extensions. -->
110   <Choose>
111     <When Condition="'$(_runtimeOSFamily)' == 'win'" />
112     <When Condition="'$(_runtimeOSFamily)' == 'osx'">
113       <PropertyGroup>
114         <LibraryFileExtension>.dylib</LibraryFileExtension>
115         <SymbolFileExtension>.dwarf</SymbolFileExtension>
116       </PropertyGroup>
117     </When>
118     <When Condition="'$(_runtimeOSFamily)' == 'android'">
119       <PropertyGroup>
120         <LibraryFileExtension>.so</LibraryFileExtension>
121         <!--symbols included in .so, like Linux, but can be generated externally and if so, uses .debug ext-->
122         <SymbolFileExtension>.debug</SymbolFileExtension>
123       </PropertyGroup>
124     </When>
125     <Otherwise>
126       <PropertyGroup>
127         <LibraryFileExtension>.so</LibraryFileExtension>
128         <SymbolFileExtension>.dbg</SymbolFileExtension>
129       </PropertyGroup>
130     </Otherwise>
131   </Choose>
132
133   <ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';Linux;'))">
134     <OfficialBuildRID Include="linux-x64" />
135     <OfficialBuildRID Include="linux-arm">
136       <Platform>arm</Platform>
137     </OfficialBuildRID>
138     <OfficialBuildRID Include="linux-arm64">
139       <Platform>arm64</Platform>
140     </OfficialBuildRID>
141     <OfficialBuildRID Include="tizen.4.0.0-armel">
142       <Platform>armel</Platform>
143     </OfficialBuildRID>
144   </ItemGroup>
145   <ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';OSX;'))">
146     <OfficialBuildRID Include="osx-x64" />
147   </ItemGroup>
148   <ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';Windows_NT;'))">
149     <OfficialBuildRID Include="win-x86">
150       <Platform>x86</Platform>
151     </OfficialBuildRID>
152     <OfficialBuildRID Include="win-x64" />
153     <OfficialBuildRID Include="win-arm">
154       <Platform>arm</Platform>
155     </OfficialBuildRID>
156     <OfficialBuildRID Include="win-arm64">
157       <Platform>arm64</Platform>
158     </OfficialBuildRID>
159   </ItemGroup>
160   <ItemGroup>
161     <!-- Ensure we have a RID-specific package for the current build, even if it isn't in our official set, but 
162          don't build the RID-specific package if we're in an unsupported os family -->
163     <BuildRID Include="@(OfficialBuildRID)" Exclude="$(PackageRID)"/>
164     <BuildRID Include="$(PackageRID)"
165               Condition="'$(_isSupportedOSGroup)' == 'true'">
166       <Platform Condition="'$(ArchGroup)' == 'x64'">amd64</Platform>
167       <Platform Condition="'$(ArchGroup)' != 'x64'">$(ArchGroup)</Platform>
168     </BuildRID>
169   </ItemGroup>
170
171   <ItemGroup>
172     <_project Include="@(BuildRID)">
173       <Platform Condition="'%(Platform)' == ''">amd64</Platform>
174       <PackageTargetRuntime>%(Identity)</PackageTargetRuntime>
175       <AdditionalProperties>PackageTargetRuntime=%(Identity);Platform=%(Platform)</AdditionalProperties>
176     </_project>
177
178     <_buildRidProjects Include="@(_project->'$(MSBuildProjectName).pkgproj')" />
179     <!-- Only include rid projects for a builds file, not for a lineup package -->
180     <Project Condition="'$(IsLineupPackage)' != 'true'" Include="@(_buildRidProjects)" />
181   </ItemGroup>
182
183   <ItemGroup Condition="'$(IsLineupPackage)' == 'true'">
184     <!-- Include project references for a lineup package to generate the runtime.json file -->
185     <ProjectReference Include="@(_buildRidProjects)" />
186   </ItemGroup>
187 </Project>