Skip to content

picrap/StitcherBoy

Repository files navigation

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.

About

Build task to weave generated assembly

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages