Giter Club home page Giter Club logo

stitcherboy's Introduction

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.

stitcherboy's People

Contributors

picrap avatar rgroenewoudt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

stitcherboy's Issues

Add event handlers

Add:

  • assembly resolve event handler
  • assembly resolution failed event handler

.NET Core Support?

Hello Pascal :)

I hate to be a pest, but do you think there's any chance for .NET Core support for this?

Thank you for the time and effort!
DB

Random IOException at load

Error at module load (should retry):

Error: Unhandled exception: System.IO.IOException: L’opération demandée n’a pu s’accomplir sur un fichier ayant une section mappée utilisateur ouverte.

   à System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   à System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
   à System.IO.File.Copy(String sourceFileName, String destFileName, Boolean overwrite)
   à StitcherBoy.Reflection.ModuleManager.LoadWithTemp(String assemblyPath, Nullable`1 useTemp)
   à StitcherBoy.Weaving.Build.AssemblyStitcher.LoadModule(String assemblyPath)
   à StitcherBoy.Weaving.Build.AssemblyStitcher.Process(StringDictionary parameters, Guid buildID, DateTime buildTime, String entryAssemblyPath)
   à StitcherBoy.Weaving.StitcherProcessor.Process(StringDictionary parameters, Guid buildID, DateTime buildTime, String entryAsemblyPath)
   à StitcherBoy.Weaving.StitcherProcessor.Process(StringDictionary parameters, Guid buildID, DateTime buildTime, String entryAsemblyPath)
   à StitcherTask`1.Run(Boolean fromExe) (1, 1)

(“pardon my french”, as they say)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.