https://github.com/picrap/stitcherboy
Build task to weave generated assembly
https://github.com/picrap/stitcherboy
library modify-assemblies msbuild-task
Last synced: about 1 year ago
JSON representation
Build task to weave generated assembly
- Host: GitHub
- URL: https://github.com/picrap/stitcherboy
- Owner: picrap
- License: mit
- Created: 2015-10-23T13:56:59.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2025-02-12T17:11:23.000Z (over 1 year ago)
- Last Synced: 2025-04-10T06:08:37.553Z (about 1 year ago)
- Topics: library, modify-assemblies, msbuild-task
- Language: C#
- Size: 5.05 MB
- Stars: 6
- Watchers: 1
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://github.com/0xd4d/dnlib) to modify assemblys.
Available as a [NuGet package](https://www.nuget.org/packages/StitcherBoy).
Current build status: [](https://ci.appveyor.com/project/picrap/stitcherboy).
## In details
### Implementing
Create a project which generates a console application.
Then add two classes:
- The processor:
```csharp
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:
```csharp
public class MyTask : StitcherTask
{
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=` `SolutionPath=`.
## They use StitcherBoy
- [VersionSticher](https://github.com/picrap/VersionStitcher): a task to inject version information after build, based on values injected in strings.