This repository was archived by the owner on Aug 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDirectory.Build.props
114 lines (95 loc) · 5.4 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
<!--
Directory.Build.props is imported very early in Microsoft.Common.props, and properties defined
later are unavailable to it. So, avoid referring to properties that are not yet defined (and
will evaluate to empty). In those cases, use the .targets files.
-->
<Project InitialTargets="CheckEnvironment">
<PropertyGroup>
<RootNamespace>$(MSBuildProjectName)</RootNamespace>
<TargetPlatformVersion>10.0.18362.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion>
<Platforms>x86;x64</Platforms>
<RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>
<RuntimeIdentifier>win-$(Platform)</RuntimeIdentifier>
<!-- Set the assembly name to the project name. -->
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
<AssemblyTitle>$(MSBuildProjectName)</AssemblyTitle>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
<!--
Keep an eye on this one. There was a warning coming from the WinUI Microsoft.UI.Xaml.Markup.Compiler.props that
"GenerateLibraryLayout is not needed for including Xaml files when the Pack target is ran" because it results in access
file copies. Upon further investigation I was not setting either of the bools GenerateLibraryLayout or
IncludeXamlFilesInNugetPackage that needed to be true for the warning to show. If you follow the directions and set
GenerateLibraryLayout to false, you will see errors regarding duplicate files. If you set
IncludeXamlFilesInNugetPackage to false it builds as expected without the warnings. I don't think the
IncludeXamlFilesInNugetPackage is needed unless we begin packaging the libs into NuGets, but this long comment
will remain in any file that sets this to false.
-->
<IncludeXamlFilesInNugetPackage>false</IncludeXamlFilesInNugetPackage>
</PropertyGroup>
<!--
This will assure that all binary files are placed at the root of the repository in a directory called artifacts. I like to
have easy access to all of the binaries for times when I need to assure everything is clobbered.
-->
<PropertyGroup>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<RepoRoot>$(MSBuildThisFileDirectory)\</RepoRoot>
<ArtifactsRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'artifacts'))</ArtifactsRoot>
<ArtifactsObjDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsRoot)', 'obj'))</ArtifactsObjDir>
<ArtifactsBinDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsRoot)', 'bin'))</ArtifactsBinDir>
<Platform Condition="'$(Platform)' == ''">x86</Platform>
<PlatformName Condition="'$(PlatformName)' == ''">$(Platform)</PlatformName>
<OutDirName Condition="'$(OutDirName)' == ''">$(MSBuildProjectName)</OutDirName>
<BaseOutputPath Condition="'$(BaseOutputPath)' == ''">$([System.IO.Path]::GetFullPath('$(ArtifactsBinDir)$(OutDirName)\'))</BaseOutputPath>
<OutputPath Condition="'$(PlatformName)' == 'AnyCPU'">$(BaseOutputPath)$(Configuration)\</OutputPath>
<OutputPath Condition="'$(PlatformName)' != 'AnyCPU'">$(BaseOutputPath)$(PlatformName)\$(Configuration)\</OutputPath>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)' == ''">$([System.IO.Path]::GetFullPath('$(ArtifactsObjDir)$(OutDirName)\'))</BaseIntermediateOutputPath>
<IntermediateOutputPath Condition="'$(PlatformName)' == 'AnyCPU'">$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath>
<IntermediateOutputPath Condition="'$(PlatformName)' != 'AnyCPU'">$(BaseIntermediateOutputPath)$(PlatformName)\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<PropertyGroup>
<!--
Keep the binary files out of the solution view
-->
<DefaultItemExcludes>$(DefaultItemExcludes);artifacts\**;obj\**;bin\**;lib\**;pdb\**</DefaultItemExcludes>
</PropertyGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)\.editorconfig" Link=".editorconfig" />
<None Include="$(MSBuildThisFileDirectory)\MIT.licenseheader" Link="MIT.licenseheader" />
</ItemGroup>
<PropertyGroup>
<!--I love Nullable.-->
<Nullable>enable</Nullable>
<!-- Warning level 4 displays all warnings. -->
<WarningLevel>4</WarningLevel>
<!--
CA131 do not catch general exception types.
-->
<NoWarn>$(NoWarn);CA1031</NoWarn>
<!--
CA1303 Put string resources into a table
-->
<NoWarn>$(NoWarn);CA1303</NoWarn>
<!--
CS8305 warns about using evaluation code such as CompositionShadow
-->
<NoWarn>$(NoWarn);CS8305</NoWarn>
<!--
Using nullable without #nullable being enabled will false alarm sometimes.
-->
<NoWarn>$(NoWarn);CS8632</NoWarn>
</PropertyGroup>
<!--
Both the Configuration and the ArtifactsRoot must be defined.
ArtifactsRoot is defined in the Directory.Build.props at the root of every
repo. However some projects in each repo may skip including that props file.
If they skip including the root props file but still include this one, they
will see errors unless they or another props file defines the ArtifactsRoot
and Configuration properties.
-->
<Target Name="CheckEnvironment">
<Error Text="Configuration is not defined. Use dotnet build '-c Debug' or '-c Release'." Condition=" '$(Configuration)' == '' " />
</Target>
</Project>