forked from dotnet/windowsdesktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Directory.Build.props
362 lines (318 loc) · 17.5 KB
/
Directory.Build.props
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
<Project>
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />
<!--
Get ProjectToBuild and '<subset>ProjectToBuild' items. Using the items lets projects handle
$(Subset) automatically when creating project-to-project dependencies.
-->
<Import Project="$(RepositoryEngineeringDir)Build.props" />
<!--
Before Microsoft.Common.targets, set the extensions path to match the restore dir as Arcade
sets it, so MSBuild packages with targets files will be found and imported.
-->
<PropertyGroup>
<MSBuildProjectExtensionsPath>$(BaseIntermediateOutputPath)</MSBuildProjectExtensionsPath>
</PropertyGroup>
<PropertyGroup>
<ArcadeSdkMSBuildProjectDir>$([System.IO.Path]::GetDirectoryName('$(ArcadeSdkBuildTasksAssembly)'))\..\</ArcadeSdkMSBuildProjectDir>
<ArcadeSdkSignProject>$(ArcadeSdkMSBuildProjectDir)Sign.proj</ArcadeSdkSignProject>
</PropertyGroup>
<PropertyGroup Condition="'$(MSBuildProjectExtension)' == '.csproj'">
<!-- SDK-based projects' Platform should default to AnyCPU, not $(TargetArchitecture) like Directory.Build.props sets. -->
<Platform>AnyCPU</Platform>
<UsingNETSdkCompiler>true</UsingNETSdkCompiler>
<DisableBuildToolsRoslynVersion>true</DisableBuildToolsRoslynVersion>
</PropertyGroup>
<PropertyGroup>
<!-- ProjectDir needs to be set for build-tools and legacy usages. New usages should use RepoRoot -->
<ProjectDir>$(RepoRoot)</ProjectDir>
<SourceDir>$(RepoRoot)src/</SourceDir>
<!-- Output directories -->
<BinDir Condition="'$(BinDir)'==''">$(ArtifactsBinDir)</BinDir>
<ObjDir Condition="'$(ObjDir)'==''">$(ArtifactsObjDir)</ObjDir>
<!-- Input Directories -->
<PackagesDir Condition="'$(PackagesDir)' == ''">$(NuGetPackageRoot)</PackagesDir>
<LocalBuildToolsDir>$(ObjDir)local-build-tasks\</LocalBuildToolsDir>
<LocalBuildToolsTaskDir>$(LocalBuildToolsDir)netstandard2.0\</LocalBuildToolsTaskDir>
<LocalBuildToolsTaskDir Condition="'$(MSBuildRuntimeType)' != 'Core'">$(LocalBuildToolsDir)net46\</LocalBuildToolsTaskDir>
<LocalBuildToolsTaskFile>$(LocalBuildToolsTaskDir)local.tasks.dll</LocalBuildToolsTaskFile>
</PropertyGroup>
<PropertyGroup>
<!--
This name is used to create a GIT repository URL https://github.com/dotnet/$(GitHubRepositoryName) used to find source code for debugging
It is also used to name the build output manifest for orchestrated builds.
-->
<GitHubRepositoryName Condition="'$(GitHubRepositoryName)' == ''">windowsdesktop</GitHubRepositoryName>
</PropertyGroup>
<!-- Build as portable by default -->
<PropertyGroup>
<PortableBuild Condition="'$(PortableBuild)' == ''">true</PortableBuild>
</PropertyGroup>
<PropertyGroup>
<SharedFrameworkName>Microsoft.WindowsDesktop.App</SharedFrameworkName>
<NETCoreAppFrameworkIdentifier>.NETCoreApp</NETCoreAppFrameworkIdentifier>
<NETCoreAppFrameworkMoniker>$(NETCoreAppFrameworkIdentifier),Version=v$(NETCoreAppFrameworkVersion)</NETCoreAppFrameworkMoniker>
<NETCoreAppFrameworkBrandName>.NET $(NETCoreAppFrameworkVersion)</NETCoreAppFrameworkBrandName>
</PropertyGroup>
<!-- Platform detection -->
<PropertyGroup>
<RunningOnUnix Condition="'$(OS)'!='Windows_NT'">true</RunningOnUnix>
<RunningOnCore Condition="'$(MSBuildRuntimeType)' == 'core'">true</RunningOnCore>
<HostRuntimeIdentifier Condition="'$(HostRuntimeIdentifier)' == '' and '$(RunningOnCore)' == 'true'">$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)</HostRuntimeIdentifier>
<HostRuntimeIdentifier Condition="'$(HostRuntimeIdentifier)' == '' and '$(RunningOnCore)' != 'true'">win-$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString().ToLowerInvariant)</HostRuntimeIdentifier>
</PropertyGroup>
<PropertyGroup>
<TargetArchitecture Condition="'$(TargetArchitecture)' == ''">x64</TargetArchitecture>
<Platform Condition="'$(Platform)'==''">$(TargetArchitecture)</Platform>
</PropertyGroup>
<!--
Projects that have no OS-specific implementations just use Debug and Release for $(Configuration).
Projects that do have OS-specific implementations use OS_Debug and OS_Release, for all OS's we support even
if the code is the same between some OS's (so if you have some project that just calls POSIX APIs, we still have
OSX_[Debug|Release] and Linux_[Debug|Release] configurations. We do this so that we place all the output under
a single binary folder and can have a similar experience between the command line and Visual Studio.
-->
<!--
If Configuration is empty that means we are not being built in VS and so folks need to explicitly pass the different
values for $(ConfigurationGroup) or $(OSGroup) or accept the defaults for them.
-->
<PropertyGroup>
<OSGroup Condition="'$(OS)'=='Unix' AND Exists('/Applications')">OSX</OSGroup>
<OSGroup Condition="'$(OSGroup)' == ''">$(OS)</OSGroup>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'==''">
<ConfigurationGroup Condition="'$(ConfigurationGroup)'==''">Debug</ConfigurationGroup>
<Configuration>$(ConfigurationGroup)</Configuration>
<Configuration>$(OSGroup)_$(Configuration)</Configuration>
</PropertyGroup>
<!--
If Configuration is set then someone explicitly passed it in or we building from VS. In either case
default $(ConfigurationGroup) or $(OSGroup) from the Configuration if they aren't
already explicitly set.
-->
<PropertyGroup Condition="'$(Configuration)'!=''">
<ConfigurationGroup Condition="'$(ConfigurationGroup)'=='' and $(Configuration.EndsWith('Debug'))">Debug</ConfigurationGroup>
<ConfigurationGroup Condition="'$(ConfigurationGroup)'=='' and $(Configuration.EndsWith('Release'))">Release</ConfigurationGroup>
<ConfigurationGroup Condition="'$(ConfigurationGroup)'==''">Debug</ConfigurationGroup>
<OSGroup Condition="'$(OSGroup)'=='' and $(Configuration.StartsWith('Windows'))">Windows_NT</OSGroup>
<OSGroup Condition="'$(OSGroup)'=='' and $(Configuration.StartsWith('Unix'))">Unix</OSGroup>
<OSGroup Condition="'$(OSGroup)'=='' and $(Configuration.StartsWith('Linux'))">Linux</OSGroup>
<OSGroup Condition="'$(OSGroup)'=='' and $(Configuration.StartsWith('OSX'))">OSX</OSGroup>
<OSGroup Condition="'$(OSGroup)'=='' and $(Configuration.StartsWith('FreeBSD'))">FreeBSD</OSGroup>
<OSGroup Condition="'$(OSGroup)'=='' and $(Configuration.StartsWith('NetBSD'))">NetBSD</OSGroup>
<OSGroup Condition="'$(OSGroup)'==''">AnyOS</OSGroup>
</PropertyGroup>
<PropertyGroup>
<DebugType Condition="'$(DebugType)' == ''">Portable</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(DisableSourceLink)' == 'true'">
<EnableSourceLink>false</EnableSourceLink>
<EnableSourceControlManagerQueries>false</EnableSourceControlManagerQueries>
<DeterministicSourcePaths>false</DeterministicSourcePaths>
<!-- Normally set by sourcelink, and needed by the Pack targets -->
<RepositoryUrl>https://github.com/dotnet/windowsdesktop</RepositoryUrl>
</PropertyGroup>
<!-- Set up Default symbol and optimization for Configuration -->
<Choose>
<When Condition="'$(ConfigurationGroup)'=='Debug'">
<PropertyGroup>
<DebugSymbols Condition="'$(DebugSymbols)' == ''">true</DebugSymbols>
<Optimize Condition="'$(Optimize)' == ''">false</Optimize>
<DefineConstants>$(DefineConstants),DEBUG,TRACE</DefineConstants>
</PropertyGroup>
</When>
<When Condition="'$(ConfigurationGroup)' == 'Release'">
<PropertyGroup>
<DebugSymbols Condition="'$(DebugSymbols)' == ''">true</DebugSymbols>
<Optimize Condition="'$(Optimize)' == ''">true</Optimize>
<DefineConstants>$(DefineConstants),TRACE</DefineConstants>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<ConfigurationErrorMsg>$(ConfigurationErrorMsg);Unknown ConfigurationGroup [$(ConfigurationGroup)] specificed in your project.</ConfigurationErrorMsg>
</PropertyGroup>
</Otherwise>
</Choose>
<PropertyGroup>
<ExeSuffix Condition="'$(OSGroup)'=='Windows_NT'">.exe</ExeSuffix>
</PropertyGroup>
<PropertyGroup Condition="'$(RuntimeIdentifier)' == '' and '$(HostRuntimeIdentifier)' != ''">
<RuntimeIdentifier>$(HostRuntimeIdentifier.Remove($(HostRuntimeIdentifier.LastIndexOf('-'))))-$(TargetArchitecture)</RuntimeIdentifier>
</PropertyGroup>
<!-- Portable -->
<PropertyGroup Condition="'$(PortableBuild)' == 'true'">
<RuntimeIdentifier Condition="'$(OSGroup)' == 'Windows_NT'">win-$(TargetArchitecture)</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(OSGroup)' == 'OSX'">osx-$(TargetArchitecture)</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(OSGroup)' == 'Linux' or '$(OSGroup)' == 'Unix'">linux-$(TargetArchitecture)</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(OSGroup)' == 'FreeBSD'">freebsd-$(TargetArchitecture)</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup>
<TestTargetRid Condition="'$(TestTargetRid)' == ''">$(RuntimeIdentifier)</TestTargetRid>
<InstallerRuntimeIdentifier Condition="'$(InstallerRuntimeIdentifier)' == ''">$(RuntimeIdentifier)</InstallerRuntimeIdentifier>
</PropertyGroup>
<!-- Produce assets into the specified blob feed. -->
<PropertyGroup Condition="'$(DotNetOutputBlobFeedDir)' != ''">
<AssetOutputPath>$(DotNetOutputBlobFeedDir)assets/</AssetOutputPath>
</PropertyGroup>
<!-- Set up the default output and intermediate paths -->
<PropertyGroup>
<OSPlatformConfig>$(RuntimeIdentifier).$(ConfigurationGroup)</OSPlatformConfig>
<BaseOutputRootPath>$(BinDir)$(OSPlatformConfig)\</BaseOutputRootPath>
<CrossGenRootPath>$(BaseOutputRootPath)crossgen\</CrossGenRootPath>
<IntermediateOutputRootPath Condition="'$(IntermediateOutputRootPath)' == ''">$(ObjDir)$(OSPlatformConfig)\</IntermediateOutputRootPath>
<PackagesBasePath Condition="'$(PackagesBasePath)'==''">$(BinDir)$(OSPlatformConfig)/</PackagesBasePath>
<PackageSymbolsBinDir Condition="'$(PackageSymbolsBinDir)' == ''">$(PackagesBasePath)symbols/</PackageSymbolsBinDir>
<AssetOutputPath Condition="'$(AssetOutputPath)'==''">$(ArtifactsShippingPackagesDir)</AssetOutputPath>
<SymbolPackageOutputPath Condition="'$(SymbolPackageOutputPath)'==''">$(ArtifactsShippingPackagesDir)</SymbolPackageOutputPath>
<!-- Use '/' instead of '\': used directly by WiX which doesn't accept trailing '\'. -->
<SharedFrameworkPublishDir>$(IntermediateOutputRootPath)sharedFrameworkPublish/</SharedFrameworkPublishDir>
<SharedFrameworkPublishSymbolsDir>$(IntermediateOutputRootPath)sharedFrameworkPublish.symbols\</SharedFrameworkPublishSymbolsDir>
</PropertyGroup>
<PropertyGroup>
<DisableCrossgen>false</DisableCrossgen>
<!-- Disable cross-gen on FreeBSD for now. This can be revisited when we have full support. -->
<DisableCrossgen Condition="'$(OSGroup)'=='FreeBSD'">true</DisableCrossgen>
<OutputVersionBadge>$(AssetOutputPath)sharedfx_$(RuntimeIdentifier)_$(ConfigurationGroup)_version_badge.svg</OutputVersionBadge>
</PropertyGroup>
<!-- Set up handling of build warnings -->
<PropertyGroup>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup>
<TargetsWindows>false</TargetsWindows>
<TargetsOSX>false</TargetsOSX>
<TargetsLinux>false</TargetsLinux>
<TargetsUnix>false</TargetsUnix>
<TargetsUbuntu>false</TargetsUbuntu>
<TargetsLinuxMint>false</TargetsLinuxMint>
<TargetsDebian>false</TargetsDebian>
<TargetsRhel>false</TargetsRhel>
<TargetsOpensuse>false</TargetsOpensuse>
<TargetsFedora>false</TargetsFedora>
<TargetsCentos>false</TargetsCentos>
<TargetsOracle>false</TargetsOracle>
<TargetsSles>false</TargetsSles>
</PropertyGroup>
<Choose>
<When Condition="$(RuntimeIdentifier.StartsWith('win'))">
<PropertyGroup>
<TargetsWindows>true</TargetsWindows>
</PropertyGroup>
</When>
<When Condition="$(RuntimeIdentifier.StartsWith('osx'))">
<PropertyGroup>
<TargetsOSX>true</TargetsOSX>
<TargetsUnix>true</TargetsUnix>
</PropertyGroup>
</When>
<When Condition="$(RuntimeIdentifier.StartsWith('debian'))">
<PropertyGroup>
<TargetsDebian>true</TargetsDebian>
<TargetsLinux>true</TargetsLinux>
<TargetsUnix>true</TargetsUnix>
</PropertyGroup>
</When>
<When Condition="$(RuntimeIdentifier.StartsWith('ubuntu'))">
<PropertyGroup>
<TargetsUbuntu>true</TargetsUbuntu>
<TargetsLinux>true</TargetsLinux>
<TargetsUnix>true</TargetsUnix>
</PropertyGroup>
</When>
<When Condition="$(RuntimeIdentifier.StartsWith('linuxmint'))">
<PropertyGroup>
<TargetsLinuxMint>true</TargetsLinuxMint>
<TargetsLinux>true</TargetsLinux>
<TargetsUnix>true</TargetsUnix>
</PropertyGroup>
</When>
<When Condition="$(RuntimeIdentifier.StartsWith('rhel'))">
<PropertyGroup>
<TargetsRhel>true</TargetsRhel>
<TargetsLinux>true</TargetsLinux>
<TargetsUnix>true</TargetsUnix>
</PropertyGroup>
</When>
<When Condition="$(RuntimeIdentifier.StartsWith('centos'))">
<PropertyGroup>
<TargetsCentos>true</TargetsCentos>
<TargetsLinux>true</TargetsLinux>
<TargetsUnix>true</TargetsUnix>
</PropertyGroup>
</When>
<When Condition="$(RuntimeIdentifier.StartsWith('opensuse'))">
<PropertyGroup>
<TargetsOpensuse>true</TargetsOpensuse>
<TargetsLinux>true</TargetsLinux>
<TargetsUnix>true</TargetsUnix>
</PropertyGroup>
</When>
<When Condition="$(RuntimeIdentifier.StartsWith('fedora'))">
<PropertyGroup>
<TargetsFedora>true</TargetsFedora>
<TargetsLinux>true</TargetsLinux>
<TargetsUnix>true</TargetsUnix>
</PropertyGroup>
</When>
<When Condition="$(RuntimeIdentifier.StartsWith('oracle'))">
<PropertyGroup>
<TargetsOracle>true</TargetsOracle>
<TargetsLinux>true</TargetsLinux>
<TargetsUnix>true</TargetsUnix>
</PropertyGroup>
</When>
<When Condition="$(RuntimeIdentifier.StartsWith('sles'))">
<PropertyGroup>
<TargetsSles>true</TargetsSles>
<TargetsLinux>true</TargetsLinux>
<TargetsUnix>true</TargetsUnix>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetsLinux>true</TargetsLinux>
<TargetsUnix>true</TargetsUnix>
</PropertyGroup>
</Otherwise>
</Choose>
<PropertyGroup>
<CompressedFileExtension Condition="'$(OSGroup)' == 'Windows_NT'">.zip</CompressedFileExtension>
<CompressedFileExtension Condition="'$(OSGroup)' != 'Windows_NT'">.tar.gz</CompressedFileExtension>
<InstallerExtension Condition="'$(OSGroup)' == 'Windows_NT'">.msi</InstallerExtension>
<InstallerExtension Condition="'$(OSGroup)' == 'OSX'">.pkg</InstallerExtension>
<InstallerExtension Condition="'$(TargetsDebian)' == 'true' or '$(TargetsUbuntu)' == 'true' or '$(TargetsLinuxMint)' == 'true'">.deb</InstallerExtension>
<InstallerExtension Condition="'$(TargetsRhel)' == 'true' or '$(TargetsCentos)' == 'true' or '$(TargetsOpensuse)' == 'true' or '$(TargetsFedora)' == 'true' or '$(TargetsOracle)' == 'true' or '$(TargetsSles)' == 'true'">.rpm</InstallerExtension>
<CombinedInstallerExtension Condition="'$(OSGroup)' == 'Windows_NT'">.exe</CombinedInstallerExtension>
<CombinedInstallerExtension Condition="'$(OSGroup)' != 'Windows_NT'">$(InstallerExtension)</CombinedInstallerExtension>
</PropertyGroup>
<!-- Use actual publishable (non-dummy) package name produced by the build system for this RID -->
<PropertyGroup Condition="'$(RuntimeIdentifier)' != ''">
<PackageTargetRid>$(RuntimeIdentifier)</PackageTargetRid>
<PackageTargetRid Condition="'$(RuntimeIdentifier)' == 'osx.10.11-x64'">osx.10.10-x64</PackageTargetRid>
<PackageTargetRid Condition="$(RuntimeIdentifier.StartsWith('rhel.7.')) and $(RuntimeIdentifier.EndsWith('-x64'))">rhel.7-x64</PackageTargetRid>
</PropertyGroup>
<PropertyGroup Condition="'$(UsingNETSdkCompiler)' != 'true'">
<!-- Disable some standard properties for building our projects -->
<NoStdLib>true</NoStdLib>
<NoExplicitReferenceToStdLib>true</NoExplicitReferenceToStdLib>
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
<!-- We don't use any of MSBuild's resolution logic for resolving the framework, so just set these two properties to any folder that exists to skip
the GenerateReferenceAssemblyPaths task (not target) and to prevent it from outputting a warning (MSB3644). -->
<_TargetFrameworkDirectories>$(MSBuildThisFileDirectory)documentation</_TargetFrameworkDirectories>
<_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)documentation</_FullFrameworkReferenceAssemblyPaths>
<!-- We do not want to target a portable profile.
TODO: Make this the default in buildtools so this is not necessary. -->
<TargetFrameworkProfile></TargetFrameworkProfile>
<!-- We set this property to avoid MSBuild errors regarding not setting TargetFrameworkProfile (see above line) -->
<PortableNuGetMode>true</PortableNuGetMode>
</PropertyGroup>
<PropertyGroup>
<!-- Never use the NuGet fallback folder that comes with the SDK we use to build.
The NuGet fallback folder can/will contain packages we are building in this repo, and we
want to ensure we use the correct packages.
-->
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
</PropertyGroup>
</Project>