-
Notifications
You must be signed in to change notification settings - Fork 209
Add trimming safety and AOT compatibility attributes to fix release build crashes #273
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
Open
Copilot
wants to merge
11
commits into
main
Choose a base branch
from
copilot/fix-app-crash-on-scanner
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b661ec6
Initial plan
Copilot e05c28f
Add trimming safety attributes to handlers and controls
Copilot f11462e
Add troubleshooting section for trimming/linker issues
Copilot 7367448
Remove version placeholder from README
Copilot c3e0a3e
Fix: Move DynamicDependency attributes from classes to constructors
Copilot 049e444
Merge branch 'main' into copilot/fix-app-crash-on-scanner
jfversluis 75f5e91
Add DynamicDependency for MapVisibility method to maintain trimming s…
Copilot a9dae97
Add IsAotCompatible=true to indicate AOT compatibility
Copilot fd84fa2
Remove redundant EnableTrimAnalyzer property
Copilot 8dac80a
Remove redundant DynamicDependency attributes from HostBuilderExtensions
Copilot 565c7ea
Add DynamicallyAccessedMembers attribute to TBarcodeReader generic pa…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| using Microsoft.Maui; | ||
| using Microsoft.Maui.Graphics; | ||
| using Microsoft.Maui.Handlers; | ||
| using System.Diagnostics.CodeAnalysis; | ||
| using System.Linq; | ||
| using System; | ||
| using ZXing; | ||
|
|
@@ -9,6 +10,10 @@ | |
|
|
||
| namespace ZXing.Net.Maui | ||
| { | ||
| /// <summary> | ||
| /// Handler for BarcodeGeneratorView that generates barcode images. | ||
| /// This handler is trimmer-safe with appropriate DynamicDependency attributes. | ||
| /// </summary> | ||
| public partial class BarcodeGeneratorViewHandler : ViewHandler<IBarcodeGeneratorView, NativePlatformImageView> | ||
| { | ||
| Size desiredSize; | ||
|
|
@@ -24,11 +29,17 @@ public partial class BarcodeGeneratorViewHandler : ViewHandler<IBarcodeGenerator | |
| [nameof(IBarcodeGeneratorView.CharacterSet)] = MapUpdateBarcode, | ||
| }; | ||
|
|
||
| [DynamicDependency(DynamicallyAccessedMemberTypes.PublicConstructors, typeof(BarcodeGeneratorViewHandler))] | ||
| [DynamicDependency(nameof(BarcodeGeneratorViewMapper))] | ||
| [DynamicDependency(nameof(MapUpdateBarcode))] | ||
|
Comment on lines
+32
to
+34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand these DynamicDependency attributes, why are they here? Also where are we accessing the |
||
| public BarcodeGeneratorViewHandler() : base(BarcodeGeneratorViewMapper) | ||
| { | ||
| writer = new BarcodeWriter(); | ||
| } | ||
|
|
||
| [DynamicDependency(DynamicallyAccessedMemberTypes.PublicConstructors, typeof(BarcodeGeneratorViewHandler))] | ||
| [DynamicDependency(nameof(BarcodeGeneratorViewMapper))] | ||
| [DynamicDependency(nameof(MapUpdateBarcode))] | ||
| public BarcodeGeneratorViewHandler(PropertyMapper? mapper = null) : base(mapper ?? BarcodeGeneratorViewMapper) | ||
| { | ||
| writer = new BarcodeWriter(); | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.