-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trimmable runtime xaml loader (#12937)
* Add trimming attributes to the Runtime XAML Loader project * Create CompilerDynamicDependenciesAttribute with all known dynamic types * Use master XamlX * Implement CompilerDynamicDependenciesGenerator to simplify CompilerDynamicDependencies attribute * Better formatting of generated code * Be safe about type converters as well * Remove unnecessary warning * Also include FindType just in case
- Loading branch information
1 parent
a9f7e9c
commit 2bfb008
Showing
12 changed files
with
167 additions
and
29 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
18 changes: 18 additions & 0 deletions
18
src/Markup/Avalonia.Markup.Xaml.Loader/CompilerDynamicDependencies.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,18 @@ | ||
using System; | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
// WARNING: this is a partial class, second part of which is generated by CompilerDynamicDependenciesGenerator. | ||
|
||
namespace Avalonia.Markup.Xaml.XamlIl; | ||
|
||
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] | ||
internal sealed partial class CompilerDynamicDependenciesAttribute : Attribute | ||
{ | ||
public const DynamicallyAccessedMemberTypes XamlDynamicallyAccessedMemberTypes = DynamicallyAccessedMemberTypes.All ^ | ||
(DynamicallyAccessedMemberTypes.NonPublicConstructors | ||
| DynamicallyAccessedMemberTypes.NonPublicEvents | ||
| DynamicallyAccessedMemberTypes.NonPublicFields | ||
| DynamicallyAccessedMemberTypes.NonPublicMethods | ||
| DynamicallyAccessedMemberTypes.NonPublicProperties | ||
| DynamicallyAccessedMemberTypes.NonPublicNestedTypes); | ||
} |
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
Oops, something went wrong.