peters / ILRepack.MSBuild.Task

MSBuild task for ILRepack which is an open-source alternative to ILMerge.
Other
83 stars 31 forks source link

make dependencies private and include dlls in package #42

Open r-Larch opened 5 years ago

r-Larch commented 5 years ago

Your dependencies to Microsoft.Build.* are bleeding into the $(OutputPath) of every project that holds a reference to ILRepack.MSBuild.Task.

This pull request fixes that issue by moving said assemblies into the package and making the PackageReference private.

Resulting changes the nuget structure:

ILRepack.MSBuild.Task.XXX.nupkg
     build\ ** (as always)
     buildMultiTargeting\ ** (as always)
     tools\ ** (as always)
     tasks\
         net46\
             ILRepack.MSBuild.Task.dll
+            Microsoft.Build.Framework.dll
+            Microsoft.Build.Utilities.Core.dll
+            System.Collections.Immutable.dll
         netcoreapp2.1\
             ILRepack.MSBuild.Task.dll
+            Microsoft.Build.Framework.dll
+            Microsoft.Build.Utilities.Core.dll
         netstandard2.0\
             ILRepack.MSBuild.Task.dll
+            Microsoft.Build.Framework.dll
+            Microsoft.Build.Utilities.Core.dll
+            System.Collections.Immutable.dll

Resulting changes to the .nuspec

<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
  <metadata>
    <!-- ... omitted ... -->
    <dependencies>
      <group targetFramework=".NETFramework4.6">
-        <dependency id="Microsoft.Build.Framework" version="15.9.20" exclude="Build,Analyzers" />
-        <dependency id="Microsoft.Build.Utilities.Core" version="15.9.20" exclude="Build,Analyzers" />
      </group>
      <group targetFramework=".NETCoreApp2.1">
-        <dependency id="Microsoft.Build.Framework" version="15.9.20" exclude="Build,Analyzers" />
-        <dependency id="Microsoft.Build.Utilities.Core" version="15.9.20" exclude="Build,Analyzers" />
      </group>
      <group targetFramework=".NETStandard2.0">
-        <dependency id="Microsoft.Build.Framework" version="15.9.20" exclude="Build,Analyzers" />
-        <dependency id="Microsoft.Build.Utilities.Core" version="15.9.20" exclude="Build,Analyzers" />
      </group>
    </dependencies>
  </metadata>
</package>

Tests

Group Name: ILRepack.MSBuild.Task.Tests Group By: Hierarchy Group Full Name: ILRepack.MSBuild.Task.Tests Duration: 0:00:00,703 0 test(s) failed 0 test(s) skipped 7 test(s) passed

Result1 Name: ILRepack.MSBuild.Task.Tests.ILRepackTaskTests.Test_WildCardInputAssemblies_All_Assemblies_Are_Public_If_Internalize_False Result1 Outcome: Passed Result1 Duration: 0:00:00,293 Result1 StackTrace: Result1 Message: Result1 StandardOutput: Result1 StandardError:

Result2 Name: ILRepack.MSBuild.Task.Tests.ILRepackTaskTests.TestInternalize_Exclude_Relative_Filename Result2 Outcome: Passed Result2 Duration: 0:00:00,068 Result2 StackTrace: Result2 Message: Result2 StandardOutput: Result2 StandardError:

Result3 Name: ILRepack.MSBuild.Task.Tests.ILRepackTaskTests.TestInternalize_Exclude_Relative_Fullpath Result3 Outcome: Passed Result3 Duration: 0:00:00,075 Result3 StackTrace: Result3 Message: Result3 StandardOutput: Result3 StandardError:

Result4 Name: ILRepack.MSBuild.Task.Tests.ILRepackTaskTests.TestInternalize_Exclude_Relative_Regex Result4 Outcome: Passed Result4 Duration: 0:00:00,062 Result4 StackTrace: Result4 Message: Result4 StandardOutput: Result4 StandardError:

Result5 Name: ILRepack.MSBuild.Task.Tests.ILRepackTaskTests.TestInternalize_MainAssembly_Is_Public_By_Default Result5 Outcome: Passed Result5 Duration: 0:00:00,066 Result5 StackTrace: Result5 Message: Result5 StandardOutput: Result5 StandardError:

Result6 Name: ILRepack.MSBuild.Task.Tests.ILRepackTaskTests.TestWilcardInputAssemblies Result6 Outcome: Passed Result6 Duration: 0:00:00,072 Result6 StackTrace: Result6 Message: Result6 StandardOutput: Result6 StandardError:

Result7 Name: ILRepack.MSBuild.Task.Tests.ILRepackTaskTests.TestWilcardInputAssemblies_Exclude Result7 Outcome: Passed Result7 Duration: 0:00:00,067 Result7 StackTrace: Result7 Message: Result7 StandardOutput: Result7 StandardError: