-
Notifications
You must be signed in to change notification settings - Fork 517
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Controlled by EnableAssemblyILStripping which defaults to true - Integration test included Before - https://gist.github.com/chamons/c7886f7bacbc2e5ac5966e4251d13e71 After - https://gist.github.com/chamons/148e1bef22fa336f953f3d02dcf20667 859,136 -> 527,872 managed Fixes #11445.
- Loading branch information
Showing
13 changed files
with
169 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using Microsoft.Build.Framework; | ||
using Microsoft.Build.Utilities; | ||
|
||
// Normally this would be ILStrip.Tasks but ILStrip is in the global namespace | ||
// And having a type and the parent namespace have the same name really confuses the compiler | ||
namespace ILStripTasks { | ||
public class ILStripBase : ILStrip | ||
{ | ||
public string SessionId { get; set; } | ||
|
||
[Output] | ||
public ITaskItem [] StrippedAssemblies { get; set; } | ||
|
||
public override bool Execute () | ||
{ | ||
var result = base.Execute (); | ||
|
||
var stripedItems = new List<ITaskItem> (); | ||
|
||
if (result) | ||
{ | ||
foreach (var item in Assemblies) | ||
{ | ||
stripedItems.Add (new TaskItem (item.GetMetadata("OutputPath"))); | ||
} | ||
} | ||
|
||
StrippedAssemblies = stripedItems.ToArray(); | ||
|
||
return result; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Microsoft.Build.Tasks; | ||
using Microsoft.Build.Framework; | ||
using Xamarin.Messaging.Build.Client; | ||
|
||
namespace Xamarin.MacDev.Tasks | ||
{ | ||
public class ILStrip : ILStripTasks.ILStripBase, ITaskCallback | ||
{ | ||
public override bool Execute () | ||
{ | ||
if (this.ShouldExecuteRemotely (SessionId)) | ||
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result; | ||
|
||
return base.Execute (); | ||
} | ||
|
||
public bool ShouldCopyToBuildServer (ITaskItem item) => false; | ||
|
||
public bool ShouldCreateOutputFile (ITaskItem item) => true; | ||
|
||
public IEnumerable<ITaskItem> GetAdditionalItemsToBeCopied () => Enumerable.Empty<ITaskItem> (); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a300dfc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥 Tests failed catastrophically on Build (no summary found). 🔥
Result file $(TEST_SUMMARY_PATH) not found.
Pipeline on Agent
[msbuild] Add ILStrip'ing for net6 applications. Fixes #11445. (#12563)
a300dfc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ [CI Build] Tests failed on Build ❌
Tests failed on Build.
API diff
✅ API Diff from stable
View API diff
API & Generator diff
✅ API Diff (from PR only) (no change)
✅ Generator Diff (only version changes)
Packages generated
View packages
Test results
2 tests failed, 216 tests passed.
Failed tests
No test log file was produced)
Tests run: 11 Passed: 6 Inconclusive: 0 Failed: 0 Ignored: 5)
Pipeline on Agent XAMBOT-1038.BigSur'
[msbuild] Add ILStrip'ing for net6 applications. Fixes #11445. (#12563)
a300dfc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.
Pipeline on Agent
[msbuild] Add ILStrip'ing for net6 applications. Fixes #11445. (#12563)
a300dfc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.
Pipeline on Agent
[msbuild] Add ILStrip'ing for net6 applications. Fixes #11445. (#12563)