Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to merge just one assembly? #12

Open
FLAMESpl opened this issue Apr 19, 2024 · 5 comments
Open

How to merge just one assembly? #12

FLAMESpl opened this issue Apr 19, 2024 · 5 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@FLAMESpl
Copy link

I need to merge just one assembly, ILRepackInputAssemblies property does nothing and I do not want to go through each of my dependencies to exclude them. Is it possible?

@kekyo
Copy link
Owner

kekyo commented Apr 20, 2024

Hi,

The symbol ILRepackInputAssemblies is not referred in ILRepack.FullAuto package. It is simple to use:

  1. Install the ILRepack.FullAuto NuGet package.
  2. If there are assemblies you do not want to merge, list the assembly names in the ILRepackExcludeAssemblies property. All other managed assemblies will be automatically merged.

Perhaps you have other detailed requirements, specify each other optional property.

All of these will be passed on to official ILRepack executable options for processing. Since the processing and manipulation of the assembly itself is not done by ILRepack.FullAuto, there may be some things that cannot be merged due to ILRepack's constraints.

Is this what you wanted to know?

@kekyo kekyo added the question Further information is requested label Apr 20, 2024
@FLAMESpl
Copy link
Author

FLAMESpl commented Apr 20, 2024

Is there a way to programatically build ILRepackExcludeAssemblies collection that would have all dependent assemblies except for one I want to merge? I do not want to everyone remember that they need to extend hardocded collection of excludes whenever they add a new dependecny to the project.

I could use other ILRepack wrapper, but ILRepack.FullAuto seems to be the only option to run ILRepack using CLRCore toolchain instead of mono on linux.

@kekyo
Copy link
Owner

kekyo commented Apr 22, 2024

Understood. So you are saying you want to specify the assemblies to be combined in a whitelist way? This is not possible with the current ILRepack.FullAuto, but will be considered in future improvements.

@kekyo kekyo added the enhancement New feature or request label Apr 22, 2024
@maxkatz6
Copy link

maxkatz6 commented Aug 6, 2024

@FLAMESpl @kekyo I also found this missing functionality. Wrote a simple workaround for me:

    <Target Name="BeforeILRepackPrepareBuild" BeforeTargets="ILRepackPrepareBuild">
      <ItemGroup>
        <_ILRepackIncludeAssemblies_Items Include="$(OutputPath)SingleAssemblyToInclude.dll"/>
        <_ILRepackExcludeAssemblies_Items Include="$(OutputPath)*.dll" Exclude="@(_ILRepackIncludeAssemblies_Items)"/>
      </ItemGroup>
      <PropertyGroup>
        <ILRepackExcludeAssemblies>@(_ILRepackExcludeAssemblies_Items)</ILRepackExcludeAssemblies>
      </PropertyGroup>
    </Target>

@kekyo
Copy link
Owner

kekyo commented Aug 8, 2024

I see, I'm not sure if ILRepack is equivalent to the process of excluding internally, but it seems to serve the purpose in a general way. Thanks for the info!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants