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

NuGet ยท Source


Stars Forks License Issues Open

nuget nuget

Twitter Dotnet

Discord Twitter Twitter

logo

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

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

License 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.

Discord