-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
113 lines (93 loc) · 5.4 KB
/
Directory.Build.props
File metadata and controls
113 lines (93 loc) · 5.4 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<Project>
<!-- Global settings -->
<PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<BuildMajor>1</BuildMajor>
<BuildMinor>2</BuildMinor>
<BuildRelease>$([System.DateTime]::Now.ToString("yy"))$([System.String]::Format("{0:000}",$([System.DateTime]::Now.DayOfYear)))</BuildRelease>
<SecondsByMinute>$([MSBuild]::Multiply($([System.DateTime]::Now.Minute), 60))</SecondsByMinute>
<SecondsByHour>$([MSBuild]::Multiply($([System.DateTime]::Now.Hour), 3600))</SecondsByHour>
<SecondsByDay>$([MSBuild]::Add($([MSBuild]::Add($([System.DateTime]::Now.Second),$(SecondsByMinute))), $(SecondsByHour)))</SecondsByDay>
<Build>$([System.Math]::Floor($([MSBuild]::Divide($(SecondsByDay), 2))))</Build>
<IsWindows Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">true</IsWindows>
<IsOSX Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">true</IsOSX>
<IsLinux Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">true</IsLinux>
<IsLinuxOrOSX Condition="'$(IsLinux)' == 'true' Or '$(IsOSX)' == 'true'"/>
<DefineConstants Condition="'$(IsWindows)' == 'true'">$(DefineConstants);Is_WINDOWS</DefineConstants>
<DefineConstants Condition="'$(IsLinux)' == 'true'">$(DefineConstants);Is_OSX_or_LINUX;Is_LINUX</DefineConstants>
<DefineConstants Condition="'$(IsOSX)' == 'true'">$(DefineConstants);Is_OSX_or_LINUX;Is_OSX</DefineConstants>
<TargetFramework>net8.0</TargetFramework>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<NugetLocalRepository/>
<ArtifactFolder/>
</PropertyGroup>
<!-- Specific environments -->
<PropertyGroup Condition="'$(IsWindows)' == 'true'">
<UserHome>$(UserProfile)</UserHome>
</PropertyGroup>
<PropertyGroup Condition="'$(IsLinuxOrOSX)' == 'true'">
<UserHome>$(HOME)</UserHome>
</PropertyGroup>
<!-- Global configuration settings -->
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<IsPackable>true</IsPackable>
<BuildQualifier/>
<IncludeSymbols>false</IncludeSymbols>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<IsPackable>false</IsPackable>
<BuildQualifier>-Debug</BuildQualifier>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<IncludeSymbols>true</IncludeSymbols>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Dev' ">
<IsPackable>true</IsPackable>
<BuildQualifier>-Dev</BuildQualifier>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<IncludeSymbols>true</IncludeSymbols>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Test' ">
<IsPackable>false</IsPackable>
<BuildQualifier/>
<IncludeSymbols>false</IncludeSymbols>
</PropertyGroup>
<!-- Global build properties -->
<PropertyGroup>
<ReleaseVersion>$(BuildMajor).$(BuildMinor).$(BuildRelease).$(Build)</ReleaseVersion>
<BuildVersion>$(BuildMajor).$(BuildMinor).$(BuildRelease)$(BuildQualifier).$(Build)</BuildVersion>
</PropertyGroup>
<PropertyGroup>
<AssemblyFileVersionAttribute>[assembly:System.Reflection.AssemblyVersionAttribute("$(ReleaseVersion)")];</AssemblyFileVersionAttribute>
<AssemblyVersion>$(ReleaseVersion)</AssemblyVersion>
<FileVersion>$(ReleaseVersion)</FileVersion>
<Version>$(BuildVersion)</Version>
<Authors>Bernold Kraft</Authors>
<Company>Bitub</Company>
<Copyright>Bernold Kraft</Copyright>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://www.github.com/bekraft/BitubTRex</PackageProjectUrl>
</PropertyGroup>
<Target Name="GitDescribe" BeforeTargets="InitializeSourceControlInformation" Condition="'$(Configuration)' != 'Release'">
<Exec Command="git describe --long --always --exclude=* --abbrev=8" ConsoleToMsBuild="True" IgnoreExitCode="False">
<Output PropertyName="GitShortHash" TaskParameter="ConsoleOutput"/>
</Exec>
<Message Text="===> Start building using $(TargetFramework)" Importance="high" />
<Message Text=" Building version : $(BuildVersion)" Importance="High" />
<Message Text=" Building definitions : $(DefineConstants)" Importance="High" />
<Message Text=" GitShortHash : $(GitShortHash)" Importance="High" />
<PropertyGroup>
<BuildVersion>$(BuildMajor).$(BuildMinor).$(BuildRelease)$(BuildQualifier)$(GitShortHash).$(Build)</BuildVersion>
<AssemblyFileVersionAttribute>[assembly:System.Reflection.AssemblyVersionAttribute("$(BuildVersion)")];</AssemblyFileVersionAttribute>
<PackageVersion>$(BuildVersion)</PackageVersion>
<Version>$(BuildVersion)</Version>
</PropertyGroup>
</Target>
<Target Name="CopyPgksToCacheFolder" AfterTargets="Pack" Condition="'$(ArtifactFolder)' != ''">
<ItemGroup>
<SourceNuPkgs Include="$(OutputPath)*.nupkg;$(OutputPath)*.snupkg" />
</ItemGroup>
<Message Importance="High" Text="Started deploying `@(SourceNuPkgs)` from $(OutputPath) to artifact folder at `$(ArtifactFolder)`." Condition="'@(SourceNuPkgs)' != ''"/>
<Copy SourceFiles="@(SourceNuPkgs)" DestinationFolder="$(ArtifactFolder)" />
<Delete Files="@(SourceNuPkgs)" />
</Target>
</Project>