MSBuild tasks for TimeWarp projects including git metadata injection and build automation
| Latest stable | 1.0.0 |
| Downloads | 4,356 |
| Last published | 2025-10-14 |
Install
dotnet add package TimeWarp.Build.Tasks
TimeWarp.Build.Tasks
TimeWarp.Build.Tasks is an MSBuild tasks library that provides build-time automation for .NET projects. The library automatically injects git metadata (commit hash and timestamp) into your assemblies at build time, enabling better traceability and versioning in production deployments.
This build-time dependency integrates seamlessly into your build pipeline without adding runtime overhead, making it ideal for CI/CD workflows and production builds where tracking exact source versions is critical.
Give a Star! :star:
If you find this project useful, please give it a star. Thanks!
Features
- Automatic Git Metadata Injection - Embeds commit hash and timestamp into assembly metadata
- Build-Time Only - No runtime dependencies or performance impact
- Transitive Support - Automatically applied to projects that reference packages using this library
- Configurable - Can be disabled per-project with
TimeWarpEnableGitMetadata=false - Fallback Handling - Gracefully handles non-git repositories without breaking builds
Installation
dotnet add package TimeWarp.Build.Tasks
Check out the latest NuGet packages on the TimeWarp Enterprises NuGet page.
Usage
Once installed, git metadata is automatically injected into your assemblies during build. Access the metadata at runtime:
using System.Reflection;
var assembly = typeof(Program).Assembly;
var commitHash = assembly.GetCustomAttributes<AssemblyMetadataAttribute>()
.FirstOrDefault(a => a.Key == "CommitHash")?.Value;
var commitDate = assembly.GetCustomAttributes<AssemblyMetadataAttribute>()
.FirstOrDefault(a => a.Key == "CommitDate")?.Value;
Console.WriteLine($"Built from commit: {commitHash}");
Console.WriteLine($"Commit date: {commitDate}");
Disabling Git Metadata
To disable automatic git metadata injection for a specific project:
<PropertyGroup>
<TimeWarpEnableGitMetadata>false</TimeWarpEnableGitMetadata>
</PropertyGroup>
Documentation
See full documentation.
Unlicense
This project is licensed under the Unlicense.
Contributing
Your contributions are welcome! Before starting any work, please open a discussion.
Help with the documentation is also greatly appreciated.
Contact
If you have an issue and don't receive a timely response, feel free to reach out on our Discord server.