项目作者: picrap

项目描述 :
Build task to weave generated assembly
高级语言: C#
项目地址: git://github.com/picrap/StitcherBoy.git
创建时间: 2015-10-23T13:56:59Z
项目社区:https://github.com/picrap/StitcherBoy

开源协议:MIT License

下载


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:
    1. public class MyStitcher : SingleStitcher
    2. {
    3. protected override bool Process(ModuleDefMD moduleDef, string assemblyPath, ProjectDefinition project, string projectPath, string solutionPath)
    4. {
    5. // ... Play with the assembly
    6. }
    7. }
  • And the entry point:
    1. public class MyTask : StitcherTask<MyStitcher>
    2. {
    3. public static int Main(string[] args) => Run(new MyTask(), args);
    4. }

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.