summaryrefslogtreecommitdiff
path: root/src/.nuget/dir.props
blob: 59b94f75b265a816a141763bb74255c99ff95592 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildThisFileDirectory)..\..\dir.props" />

  <PropertyGroup>
    <!-- defined in buildtools packaging.targets, but we need this before targets are imported -->
    <PackagePlatform>AnyCPU</PackagePlatform>
    
    <!-- build the transport package which includes product and symbols in addition to standard packages -->
    <CreatePackedPackage Condition="'$(CreatePackedPackage)' == ''">true</CreatePackedPackage>

    <!-- Distro rid is passed as runtimeos-arch-->
    <_parseDistroRid>$(__DistroRid)</_parseDistroRid>
    <_parseDistroRid Condition="'$(_parseDistroRid)' == '' and '$(__BuildOS)' == 'OSX'">osx.10.12-x64</_parseDistroRid>
    <_distroRidIndex>$(_parseDistroRid.IndexOfAny("-"))</_distroRidIndex>
    <_archRidIndex>$([MSBuild]::Add($(_distroRidIndex), 1))</_archRidIndex>
    <OSRid Condition="'$(OSRid)' == '' and '$(_distroRidIndex)' != '-1'">$(_parseDistroRid.SubString(0, $(_distroRidIndex)))</OSRid>
    <OSRid Condition="'$(OSRid)' == ''">win10</OSRid>

    <ArchGroup Condition="'$(ArchGroup)' == '' and '$(_archRidIndex)' != '0'">$(_parseDistroRid.SubString($(_archRidIndex)))</ArchGroup>
    <ArchGroup Condition="'$(ArchGroup)' == '' and '$(Platform)' != ''">$(Platform)</ArchGroup>
    <ArchGroup Condition="'$(ArchGroup)' == ''">$(BuildArch)</ArchGroup>

    <RuntimeOS Condition="'$(RuntimeOS)' == ''">$(OSRid)</RuntimeOS>

    <SupportedPackageOSGroups Condition="'$(SupportedPackageOSGroups)' == ''">Windows_NT;OSX;Linux</SupportedPackageOSGroups>
    <SupportedPackageOSGroups>;$(SupportedPackageOSGroups);</SupportedPackageOSGroups>

    <_runtimeOSVersionIndex>$(RuntimeOS.IndexOfAny(".-0123456789"))</_runtimeOSVersionIndex>
    <_runtimeOSFamily Condition="'$(_runtimeOSVersionIndex)' != '-1'">$(RuntimeOS.SubString(0, $(_runtimeOSVersionIndex)))</_runtimeOSFamily>
    <_isSupportedOSGroup>true</_isSupportedOSGroup>
  </PropertyGroup>

  <!-- derive an OS Group based on the OS Family -->
  <PropertyGroup>
    <_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == '' and '$(_runtimeOSFamily)' == 'osx'">OSX</_derivedPackageTargetOSGroup>
    <_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == '' and '$(_runtimeOSFamily)' == 'win'">Windows_NT</_derivedPackageTargetOSGroup>
    <_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == '' and '$(__BuildOS)' != ''">$(__BuildOS)</_derivedPackageTargetOSGroup>
    <_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == ''">Linux</_derivedPackageTargetOSGroup>

    <_isSupportedOSGroup Condition="!$(SupportedPackageOSGroups.Contains(';$(_derivedPackageTargetOSGroup);'))">false</_isSupportedOSGroup>
  </PropertyGroup>

  <!-- _packageTargetOSGroup is used to control the runtime package imports, don't import runtime package targets for 
       an unsupported OS Group -->
  <PropertyGroup Condition="'$(PackageTargetRuntime)' != '' and '$(_isSupportedOSGroup)' == 'true'">
    <_packageTargetOSGroup>$(_derivedPackageTargetOSGroup)</_packageTargetOSGroup>
  </PropertyGroup>

  <PropertyGroup>
    <SkipPackageFileCheck>true</SkipPackageFileCheck>
    <OutputPath>$(PackageOutputPath)</OutputPath>
  </PropertyGroup>

  <PropertyGroup Condition="'$(IsLineupPackage)' == 'true'">
    <SkipValidatePackage>true</SkipValidatePackage>
    <IncludeRuntimeJson>true</IncludeRuntimeJson>
  </PropertyGroup>

  <Choose>
    <When Condition="'$(PackageRID)' != ''" />
    <When Condition="'$(_runtimeOSFamily)' == 'win'">
      <PropertyGroup>
        <RIDPlatform>win7</RIDPlatform>
        <RIDPlatform Condition="'$(ArchGroup)' == 'arm'">win8</RIDPlatform>
        <RIDPlatform Condition="'$(ArchGroup)' == 'arm64'">win10</RIDPlatform>
        
        <!-- Set the platform part of the RID if we are doing a portable build -->
        <RIDPlatform Condition="'$(PortableBuild)' == '1'">win</RIDPlatform>
        <PackageRID>$(RIDPlatform)-$(ArchGroup)</PackageRID>
      </PropertyGroup>
    </When>
    <When Condition="'$(_runtimeOSFamily)' == 'osx'">
      <PropertyGroup>
        <PackageRID>osx.10.12-$(ArchGroup)</PackageRID>
        <!-- Set the platform part of the RID if we are doing a portable build -->
        <PackageRID Condition="'$(PortableBuild)' == '1'">osx-$(ArchGroup)</PackageRID>
      </PropertyGroup>
    </When>
    <When Condition="'$(_runtimeOSFamily)' == 'rhel'">
      <PropertyGroup>
        <PackageRID>rhel.7-$(ArchGroup)</PackageRID>
        <!-- Set the platform part of the RID if we are doing a portable build -->
        <PackageRID Condition="'$(PortableBuild)' == '1'">linux-$(ArchGroup)</PackageRID>
      </PropertyGroup>
    </When>
    <Otherwise>
      <PropertyGroup>
        <PackageRID>$(RuntimeOS)-$(ArchGroup)</PackageRID>
        <!-- Set the platform part of the RID if we are doing a portable build -->
        <PackageRID Condition="'$(PortableBuild)' == '1'">linux-$(ArchGroup)</PackageRID>
      </PropertyGroup>
    </Otherwise>
  </Choose>

  <!-- Determine per-platform native binary extensions. -->
  <Choose>
    <When Condition="'$(_runtimeOSFamily)' == 'win'" />
    <When Condition="'$(_runtimeOSFamily)' == 'osx'">
      <PropertyGroup>
        <LibraryFileExtension>.dylib</LibraryFileExtension>
        <SymbolFileExtension>.dwarf</SymbolFileExtension>
      </PropertyGroup>
    </When>
    <Otherwise>
      <PropertyGroup>
        <LibraryFileExtension>.so</LibraryFileExtension>
        <SymbolFileExtension>.dbg</SymbolFileExtension>
      </PropertyGroup>
    </Otherwise>
  </Choose>

  <ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';Linux;'))">
    <OfficialBuildRID Include="alpine.3.4.3-x64" />
    <OfficialBuildRID Include="debian.8-armel">
      <Platform>armel</Platform>
    </OfficialBuildRID>
    <OfficialBuildRID Include="debian.8-x64" />
    <OfficialBuildRID Include="fedora.23-x64" />
    <OfficialBuildRID Include="fedora.24-x64" />
    <OfficialBuildRID Include="linux-x64" />
    <OfficialBuildRID Include="linux-arm">
      <Platform>arm</Platform>
    </OfficialBuildRID>
    <OfficialBuildRID Include="opensuse.42.1-x64" />
    <OfficialBuildRID Include="rhel.7-x64" />
    <OfficialBuildRID Include="tizen.4.0.0-armel">
      <Platform>armel</Platform>
    </OfficialBuildRID>
    <OfficialBuildRID Include="ubuntu.14.04-arm">
      <Platform>arm</Platform>
    </OfficialBuildRID>
    <OfficialBuildRID Include="ubuntu.14.04-x64" />
    <OfficialBuildRID Include="ubuntu.16.04-arm">
      <Platform>arm</Platform>
    </OfficialBuildRID>
    <OfficialBuildRID Include="ubuntu.16.04-x64" />
    <OfficialBuildRID Include="ubuntu.16.10-x64" />
  </ItemGroup>
  <ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';OSX;'))">
    <OfficialBuildRID Include="osx.10.12-x64" />
    <OfficialBuildRID Include="osx-x64" />
  </ItemGroup>
  <ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';Windows_NT;'))">
    <OfficialBuildRID Include="win7-x86">
      <Platform>x86</Platform>
    </OfficialBuildRID>
    <OfficialBuildRID Include="win-x86">
      <Platform>x86</Platform>
    </OfficialBuildRID>
    <OfficialBuildRID Include="win7-x64" />
    <OfficialBuildRID Include="win-x64" />
    <OfficialBuildRID Include="win8-arm">
      <Platform>arm</Platform>
    </OfficialBuildRID>
    <OfficialBuildRID Include="win10-arm64">
      <Platform>arm64</Platform>
    </OfficialBuildRID>
    <OfficialBuildRID Include="win-arm">
      <Platform>arm</Platform>
    </OfficialBuildRID>
    <OfficialBuildRID Include="win-arm64">
      <Platform>arm64</Platform>
    </OfficialBuildRID>
  </ItemGroup>
  <ItemGroup>
    <!-- Ensure we have a RID-specific package for the current build, even if it isn't in our official set, but 
         don't build the RID-specific package if we're in an unsupported os family -->
    <BuildRID Include="@(OfficialBuildRID)" Exclude="$(PackageRID)"/>
    <BuildRID Include="$(PackageRID)"
              Condition="'$(_isSupportedOSGroup)' == 'true'">
      <Platform Condition="'$(ArchGroup)' == 'x64'">amd64</Platform>
      <Platform Condition="'$(ArchGroup)' != 'x64'">$(ArchGroup)</Platform>
    </BuildRID>
  </ItemGroup>

  <ItemGroup>
    <_project Include="@(BuildRID)">
      <Platform Condition="'%(Platform)' == ''">amd64</Platform>
      <PackageTargetRuntime>%(Identity)</PackageTargetRuntime>
      <AdditionalProperties>PackageTargetRuntime=%(Identity);Platform=%(Platform)</AdditionalProperties>
    </_project>

    <_buildRidProjects Include="@(_project->'$(MSBuildProjectName).pkgproj')" />
    <!-- Only include rid projects for a builds file, not for a lineup package -->
    <Project Condition="'$(IsLineupPackage)' != 'true'" Include="@(_buildRidProjects)" />
  </ItemGroup>

  <ItemGroup Condition="'$(IsLineupPackage)' == 'true'">
    <!-- Include project references for a lineup package to generate the runtime.json file -->
    <ProjectReference Include="@(_buildRidProjects)" />
  </ItemGroup>
</Project>