forked from UbiquityDotNET/CSemVer.GitBuild
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
94 lines (86 loc) · 6.57 KB
/
Directory.Build.props
File metadata and controls
94 lines (86 loc) · 6.57 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
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
<Project>
<PropertyGroup>
<GeneratedVersionProps>$(MSBuildThisFileDirectory)GeneratedVersion.props</GeneratedVersionProps>
</PropertyGroup>
<!--
Import the generated version information for this build; Projects in this repo cannot use themselves
to generate the version information. Tests VALIDATE that the actual built packages do contain
expected values though so the duplication of computing the versioning is verified to produce the same
results, at least for the packages tested. The existence is tested again in the targets file and reported
as an error if not present.
-->
<Import Condition="Exists('$(GeneratedVersionProps)')" Project="$(GeneratedVersionProps)" />
<!--
Description:
This property file is imported by the projects in this repository to set global locations
common to all of the projects for a consistent build.
-->
<!--
Allow for a parent to provide/override the defaults provided here
Projects importing this property sheet can still override those settings.
Implementation Note:
ALL properties defined here should be done conditionally to allow inheriting from
a parent. Conditional properties makes this project a well behaved sub module for
other projects that might want to set the build outputs etc... into a different place.
-->
<PropertyGroup>
<!-- Default to x64/AnyCPU | Release build if not otherwise specified -->
<Platform Condition="'$(Platform)'=='' AND '$(MSBuildProjectExtension)'!='.vcxproj'">AnyCPU</Platform>
<Platform Condition="'$(Platform)'=='' AND '$(MSBuildProjectExtension)'=='.vcxproj'">x64</Platform>
<Platform Condition="$(Platform)=='x86' AND '$(MSBuildProjectExtension)'=='.vcxproj'">Win32</Platform>
<UnifiedPlatformPathName Condition="'$(UnifiedPlatformPathName)'==''">$(Platform)</UnifiedPlatformPathName>
<UnifiedPlatformPathName Condition="'$(UnifiedPlatformPathName)'=='Win32'">x86</UnifiedPlatformPathName>
<UnifiedPlatformPathName Condition="'$(UnifiedPlatformPathName)'=='AnyCPU'">x64</UnifiedPlatformPathName>
<Configuration Condition="'$(Configuration)'==''">Release</Configuration>
<!-- Use the location of this file (at the top of the build tree) to define the root directory, if not already set -->
<BuildRootDir Condition="'$(BuildRootDir)'==''">$(MSBuildThisFileDirectory)</BuildRootDir>
<BuildRootDir>$([MSBuild]::EnsureTrailingSlash("$(BuildRootDir)"))</BuildRootDir>
<!-- Put build output and intermediate output files into a well known location outside of the source tree -->
<BaseBuildOutputPath Condition="'$(BaseBuildOutputPath)'==''">$([MSBuild]::NormalizeDirectory("$(BuildRootDir)", "BuildOutput"))</BaseBuildOutputPath>
<BaseBuildOutputPath>$([MSBuild]::EnsureTrailingSlash("$(BaseBuildOutputPath)"))</BaseBuildOutputPath>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'==''" >$([MSBuild]::NormalizeDirectory("$(BaseBuildOutputPath)", "Intermediate", "$(MSBuildProjectName)"))</BaseIntermediateOutputPath>
<IntDir Condition="'$(IntDir)'==''">$([MSBuild]::NormalizeDirectory("$(BaseIntermediateOutputPath)", "$(UnifiedPlatformPathName)", "$(Configuration)"))</IntDir>
<BaseBuildOutputBinPath Condition="'$(BaseBuildOutputBinPath)'==''">$([MSBuild]::NormalizeDirectory("$(BaseBuildOutputPath)", "bin"))</BaseBuildOutputBinPath>
<BaseOutputPath Condition="'$(BaseOutputPath)'==''">$([MSBuild]::NormalizeDirectory("$(BaseBuildOutputBinPath)", "$(MSBuildProjectName)"))</BaseOutputPath>
<PackageOutputPath Condition="'$(PackageOutputPath)'==''">$([MSBuild]::NormalizeDirectory("$(BaseBuildOutputPath)","NuGet"))</PackageOutputPath>
<BuildOutputPackagesDir Condition="'$(BuildOutputPackagesDir)'==''">$(BaseBuildOutputPath)packages\</BuildOutputPackagesDir>
<BuildVersionXml Condition="'$(BuildVersionXmlFile)'==''">$(MSBuildThisFileDirectory)BuildVersion.xml</BuildVersionXml>
<IsAutomatedBuild Condition="'$(IsAutomatedBuild)'==''">false</IsAutomatedBuild>
<IsPullRequestBuild Condition="'$(IsPullRequestBuild)'==''">false</IsPullRequestBuild>
<IsReleaseBuild Condition="'$(IsReleaseBuild)'==''">false</IsReleaseBuild>
<BuildTime Condition="'$(BuildTime)'=='' AND '$(APPVEYOR_REPO_COMMIT_TIMESTAMP)'!=''">$(APPVEYOR_REPO_COMMIT_TIMESTAMP)</BuildTime>
<!-- Disable defaulted, and sadly OPT-OUT, addition of GIT build Metadata to the informational version -->
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
</PropertyGroup>
<Choose>
<!-- Apply standard properties for all C# projects -->
<When Condition="'$(MSBuildProjectExtension)'=='.csproj' and '$(DisableDirProps)'!='true'">
<PropertyGroup>
<CodeAnalysisIgnoreGeneratedCode>true</CodeAnalysisIgnoreGeneratedCode>
<Determenistic>true</Determenistic>
<Nullable>enable</Nullable>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<UseStyleCop>true</UseStyleCop>
<!--
DO NOT ALLOW Implicit using msbuild feature - EVIL; causes mass issues and frustration moving code between projects when one doesn't
support it or uses a different framework version. Not to mention hiding the actual namespaces involved, making resolving conflicts HARDER.
-->
<ImplicitUsings>disable</ImplicitUsings>
<!-- NOTE: Top-Level statements blocked as an error in .editorconfig and ImplicitUsings 'feature' VERIFIED in the targets file -->
</PropertyGroup>
<ItemGroup Condition="'$(UseStyleCop)'=='true'">
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" />
</ItemGroup>
</When>
<When Condition="'$(MSBuildProjectExtension)'=='.vcxproj'">
<!-- vcxproj uses a different pattern for output paths -->
<PropertyGroup>
<UseStyleCop>false</UseStyleCop>
<OutputPath Condition="'$(OutputPath)'==''">$([MSBuild]::NormalizeDirectory("$(BaseOutputPath)", "$(Configuration)", "$(UnifiedPlatformPathName)"))</OutputPath>
<OutputPath>$([MSBuild]::EnsureTrailingSlash("$(OutputPath)"))</OutputPath>
<OutDir Condition="'$(OutDir)'==''">$(OutputPath)</OutDir>
</PropertyGroup>
</When>
</Choose>
</Project>