-
Notifications
You must be signed in to change notification settings - Fork 57
/
Directory.Build.props
95 lines (86 loc) · 4.85 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
<Project>
<!-- Set common properties regarding assembly information and nuget packages -->
<PropertyGroup>
<TimeWarpStateVersion>11.0.0</TimeWarpStateVersion>
<Authors>Steven T. Cramer</Authors>
<Product>TimeWarp State</Product>
<PackageVersion>$(TimeWarpStateVersion)</PackageVersion>
<PackageProjectUrl>https://timewarpengineering.github.io/timewarp-state/</PackageProjectUrl>
<PackageTags>TimeWarp.State; TimeWarp-State; TimeWarpState; BlazorState; Blazor; State; Blazor-State; MediatR; Mediator; Pipeline; Redux; Flux</PackageTags>
<PackageIcon>Logo.png</PackageIcon>
<RepositoryUrl>https://github.com/TimeWarpEngineering/timewarp-state.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageLicenseExpression>Unlicense</PackageLicenseExpression>
<PackageReleaseNotes>https://timewarpengineering.github.io/timewarp-state/Overview.html</PackageReleaseNotes>
<PackageReadmeFile>README.md</PackageReadmeFile>
<ContentTargetFolders>contentFiles</ContentTargetFolders>
</PropertyGroup>
<!-- Deterministic Builds https://devblogs.microsoft.com/dotnet/producing-packages-with-source-link/#deterministic-builds -->
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
<!-- Common compile parameters -->
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>latest</LangVersion>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<NoWarn>CS7035;NU1503;1503</NoWarn>
<Nullable>disable</Nullable>
<TargetFramework>net8.0</TargetFramework>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup>
<!-- https://devblogs.microsoft.com/nuget/enable-repeatable-package-restores-using-a-lock-file/ supports caching of nugets in CI builds -->
<PropertyGroup>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<RestoreLockedMode Condition="'$(ContinuousIntegrationBuild)' == 'true'">true</RestoreLockedMode>
</PropertyGroup>
<!-- Source Link see https://github.com/dotnet/sourcelink/blob/master/README.md -->
<PropertyGroup>
<!-- Optional: Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<!-- Optional: Embed source files that are not tracked by the source control manager in the PDB -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<!-- Optional: Build symbol package (.snupkg) to distribute the PDB containing Source Link -->
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<DebugType>portable</DebugType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All"/>
</ItemGroup>
<!-- End Source Link -->
<!--This is to add the CommitDate and CommitHash to your assemblyinfo -->
<Target Name="SetAssemblyMetaData" BeforeTargets="PreBuildEvent" >
<Exec Command="git log -1 --format=%%ct" ConsoleToMSBuild="true" Condition="'$(OS)' == 'Windows_NT'">
<Output TaskParameter="ConsoleOutput" PropertyName="GitCommitTimestamp"/>
</Exec>
<Exec Command="git log -1 --format=%ct" ConsoleToMSBuild="true" Condition="'$(OS)' != 'Windows_NT'">
<Output TaskParameter="ConsoleOutput" PropertyName="GitCommitTimestamp"/>
</Exec>
<Exec Command="pwsh -ExecutionPolicy Bypass -NoProfile -File "$(MSBuildThisFileDirectory)ConvertTimestamp.ps1" -GitCommitTimestamp $(GitCommitTimestamp)" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="CommitDate"/>
</Exec>
<PropertyGroup>
<!-- In Visual Studio the below line crashes if they fix VS then we can use this and no need for the powershell script -->
<!--<LastCommitDate>$([System.DateTime]::UnixEpoch.AddSeconds($(GitCommitTimestamp)).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssK"))</LastCommitDate>-->
</PropertyGroup>
<ItemGroup>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>CommitDate</_Parameter1>
<_Parameter2>$(LastCommitDate)</_Parameter2>
</AssemblyAttribute>
</ItemGroup>
<!-- <Message Importance="high" Text="OS: $(OS)" />-->
<!-- <Message Importance="high" Text="CommitDate: $(LastCommitDate)" />-->
</Target>
<!-- Common analyzers and code fixes-->
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" />
</ItemGroup>
</Project>