GithubHelp home page GithubHelp logo

ianclegg / ilrepack.msbuild.task Goto Github PK

View Code? Open in Web Editor NEW

This project forked from peters/ilrepack.msbuild.task

0.0 1.0 0.0 3.26 MB

MSBuild task for ILRepack which is an open-source alternative to ILMerge.

License: Other

C# 95.28% Batchfile 3.08% Shell 1.64%

ilrepack.msbuild.task's Introduction

ILRepack.MSBuild.Task

MSBuild task for ILRepack which is an open-source alternative to ILMerge.

Install via NuGet

Install-Package ILRepack.MSBuild.Task

Supported frameworks

  • netcoreapp2.1
  • netstandard2.0
  • net46
  • net45
  • net40

NB! OutputType EXE on .NET Core assemblies is not supported.

Build prerequisites

  • Visual Studio 15.9
  • .net core 2.2.101 sdk must be installed
  • Checkout git submodules: git submodule update --init --recursive

Build on Windows

build.cmd

Build on Unix

build.sh

ILRepack a library with using an explicit list of input assemblies

<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <TargetFramework>netcoreapp2.2</TargetFramework>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="ILRepack.MSBuild.Task" Version="2.0.1" />
    </ItemGroup>

    <Target Name="ILRepack" AfterTargets="Build">

        <PropertyGroup>
            <WorkingDirectory>$(MSBuildThisFileDirectory)bin\$(Configuration)\$(TargetFramework)</WorkingDirectory>
        </PropertyGroup>

        <ItemGroup>
            <InputAssemblies Include="dependency1.dll" />
            <InputAssemblies Include="..\Mono.Cecil.dll" />
            <InputAssemblies Include="c:\a\rooted\path\Mono.Cecil.Mdb.dll" />
        </ItemGroup>
		
        <ItemGroup>
	    <!-- Dot not internalize any types inside this assembly -->
            <InternalizeExcludeAssemblies Include="do.not.internalize.this.assembly.dll" />
	    <!-- Internalize all types inside Some.Assembly.Namespace (Regular expression) -->
            <InternalizeExcludeAssemblies Include="^Some.Assembly.Namespace" />
	    <!-- Internalize all types except Some.Assembly.Namespace.SpecificType (Regular expression) -->
            <InternalizeExcludeAssemblies Include="^Some.Assembly.Namespace.SpecificType" />
        </ItemGroup>

        <ILRepack 
            OutputType="$(OutputType)" 
            MainAssembly="$(AssemblyName).dll" 
            OutputAssembly="$(AssemblyName).dll" 
            InputAssemblies="@(InputAssemblies)" 
            InternalizeExcludeAssemblies="@(InternalizeExcludeAssemblies)" 
            WorkingDirectory="$(WorkingDirectory)" />

    </Target>

</Project>

ILRepack a library and all dependencies

<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <TargetFramework>netcoreapp2.2</TargetFramework>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="ILRepack.MSBuild.Task" Version="2.0.1" />
    </ItemGroup>
    
    <Target Name="ILRepack" AfterTargets="Build">

        <PropertyGroup>
            <WorkingDirectory>$(MSBuildThisFileDirectory)bin\$(Configuration)\$(TargetFramework)</WorkingDirectory>
        </PropertyGroup>

        <ILRepack 
            OutputType="$(OutputType)" 
            MainAssembly="$(AssemblyName).dll" 
            OutputAssembly="$(AssemblyName).dll" 
            InputAssemblies="$(WorkingDirectory)\*.dll" 
	    WilcardInputAssemblies="true"
            WorkingDirectory="$(WorkingDirectory)" />

    </Target>

</Project>

ILRepack a executable and all dependencies

<Target Name="ILRepack" AfterTargets="Build">

        <PropertyGroup>
            <WorkingDirectory>$(MSBuildThisFileDirectory)bin\$(Configuration)\$(TargetFramework)</WorkingDirectory>
        </PropertyGroup>

        <ILRepack
            OutputType="$(OutputType)"
            MainAssembly="$(AssemblyName).exe"
            OutputAssembly="$(AssemblyName).exe"
            InputAssemblies="$(WorkingDirectory)\*.dll"
	    WilcardInputAssemblies="true"
            WorkingDirectory="$(WorkingDirectory)" />

</Target>

License

Checkout the License

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.