-
Notifications
You must be signed in to change notification settings - Fork 534
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
[XABT] Create separate assembly preparation tasks. #9637
base: main
Are you sure you want to change the base?
Conversation
0e05e6a
to
1ce7fb1
Compare
{ | ||
var value = item.GetMetadata (name); | ||
|
||
if (string.IsNullOrWhiteSpace (value)) | ||
return defaultValue; | ||
|
||
return value; | ||
return (T?)Convert.ChangeType (value, typeof (T)); |
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.
This throws https://learn.microsoft.com/en-us/dotnet/api/system.convert.changetype?view=net-9.0. We should handle that case? and return the default.
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.
I think this only throws if the input cannot be converted to the requested type, like say you passed in "tru"
and T
is bool
.
Passing in an invalid input is a bug that should be fixed, and it feels like we should indeed throw an exception here rather than silently swallow the error and return the default.
Recording what was mentioned on an earlier call: We need to simplify our build system (and related) to reduce maintenance costs, up to and including removing infrequently/rarely used features. While we need to continue to support The appropriate fix for #9455 is not to "make |
One caveat with this today is that assembly stores do not contain android/src/Xamarin.Android.Build.Tasks/Tasks/CollectAssemblyFilesForArchive.cs Lines 118 to 153 in 0475a60
We default assembly stores to android/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets Lines 328 to 329 in 0475a60
|
1ce7fb1
to
33cee50
Compare
33cee50
to
ea10b6f
Compare
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.
Copilot reviewed 5 out of 8 changed files in this pull request and generated no comments.
Files not reviewed (3)
- src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets: Language not supported
- src/Xamarin.Android.Build.Tasks/Tasks/CollectAssemblyFilesForArchive.cs: Evaluated as low risk
- src/Xamarin.Android.Build.Tasks/Tasks/CompressAssemblies.cs: Evaluated as low risk
Comments suppressed due to low confidence (1)
src/Xamarin.Android.Build.Tasks/Tasks/CreateAssemblyStore.cs:79
- The metadata value may not be a valid boolean. Consider using bool.TryParse to ensure the metadata value is a valid boolean.
var should_skip = asm.GetMetadataOrDefault ("AndroidSkipAddToPackage", false);
Break down the
CollectAssemblyFilesForArchive
task further into individual tasks.These tasks each handle a separate concern about preparing the assemblies for the apk:
CompressAssemblies
- Compresses assemblies using LZ4 compression (independent of ZIP compression).CreateAssemblyStore
- Bundles assemblies into a single.blob
file.WrapAssembliesAsSharedLibraries
- Wraps the assemblies as shared libraries so they can go in thelib
directory of the APK.This should allow them to be moved to separate incremental targets in the future. For example, we do not need to compress all assemblies on every build if they haven't changed since the previous build.