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" />
6 <!-- defined in buildtools packaging.targets, but we need this before targets are imported -->
7 <PackagePlatform>AnyCPU</PackagePlatform>
9 <!-- build the transport package which includes product and symbols in addition to standard packages -->
10 <CreatePackedPackage Condition="'$(CreatePackedPackage)' == ''">true</CreatePackedPackage>
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>
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>
24 <RuntimeOS Condition="'$(RuntimeOS)' == ''">$(OSRid)</RuntimeOS>
26 <SupportedPackageOSGroups Condition="'$(SupportedPackageOSGroups)' == ''">Windows_NT;OSX;Android;Linux</SupportedPackageOSGroups>
27 <SupportedPackageOSGroups>;$(SupportedPackageOSGroups);</SupportedPackageOSGroups>
29 <!-- Identify OS family based upon the RuntimeOS, which could be distro specific (e.g. osx.10.12) or
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>
38 <!-- derive an OS Group based on the OS Family -->
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>
46 <_isSupportedOSGroup Condition="!$(SupportedPackageOSGroups.Contains(';$(_derivedPackageTargetOSGroup);'))">false</_isSupportedOSGroup>
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>
57 <SkipPackageFileCheck>true</SkipPackageFileCheck>
58 <OutputPath>$(PackageOutputPath)</OutputPath>
61 <PropertyGroup Condition="'$(IsLineupPackage)' == 'true'">
62 <SkipValidatePackage>true</SkipValidatePackage>
63 <IncludeRuntimeJson>true</IncludeRuntimeJson>
67 <When Condition="'$(PackageRID)' != ''" />
68 <When Condition="'$(_runtimeOSFamily)' == 'win'">
70 <RIDPlatform>win7</RIDPlatform>
71 <RIDPlatform Condition="'$(ArchGroup)' == 'arm'">win8</RIDPlatform>
72 <RIDPlatform Condition="'$(ArchGroup)' == 'arm64'">win10</RIDPlatform>
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>
79 <When Condition="'$(_runtimeOSFamily)' == 'osx'">
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>
86 <When Condition="'$(_runtimeOSFamily)' == 'android'">
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>
93 <When Condition="'$(_runtimeOSFamily)' == 'rhel'">
95 <PackageRID>$(OSRid)-$(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>
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>
109 <!-- Determine per-platform native binary extensions. -->
111 <When Condition="'$(_runtimeOSFamily)' == 'win'" />
112 <When Condition="'$(_runtimeOSFamily)' == 'osx'">
114 <LibraryFileExtension>.dylib</LibraryFileExtension>
115 <SymbolFileExtension>.dwarf</SymbolFileExtension>
118 <When Condition="'$(_runtimeOSFamily)' == 'android'">
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>
127 <LibraryFileExtension>.so</LibraryFileExtension>
128 <SymbolFileExtension>.dbg</SymbolFileExtension>
133 <ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';Linux;'))">
134 <OfficialBuildRID Include="linux-x64" />
135 <OfficialBuildRID Include="rhel.6-x64" />
136 <OfficialBuildRID Include="alpine.3.6-x64" />
137 <OfficialBuildRID Include="linux-arm">
138 <Platform>arm</Platform>
140 <OfficialBuildRID Include="linux-arm64">
141 <Platform>arm64</Platform>
143 <OfficialBuildRID Include="tizen.4.0.0-armel">
144 <Platform>armel</Platform>
147 <ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';OSX;'))">
148 <OfficialBuildRID Include="osx-x64" />
150 <ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';Windows_NT;'))">
151 <OfficialBuildRID Include="win-x86">
152 <Platform>x86</Platform>
154 <OfficialBuildRID Include="win-x64" />
155 <OfficialBuildRID Include="win-arm">
156 <Platform>arm</Platform>
158 <OfficialBuildRID Include="win-arm64">
159 <Platform>arm64</Platform>
163 <!-- Ensure we have a RID-specific package for the current build, even if it isn't in our official set, but
164 don't build the RID-specific package if we're in an unsupported os family -->
165 <BuildRID Include="@(OfficialBuildRID)" Exclude="$(PackageRID)"/>
166 <BuildRID Include="$(PackageRID)"
167 Condition="'$(_isSupportedOSGroup)' == 'true'">
168 <Platform Condition="'$(ArchGroup)' == 'x64'">amd64</Platform>
169 <Platform Condition="'$(ArchGroup)' != 'x64'">$(ArchGroup)</Platform>
174 <_project Include="@(BuildRID)">
175 <Platform Condition="'%(Platform)' == ''">amd64</Platform>
176 <PackageTargetRuntime>%(Identity)</PackageTargetRuntime>
177 <AdditionalProperties>PackageTargetRuntime=%(Identity);Platform=%(Platform)</AdditionalProperties>
180 <_buildRidProjects Include="@(_project->'$(MSBuildProjectName).pkgproj')" />
181 <!-- Only include rid projects for a builds file, not for a lineup package -->
182 <Project Condition="'$(IsLineupPackage)' != 'true'" Include="@(_buildRidProjects)" />
185 <ItemGroup Condition="'$(IsLineupPackage)' == 'true'">
186 <!-- Include project references for a lineup package to generate the runtime.json file -->
187 <ProjectReference Include="@(_buildRidProjects)" />