|
14 | 14 | <LocalNuGetCache>$(RepositoryRoot)local-nuget-feed/</LocalNuGetCache> |
15 | 15 | </PropertyGroup> |
16 | 16 |
|
17 | | - <!-- Deterministic Builds https://devblogs.microsoft.com/dotnet/producing-packages-with-source-link/#deterministic-builds --> |
18 | | - <PropertyGroup Label="Continuous Integration" Condition="'$(GITHUB_ACTIONS)' == 'true'"> |
19 | | - <ContinuousIntegrationBuild>true</ContinuousIntegrationBuild> |
20 | | - </PropertyGroup> |
21 | | - |
22 | 17 | <!-- Default language and framework settings for all projects --> |
23 | 18 | <PropertyGroup Label="Project Defaults"> |
24 | 19 | <TargetFramework>net9.0</TargetFramework> |
|
45 | 40 | <PackageReference Include="TimeWarp.SourceGenerators" PrivateAssets="all" /> |
46 | 41 | </ItemGroup> |
47 | 42 |
|
48 | | - <!-- This is to add the CommitDate and CommitHash to your assemblyinfo --> |
49 | | - <Target Name="SetAssemblyMetaData" BeforeTargets="PreBuildEvent" > |
50 | | - <Exec Command="git log -1 --format=%%ct" ConsoleToMSBuild="true" Condition="'$(OS)' == 'Windows_NT'"> |
51 | | - <Output TaskParameter="ConsoleOutput" PropertyName="GitCommitTimestamp"/> |
52 | | - </Exec> |
53 | | - <Exec Command="git log -1 --format=%ct" ConsoleToMSBuild="true" Condition="'$(OS)' != 'Windows_NT'"> |
54 | | - <Output TaskParameter="ConsoleOutput" PropertyName="GitCommitTimestamp"/> |
55 | | - </Exec> |
56 | | - <Exec Command="convert-timestamp --GitCommitTimestamp $(GitCommitTimestamp)" ConsoleToMSBuild="true"> |
57 | | - <Output TaskParameter="ConsoleOutput" PropertyName="CommitDate"/> |
58 | | - </Exec> |
59 | | - <PropertyGroup> |
60 | | - <!-- In Visual Studio the below line crashes if they fix VS then we can use this and no need for the powershell script --> |
61 | | - <!--<LastCommitDate>$([System.DateTime]::UnixEpoch.AddSeconds($(GitCommitTimestamp)).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssK"))</LastCommitDate>--> |
62 | | - <LastCommitDate>$(CommitDate)</LastCommitDate> |
63 | | - </PropertyGroup> |
64 | | - <ItemGroup> |
65 | | - <AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute"> |
66 | | - <_Parameter1>CommitDate</_Parameter1> |
67 | | - <_Parameter2>$(LastCommitDate)</_Parameter2> |
68 | | - </AssemblyAttribute> |
69 | | - </ItemGroup> |
70 | | - <!-- <Message Importance="high" Text="OS: $(OS)" />--> |
71 | | - <!-- <Message Importance="high" Text="CommitDate: $(LastCommitDate)" />--> |
72 | | - </Target> |
| 43 | + <!-- TimeWarp Build Tasks - Automatically injects git commit metadata into assemblies --> |
| 44 | + <ItemGroup Label="Build Tools"> |
| 45 | + <PackageReference Include="TimeWarp.Build.Tasks" PrivateAssets="all" /> |
| 46 | + </ItemGroup> |
73 | 47 |
|
74 | 48 | </Project> |
0 commit comments