TimeWarp.Build.Tasks 1.0.0

Prefix Reserved
dotnet add package TimeWarp.Build.Tasks --version 1.0.0
                    
NuGet\Install-Package TimeWarp.Build.Tasks -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TimeWarp.Build.Tasks" Version="1.0.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TimeWarp.Build.Tasks" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="TimeWarp.Build.Tasks">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TimeWarp.Build.Tasks --version 1.0.0
                    
#r "nuget: TimeWarp.Build.Tasks, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TimeWarp.Build.Tasks@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TimeWarp.Build.Tasks&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=TimeWarp.Build.Tasks&version=1.0.0
                    
Install as a Cake Tool

Stars Forks License Issues Open

nuget nuget

Twitter Dotnet

Discord Twitter Twitter

<img src="https://raw.githubusercontent.com/TimeWarpEngineering/timewarpengineering.github.io/refs/heads/master/images/LogoNoMarginNoShadow.svg" alt="logo" height="120" style="float: right" />

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! ⭐

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

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

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (7)

Showing the top 5 NuGet packages that depend on TimeWarp.Build.Tasks:

Package Downloads
TimeWarp.Nuru

Route-based CLI framework for .NET - batteries included with telemetry, REPL, and shell completion

TimeWarp.Nuru.Logging

Default console logging implementation for TimeWarp.Nuru CLI framework

TimeWarp.Nuru.Core

Core library for TimeWarp.Nuru CLI framework - slim foundation with CreateSlimBuilder() for minimal CLIs

TimeWarp.Nuru.Completion

Shell completion support for TimeWarp.Nuru CLI applications

TimeWarp.Nuru.Telemetry

OpenTelemetry integration for TimeWarp.Nuru CLI framework with Aspire Dashboard support

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on TimeWarp.Build.Tasks:

Repository Stars
TimeWarpEngineering/timewarp-nuru
Route-based CLI framework for .NET - Nuru means 'light' in Swahili
Version Downloads Last Updated
1.0.0 736 10/14/2025
1.0.0-beta.4 129 10/13/2025
1.0.0-beta.3 129 10/13/2025
1.0.0-beta.2 127 10/13/2025
1.0.0-beta.1 125 10/13/2025

For detailed release notes and changelog, please visit: https://github.com/TimeWarpEngineering/timewarp-build-tasks/releases