Tools to keep build pipelines sane while .NET Core matures

.NetCore, project.json, ci, build, cake
Install-Package Aethon.NetCoreBuildTools.CakeAddin -Version 2.0.0



Tools to help maintain a sane build pipeline as .NET Core matures.

CI Versioning

The current project.json structure does not really follow CI principles in that, to update the package version number, you must modify a checked-in source file.

To update the project.json version:

using Aethon.NetCoreBuildTools;



This will only write to the project file if the version is not present or does not match the specified version. It will also preserve the suffix pattern (e.g. "-*") specified in the project file.

Package Metadata

Again, the current pack process does not afford much flexibility. All package metadata, such as copyright and licenseUrl must appear in the project.json file and cannot be overridden. To temporarily rewrite the project file:

using Aethon.NetCoreBuildTools;


    .With(copyright: "Copyright (c) 2016 ME!")
    .Apply(() => Execute(@"dotnet pack c:\project\myproject\project.json"));
  • NetCore.Project locates the project.json file.
  • .With specifies one or more project properties to replace. copyright, projectUrl, iconUrl, and licenseUrl are currently supported.
  • .Apply rewrites the project file, executes the action, and then restores the project to its original state.

Installing for a .NET Core Project

Add a dependency on the NuGet package.

Installing for a Cake Build Script

Reference the NuGet package with an #addin preprocessor.

#addin Aethon.NetCoreBuildTools.CakeAddin