-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Build Tasks] Import mono linker sources (#8482)
The `Xamarin.Android.Build.Tasks` and `Microsoft.Android.Sdk.ILLink` projects have been updated to only compile the linker sources that they require, rather than including everything from the `src/Xamarin.Android.Build.Tasks/Linker` folder. Linker sources from mono/mono@6dd9def have been added to `src/Xamarin.Android.Build.Tasks/Linker/External`. Adding the couple dozen files we still depend on directly to the repo removes one of the last dependencies we have on the mono bundle. The `LinkAssembliesNoShrink` task is the main piece of XABT that depends on these mono linker sources. In the future we should try to see if we can migrate this tasks functionality to some ILLink tool/task invocation.
- Loading branch information
Showing
26 changed files
with
2,499 additions
and
237 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
83 changes: 83 additions & 0 deletions
83
src/Xamarin.Android.Build.Tasks/Linker/External/Linker.Steps/BaseStep.cs
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,83 @@ | ||
// | ||
// BaseStep.cs | ||
// | ||
// Author: | ||
// Jb Evain (jbevain@novell.com) | ||
// | ||
// (C) 2007 Novell, Inc. | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining | ||
// a copy of this software and associated documentation files (the | ||
// "Software"), to deal in the Software without restriction, including | ||
// without limitation the rights to use, copy, modify, merge, publish, | ||
// distribute, sublicense, and/or sell copies of the Software, and to | ||
// permit persons to whom the Software is furnished to do so, subject to | ||
// the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be | ||
// included in all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
// | ||
|
||
using Mono.Cecil; | ||
|
||
namespace Mono.Linker.Steps { | ||
|
||
public abstract class BaseStep : IStep { | ||
|
||
private LinkContext _context; | ||
|
||
public LinkContext Context { | ||
get { return _context; } | ||
} | ||
|
||
public AnnotationStore Annotations { | ||
get { return _context.Annotations; } | ||
} | ||
|
||
public Tracer Tracer { | ||
get { return _context.Tracer; } | ||
} | ||
|
||
public MarkingHelpers MarkingHelpers => _context.MarkingHelpers; | ||
|
||
public void Process (LinkContext context) | ||
{ | ||
_context = context; | ||
|
||
if (!ConditionToProcess ()) | ||
return; | ||
|
||
Process (); | ||
|
||
foreach (AssemblyDefinition assembly in context.GetAssemblies ()) | ||
ProcessAssembly (assembly); | ||
|
||
EndProcess (); | ||
} | ||
|
||
protected virtual bool ConditionToProcess () | ||
{ | ||
return true; | ||
} | ||
|
||
protected virtual void Process () | ||
{ | ||
} | ||
|
||
protected virtual void EndProcess () | ||
{ | ||
} | ||
|
||
protected virtual void ProcessAssembly (AssemblyDefinition assembly) | ||
{ | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/Xamarin.Android.Build.Tasks/Linker/External/Linker.Steps/IStep.cs
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,34 @@ | ||
// | ||
// IStep.cs | ||
// | ||
// Author: | ||
// Jb Evain (jbevain@gmail.com) | ||
// | ||
// (C) 2006 Jb Evain | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining | ||
// a copy of this software and associated documentation files (the | ||
// "Software"), to deal in the Software without restriction, including | ||
// without limitation the rights to use, copy, modify, merge, publish, | ||
// distribute, sublicense, and/or sell copies of the Software, and to | ||
// permit persons to whom the Software is furnished to do so, subject to | ||
// the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be | ||
// included in all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
// | ||
|
||
namespace Mono.Linker.Steps { | ||
|
||
public interface IStep { | ||
void Process (LinkContext context); | ||
} | ||
} |
Oops, something went wrong.