-
Notifications
You must be signed in to change notification settings - Fork 22
/
directory.build.props
93 lines (80 loc) · 4.93 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
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
<BuildDir>$([MSBuild]::EnsureTrailingSlash($(RepoRoot)build))</BuildDir>
<BuildProps>$(BuildDir)build.props</BuildProps>
<VersionProps>$(RepoRoot)version.props</VersionProps>
<CommonProps>$(RepoRoot)common.props</CommonProps>
<MiscProps>$(RepoRoot)misc.props</MiscProps>
<SourceLinkProps>$(BuildDir)sourcelink.props</SourceLinkProps>
<DebugTargetProps>$(RepoRoot)debugtarget.props</DebugTargetProps>
<GenerateAssemblyInfoTargets>$(BuildDir)\Cadru.GenerateAssemblyInfo.targets</GenerateAssemblyInfoTargets>
<ReleaseNotesTargets>$(BuildDir)\Cadru.ReleaseNotes.targets</ReleaseNotesTargets>
</PropertyGroup>
<Import Project="$(DebugTargetProps)" Condition="Exists('$(DebugTargetProps)')"/>
<Import Project="$(BuildProps)" Condition="Exists('$(BuildProps)')"/>
<Import Project="$(VersionProps)" Condition="Exists('$(VersionProps)')"/>
<Import Project="$(CommonProps)" Condition="Exists('$(CommonProps)')"/>
<Import Project="$(MiscProps)" Condition="Exists('$(MiscProps)')"/>
<PropertyGroup>
<SharedPropsImported>true</SharedPropsImported>
</PropertyGroup>
<PropertyGroup>
<DebugType Condition="'$(SourceLinkCreate)' != 'true'">embedded</DebugType>
</PropertyGroup>
<PropertyGroup>
<!-- Add the default warnings to ignore if they aren't already there. -->
<NoWarn Condition="'$(NoWarn)' == ''">1701;1702</NoWarn>
<!-- NU5105: we're explicitly opting in to semver2 -->
<NoWarn>$(NoWarn);NU5105</NoWarn>
</PropertyGroup>
<!-- Define default values if any of these are blank. -->
<PropertyGroup>
<VersionMajor Condition="'$(VersionMajor)' == ''">1</VersionMajor>
<VersionMinor Condition="'$(VersionMinor)' == ''">0</VersionMinor>
<VersionPatch Condition="'$(VersionPatch)' == ''">0</VersionPatch>
</PropertyGroup>
<!-- Define the default $(VersionPrefix) format. The $(PackageVersion) is
also set here to prevent it from accidentally getting the $(VersionRevision)
value, allowing it to conform to SemVer 2.0 syntax.
-->
<PropertyGroup>
<VersionPrefix Condition="'$(VersionPrefix)' == ''">$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix>
<PackageVersion Condition="'$(PackageVersion)' == ''">$(VersionPrefix)</PackageVersion>
</PropertyGroup>
<!-- Add $(VersionRevision) to $(VersionPrefix) if they are both set. -->
<PropertyGroup Condition="'$(VersionPrefix)' != ''">
<VersionPrefix Condition="'$(VersionRevision)' != ''">$(VersionPrefix).$(VersionRevision)</VersionPrefix>
</PropertyGroup>
<!-- If $(VersionSuffix) isn't empty, then add $(VersionRevision) to it if
it isn't also empty. Add $(VersionSuffix) to the $(PackageVersion) and, if
it's set also add the $(SourceRevisionId). -->
<PropertyGroup Condition="'$(VersionSuffix)' != ''">
<VersionSuffix Condition="'$(VersionBuild)' != ''">$(VersionSuffix).$(VersionBuild)</VersionSuffix>
<VersionSuffix Condition="'$(VersionRevision)' != ''">$(VersionSuffix).$(VersionRevision)</VersionSuffix>
<PackageVersion>$(VersionPrefix)-$(VersionSuffix)</PackageVersion>
<PackageVersion Condition="'$(SourceRevisionId)' != ''">$(PackageVersion).$(SourceRevisionId)</PackageVersion>
</PropertyGroup>
<!-- The $(VersionPrefix) and $(VersionSuffix) rules here may seem odd, and
possibly redundant, but they're necessary in order to ensure the compiled
binary version is a proper 4-part version number, the product version is the
propert 4-part version number with the suffix, and possibly the
$(SourceRevisionId), appended, and that the package version is a proper
3-part version (SemVer 2.0 compliant format) with optionally the suffix. -->
<PropertyGroup Condition=" '$(Version)' == '' ">
<Version Condition=" '$(VersionSuffix)' != '' ">$(VersionPrefix)-$(VersionSuffix)</Version>
<Version Condition=" '$(VersionSuffix)' == '' ">$(VersionPrefix)</Version>
</PropertyGroup>
<!-- Adds the build date to the generated AssemblyInfo file, if the project
has the $(GenerateAssemblyInfo) property set to true. This indirectly hooks
in to the standard .NET SDK GenerateAssemblyInfo target by using the same
ItemGroup names that GetAssemblyAttributes uses. This allows us to insert
additional assembly attributes in to the set that's used. -->
<ItemGroup>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadata" Condition="'$(BuildDate)' != '' and '$(GenerateAssemblyBuildDateAttribute)' == 'true'">
<_Parameter1>BuildDate</_Parameter1>
<_Parameter2>$(BuildDate)</_Parameter2>
</AssemblyAttribute>
</ItemGroup>
<Import Project="$(SourceLinkProps)" Condition="Exists('$(SourceLinkProps)')"/>
</Project>