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 <!-- 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)' == 'win'">Windows_NT</_derivedPackageTargetOSGroup>
42 <_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == '' and '$(__BuildOS)' != ''">$(__BuildOS)</_derivedPackageTargetOSGroup>
43 <_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == ''">Linux</_derivedPackageTargetOSGroup>
45 <_isSupportedOSGroup Condition="!$(SupportedPackageOSGroups.Contains(';$(_derivedPackageTargetOSGroup);'))">false</_isSupportedOSGroup>
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>
55 <SkipPackageFileCheck>true</SkipPackageFileCheck>
56 <OutputPath>$(PackageOutputPath)</OutputPath>
59 <PropertyGroup Condition="'$(IsLineupPackage)' == 'true'">
60 <SkipValidatePackage>true</SkipValidatePackage>
61 <IncludeRuntimeJson>true</IncludeRuntimeJson>
65 <When Condition="'$(PackageRID)' != ''" />
66 <When Condition="'$(_runtimeOSFamily)' == 'win'">
68 <RIDPlatform>win7</RIDPlatform>
69 <RIDPlatform Condition="'$(ArchGroup)' == 'arm'">win8</RIDPlatform>
70 <RIDPlatform Condition="'$(ArchGroup)' == 'arm64'">win10</RIDPlatform>
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>
77 <When Condition="'$(_runtimeOSFamily)' == 'osx'">
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>
84 <When Condition="'$(_runtimeOSFamily)' == 'rhel'">
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>
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>
100 <!-- Determine per-platform native binary extensions. -->
102 <When Condition="'$(_runtimeOSFamily)' == 'win'" />
103 <When Condition="'$(_runtimeOSFamily)' == 'osx'">
105 <LibraryFileExtension>.dylib</LibraryFileExtension>
106 <SymbolFileExtension>.dwarf</SymbolFileExtension>
111 <LibraryFileExtension>.so</LibraryFileExtension>
112 <SymbolFileExtension>.dbg</SymbolFileExtension>
117 <ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';Linux;'))">
118 <OfficialBuildRID Include="linux-x64" />
119 <OfficialBuildRID Include="linux-arm">
120 <Platform>arm</Platform>
122 <OfficialBuildRID Include="tizen.4.0.0-armel">
123 <Platform>armel</Platform>
126 <ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';OSX;'))">
127 <OfficialBuildRID Include="osx-x64" />
129 <ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';Windows_NT;'))">
130 <OfficialBuildRID Include="win-x86">
131 <Platform>x86</Platform>
133 <OfficialBuildRID Include="win-x64" />
134 <OfficialBuildRID Include="win-arm">
135 <Platform>arm</Platform>
137 <OfficialBuildRID Include="win-arm64">
138 <Platform>arm64</Platform>
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>
153 <_project Include="@(BuildRID)">
154 <Platform Condition="'%(Platform)' == ''">amd64</Platform>
155 <PackageTargetRuntime>%(Identity)</PackageTargetRuntime>
156 <AdditionalProperties>PackageTargetRuntime=%(Identity);Platform=%(Platform)</AdditionalProperties>
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)" />
164 <ItemGroup Condition="'$(IsLineupPackage)' == 'true'">
165 <!-- Include project references for a lineup package to generate the runtime.json file -->
166 <ProjectReference Include="@(_buildRidProjects)" />