Skip to content

Latest commit

 

History

History
43 lines (32 loc) · 1.36 KB

README.md

File metadata and controls

43 lines (32 loc) · 1.36 KB

StitcherBoy

This is a simple library allowing to write MSBuild tasks to modify assemblies after build. It allows to debug tasks because they can be build as applications. It uses the excellent dnlib to modify assemblys.

Available as a NuGet package.
Current build status: Build status.

In details

Implementing

Create a project which generates a console application. Then add two classes:

  • The processor:
public class MyStitcher : SingleStitcher
{
  protected override bool Process(ModuleDefMD moduleDef, string assemblyPath, ProjectDefinition project, string projectPath, string solutionPath)
  {
    // ... Play with the assembly
  }
}
  • And the entry point:
public class MyTask : StitcherTask<MyStitcher>
{
    public static int Main(string[] args) => Run(new MyTask(), args);
}

Embedding it as MSBuild task

// TODO (lazy boy)

Debugging it

Simply set the following command-line parameters ProjectPath=<pathToCSProj> SolutionPath=<pathToSln>.

They use StitcherBoy

  • VersionSticher: a task to inject version information after build, based on values injected in strings.