-
Notifications
You must be signed in to change notification settings - Fork 117
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
60 lines (53 loc) · 3.24 KB
/
Directory.Build.props
File metadata and controls
60 lines (53 loc) · 3.24 KB
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
<Project>
<!-- See: https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build?view=vs-2019#directorybuildprops-and-directorybuildtargets -->
<!-- The top of the repo should not import Directory.Build.* above it's structure -->
<!-- At the root of the repo, it's best to only include repo-wide settings and defaults. -->
<PropertyGroup Label="Repository Paths">
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
<SrcPath>$([MSBuild]::NormalizeDirectory($(RepoRoot), 'src'))</SrcPath>
<!-- This file only exists during an official pipeline build -->
<PipelineVersionAssemblyInfoFilePath>$([MSBuild]::NormalizePath($(RepoRoot), '.version', 'PipelineAssemblyInfo.cs'))</PipelineVersionAssemblyInfoFilePath>
</PropertyGroup>
<PropertyGroup Label="Project defaults and output paths">
<!-- If not otherwise specified, the project is building for Debug.
This allows us to compose custom output paths based on configuration below.
-->
<Configuration>Debug</Configuration>
<!-- Signing defaults: -->
<AssemblyOriginatorKeyFile>$(RepoRoot)35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<!--
Enable Artifacts output layout (https://learn.microsoft.com/en-us/dotnet/core/sdk/artifacts-output)
Benefits of using this layout:
- we no longer own customizing output paths
- The default layout meets most needs that called for custom output paths to begin with
- can be customized further if needed
- folder paths are also much more consistent and predictable
- ArtifactsPivots folder name is normalized to lowercase, allowing for cross-platform compatibility
-->
<PropertyGroup Label="Artifacts output config">
<!-- Allow pipeline to override ArtifactsPath -->
<ArtifactsPath Condition="'$(ArtifactsPath)' == ''">$([MSBuild]::NormalizeDirectory($(RepoRoot), 'artifacts'))</ArtifactsPath>
</PropertyGroup>
<PropertyGroup Label="Nuget Config">
<RestorePackagesPath>$([MSBuild]::NormalizeDirectory($(RepoRoot), 'pkg'))</RestorePackagesPath>
<!-- <RestoreIgnoreFailedSource>true</RestoreIgnoreFailedSource> -->
<!-- <RestoreOutputPath>$(BaseIntermediateOutputPath)</RestoreOutputPath> -->
</PropertyGroup>
<PropertyGroup Label="Code Analysis config">
<!-- Without this, some code styling rules only execute in VS IDE, sometimes, only when the file is open -->
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
</PropertyGroup>
<!--
When building in VS IDE, we don't want to treat warnings as errors, because they randomize developer progress.
Warnings will be treated as errors at command line and in build pipelines
-->
<PropertyGroup Label="Code Analysis config for VS IDE"
Condition="'$(BuildingInsideVisualStudio)' == 'true'">
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors>
</PropertyGroup>
</Project>