forked from DavidMoore/ipfilter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Directory.Build.props
114 lines (101 loc) · 7.21 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
<Project>
<!-- Versioning -->
<PropertyGroup Condition="'$(BuildNumber)'!=''">
<BuildNumberRegex>v?(\d+)\.(\d+)\.(\d+)\.(\d+)-?(\w+)?</BuildNumberRegex>
<MajorVersion>$([System.Text.RegularExpressions.Regex]::Replace('$(BuildNumber)',$(BuildNumberRegex), '$1'))</MajorVersion>
<MinorVersion>$([System.Text.RegularExpressions.Regex]::Replace('$(BuildNumber)',$(BuildNumberRegex), '$2'))</MinorVersion>
<BuildNumberMajor>$([System.Text.RegularExpressions.Regex]::Replace('$(BuildNumber)',$(BuildNumberRegex), '$3'))</BuildNumberMajor>
<BuildNumberMinor>$([System.Text.RegularExpressions.Regex]::Replace('$(BuildNumber)',$(BuildNumberRegex), '$4'))</BuildNumberMinor>
<TagVersion>$([System.Text.RegularExpressions.Regex]::Replace('$(BuildNumber)',$(BuildNumberRegex), '$5'))</TagVersion>
</PropertyGroup>
<PropertyGroup>
<MajorVersion Condition="'$(MajorVersion)' == ''">3</MajorVersion>
<MinorVersion Condition="'$(MinorVersion)' == ''">0</MinorVersion>
<BuildNumberMajor Condition="'$(BuildNumberMajor)' == ''">2</BuildNumberMajor>
<BuildNumberMinor Condition="'$(BuildNumberMinor)' == ''">0</BuildNumberMinor>
<AssemblyVersion Condition="'$(AssemblyVersion)' == ''">$(MajorVersion).$(MinorVersion).0.0</AssemblyVersion>
<InformationalVersion Condition="'$(InformationalVersion)' == '' and '$(TagVersion)' != ''">$(MajorVersion).$(MinorVersion).$(BuildNumberMajor).$(BuildNumberMinor)-$(TagVersion)</InformationalVersion>
<InformationalVersion Condition="'$(InformationalVersion)' == ''">$(MajorVersion).$(MinorVersion).$(BuildNumberMajor).$(BuildNumberMinor)</InformationalVersion>
</PropertyGroup>
<!-- Branding and file properties -->
<PropertyGroup>
<TodayTimeStamp>$([System.DateTime]::Now.ToString(yyyyMMdd))</TodayTimeStamp>
<Company Condition="'$(Company)' == ''">David Moore</Company>
<Copyright Condition="'$(Copyright)' == ''">%A9 $(Company) $([System.DateTime]::Now.ToString(yyyy))</Copyright>
<Product Condition="'$(Product)' == ''">IPFilter</Product>
<AssemblyTitle Condition="'$(AssemblyTitle)' == ''">$(AssemblyName)</AssemblyTitle>
<Description Condition="'$(Description)' == ''">$(AssemblyName)</Description>
<FileVersion Condition="'$(FileVersion)' == ''">$(MajorVersion).$(MinorVersion).$(BuildNumberMajor).$(BuildNumberMinor)</FileVersion>
</PropertyGroup>
<!-- Project type detection -->
<PropertyGroup>
<IsTestProject Condition="'$(IsTestProject)'=='' And ($(MSBuildProjectFullPath.Contains('\tests\')) OR $(MSBuildProjectFullPath.Contains('/tests/')))">true</IsTestProject>
<IsPerformanceTestProject Condition="'$(IsPerformanceTestProject)' == '' AND '$(IsTestProject)' == 'true' AND $(MSBuildProjectName.EndsWith('Performance.Tests'))">true</IsPerformanceTestProject>
</PropertyGroup>
<!-- Build configuration -->
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
</PropertyGroup>
<!-- Build configuration specifics -->
<Choose>
<When Condition="'$(Configuration)'=='Debug'">
<PropertyGroup>
<DebugSymbols Condition="'$(DebugSymbols)' == ''">true</DebugSymbols>
<Optimize Condition="'$(Optimize)' == ''">false</Optimize>
<DebugType Condition="'$(DebugType)' == ''">full</DebugType>
<DefineConstants>$(DefineConstants),DEBUG,TRACE</DefineConstants>
</PropertyGroup>
</When>
<When Condition="'$(Configuration)' == 'Release'">
<PropertyGroup>
<DebugSymbols Condition="'$(DebugSymbols)' == ''">true</DebugSymbols>
<Optimize Condition="'$(Optimize)' == ''">true</Optimize>
<DebugType Condition="'$(DebugType)' == ''">pdbonly</DebugType>
<DefineConstants>$(DefineConstants),TRACE</DefineConstants>
</PropertyGroup>
</When>
</Choose>
<!-- Language configuration -->
<PropertyGroup>
<!-- default to allowing all language features -->
<LangVersion>latest</LangVersion>
<LangVersion Condition="'$(Language)' == 'C#'">preview</LangVersion>
<!-- Enables Strict mode for Roslyn compiler -->
<Features>strict</Features>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<Deterministic>true</Deterministic>
<CLSCompliant Condition="'$(CLSCompliant)'=='' and '$(IsTestProject)'=='true'">false</CLSCompliant>
<CLSCompliant Condition="'$(CLSCompliant)'==''">true</CLSCompliant>
</PropertyGroup>
<!-- Signing -->
<PropertyGroup>
<SignAuthenticode Condition="'$(SignAuthenticode)' == '' and '$(Configuration)' == 'Release'">true</SignAuthenticode>
<SignAuthenticode Condition="'$(SignAuthenticode)' == ''">false</SignAuthenticode>
<SignAuthenticodeThumbprint Condition="'$(SignAuthenticodeThumbprint)' == ''">8d72fc3e61f4653dfd192baea0708186f05b163b</SignAuthenticodeThumbprint>
<SignAuthenticodeTimestamp Condition="'$(SignAuthenticodeTimestamp)' == ''">http://timestamp.digicert.com</SignAuthenticodeTimestamp>
<SignAuthenticodeEchoOff Condition="'$(SignAuthenticodeEchoOff)' == ''">true</SignAuthenticodeEchoOff>
<SignOutput Condition="'$(SignOutput)' == '' and '$(SignAuthenticode)' == 'true'">true</SignOutput>
</PropertyGroup>
<PropertyGroup>
<!-- We should be able to use the ClickOnce signing tool -->
<SignToolPath>$([MSBuild]::GetRegistryValueFromView(`HKEY_LOCAL_MACHINE\Software\Microsoft\ClickOnce\SignTool`, `Path`, null, RegistryView.Registry32, RegistryView.Default))signtool.exe</SignToolPath>
<!-- Baseline signing arguments -->
<SignToolArguments>sign /fd sha256 /t "$(SignAuthenticodeTimestamp)"</SignToolArguments>
<!-- Sign using user store certificate identified by thumbprint, if path to key file wasn't specified -->
<SignToolArguments Condition="'$(SignAuthenticodeCertificate)' != ''" >$(SignToolArguments) /f "$(SignAuthenticodeCertificate)" /p "$(SignAuthenticodePassword)"</SignToolArguments>
<!-- Sign using key file if specified -->
<SignToolArguments Condition="'$(SignAuthenticodeCertificate)' == ''">$(SignToolArguments) /sha1 $(SignAuthenticodeThumbprint)</SignToolArguments>
</PropertyGroup>
<!-- Windows SDK -->
<PropertyGroup>
<!-- Detect host machine bitness (X86, X64, Arm, Arm64) -->
<OperatingSystemPlatform>$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)</OperatingSystemPlatform>
<WindowsSdkDir Condition=" '$(WindowsSdkRootDir)' == ''">$([MSBuild]::GetRegistryValueFromView(`HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SDKs\Windows\v10.0`, `InstallationFolder`, null, RegistryView.Registry32, RegistryView.Default))</WindowsSdkDir>
<WindowsSdkVersion Condition=" '$(WindowsSdkVersion)' == ''">$([MSBuild]::GetRegistryValueFromView(`HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SDKs\Windows\v10.0`, `ProductVersion`, null, RegistryView.Registry32, RegistryView.Default))</WindowsSdkVersion>
<!-- If the SDK version doesn't end with ".0" then tag it onto the end. -->
<WindowsSdkVersion Condition="'$(WindowsSdkVersion)' != '' AND !$(WindowsSdkVersion.EndsWith('.0'))">$(WindowsSdkVersion).0</WindowsSdkVersion>
<WindowsSdkRootDir>$(WindowsSdkDir)bin\$(WindowsSdkVersion)\$(OperatingSystemPlatform)\</WindowsSdkRootDir>
</PropertyGroup>
</Project>