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;Linux</SupportedPackageOSGroups>
27 <SupportedPackageOSGroups>;$(SupportedPackageOSGroups);</SupportedPackageOSGroups>
29 <_runtimeOSVersionIndex>$(RuntimeOS.IndexOfAny(".-0123456789"))</_runtimeOSVersionIndex>
30 <_runtimeOSFamily Condition="'$(_runtimeOSVersionIndex)' != '-1'">$(RuntimeOS.SubString(0, $(_runtimeOSVersionIndex)))</_runtimeOSFamily>
31 <_isSupportedOSGroup>true</_isSupportedOSGroup>
34 <!-- derive an OS Group based on the OS Family -->
36 <_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == '' and '$(_runtimeOSFamily)' == 'osx'">OSX</_derivedPackageTargetOSGroup>
37 <_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == '' and '$(_runtimeOSFamily)' == 'win'">Windows_NT</_derivedPackageTargetOSGroup>
38 <_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == '' and '$(__BuildOS)' != ''">$(__BuildOS)</_derivedPackageTargetOSGroup>
39 <_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == ''">Linux</_derivedPackageTargetOSGroup>
41 <_isSupportedOSGroup Condition="!$(SupportedPackageOSGroups.Contains(';$(_derivedPackageTargetOSGroup);'))">false</_isSupportedOSGroup>
44 <!-- _packageTargetOSGroup is used to control the runtime package imports, don't import runtime package targets for
45 an unsupported OS Group -->
46 <PropertyGroup Condition="'$(PackageTargetRuntime)' != '' and '$(_isSupportedOSGroup)' == 'true'">
47 <_packageTargetOSGroup>$(_derivedPackageTargetOSGroup)</_packageTargetOSGroup>
51 <SkipPackageFileCheck>true</SkipPackageFileCheck>
52 <OutputPath>$(PackageOutputPath)</OutputPath>
55 <PropertyGroup Condition="'$(IsLineupPackage)' == 'true'">
56 <SkipValidatePackage>true</SkipValidatePackage>
57 <IncludeRuntimeJson>true</IncludeRuntimeJson>
61 <When Condition="'$(PackageRID)' != ''" />
62 <When Condition="'$(_runtimeOSFamily)' == 'win'">
64 <RIDPlatform>win7</RIDPlatform>
65 <RIDPlatform Condition="'$(ArchGroup)' == 'arm'">win8</RIDPlatform>
66 <RIDPlatform Condition="'$(ArchGroup)' == 'arm64'">win10</RIDPlatform>
68 <!-- Set the platform part of the RID if we are doing a portable build -->
69 <RIDPlatform Condition="'$(PortableBuild)' == '1'">win</RIDPlatform>
70 <PackageRID>$(RIDPlatform)-$(ArchGroup)</PackageRID>
73 <When Condition="'$(_runtimeOSFamily)' == 'osx'">
75 <PackageRID>osx.10.12-$(ArchGroup)</PackageRID>
76 <!-- Set the platform part of the RID if we are doing a portable build -->
77 <PackageRID Condition="'$(PortableBuild)' == '1'">osx-$(ArchGroup)</PackageRID>
80 <When Condition="'$(_runtimeOSFamily)' == 'rhel'">
82 <PackageRID>rhel.7-$(ArchGroup)</PackageRID>
83 <!-- Set the platform part of the RID if we are doing a portable build -->
84 <PackageRID Condition="'$(PortableBuild)' == '1'">linux-$(ArchGroup)</PackageRID>
89 <PackageRID>$(RuntimeOS)-$(ArchGroup)</PackageRID>
90 <!-- Set the platform part of the RID if we are doing a portable build -->
91 <PackageRID Condition="'$(PortableBuild)' == '1'">linux-$(ArchGroup)</PackageRID>
96 <!-- Determine per-platform native binary extensions. -->
98 <When Condition="'$(_runtimeOSFamily)' == 'win'" />
99 <When Condition="'$(_runtimeOSFamily)' == 'osx'">
101 <LibraryFileExtension>.dylib</LibraryFileExtension>
102 <SymbolFileExtension>.dwarf</SymbolFileExtension>
107 <LibraryFileExtension>.so</LibraryFileExtension>
108 <SymbolFileExtension>.dbg</SymbolFileExtension>
113 <ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';Linux;'))">
114 <OfficialBuildRID Include="alpine.3.4.3-x64" />
115 <OfficialBuildRID Include="debian.8-armel">
116 <Platform>armel</Platform>
118 <OfficialBuildRID Include="debian.8-x64" />
119 <OfficialBuildRID Include="fedora.23-x64" />
120 <OfficialBuildRID Include="fedora.24-x64" />
121 <OfficialBuildRID Include="linux-x64" />
122 <OfficialBuildRID Include="linux-arm">
123 <Platform>arm</Platform>
125 <OfficialBuildRID Include="opensuse.42.1-x64" />
126 <OfficialBuildRID Include="rhel.7-x64" />
127 <OfficialBuildRID Include="tizen.4.0.0-armel">
128 <Platform>armel</Platform>
130 <OfficialBuildRID Include="ubuntu.14.04-arm">
131 <Platform>arm</Platform>
133 <OfficialBuildRID Include="ubuntu.14.04-x64" />
134 <OfficialBuildRID Include="ubuntu.16.04-arm">
135 <Platform>arm</Platform>
137 <OfficialBuildRID Include="ubuntu.16.04-x64" />
138 <OfficialBuildRID Include="ubuntu.16.10-x64" />
140 <ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';OSX;'))">
141 <OfficialBuildRID Include="osx.10.12-x64" />
142 <OfficialBuildRID Include="osx-x64" />
144 <ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';Windows_NT;'))">
145 <OfficialBuildRID Include="win7-x86">
146 <Platform>x86</Platform>
148 <OfficialBuildRID Include="win-x86">
149 <Platform>x86</Platform>
151 <OfficialBuildRID Include="win7-x64" />
152 <OfficialBuildRID Include="win-x64" />
153 <OfficialBuildRID Include="win8-arm">
154 <Platform>arm</Platform>
156 <OfficialBuildRID Include="win10-arm64">
157 <Platform>arm64</Platform>
159 <OfficialBuildRID Include="win-arm">
160 <Platform>arm</Platform>
162 <OfficialBuildRID Include="win-arm64">
163 <Platform>arm64</Platform>
167 <!-- Ensure we have a RID-specific package for the current build, even if it isn't in our official set, but
168 don't build the RID-specific package if we're in an unsupported os family -->
169 <BuildRID Include="@(OfficialBuildRID)" Exclude="$(PackageRID)"/>
170 <BuildRID Include="$(PackageRID)"
171 Condition="'$(_isSupportedOSGroup)' == 'true'">
172 <Platform Condition="'$(ArchGroup)' == 'x64'">amd64</Platform>
173 <Platform Condition="'$(ArchGroup)' != 'x64'">$(ArchGroup)</Platform>
178 <_project Include="@(BuildRID)">
179 <Platform Condition="'%(Platform)' == ''">amd64</Platform>
180 <PackageTargetRuntime>%(Identity)</PackageTargetRuntime>
181 <AdditionalProperties>PackageTargetRuntime=%(Identity);Platform=%(Platform)</AdditionalProperties>
184 <_buildRidProjects Include="@(_project->'$(MSBuildProjectName).pkgproj')" />
185 <!-- Only include rid projects for a builds file, not for a lineup package -->
186 <Project Condition="'$(IsLineupPackage)' != 'true'" Include="@(_buildRidProjects)" />
189 <ItemGroup Condition="'$(IsLineupPackage)' == 'true'">
190 <!-- Include project references for a lineup package to generate the runtime.json file -->
191 <ProjectReference Include="@(_buildRidProjects)" />