This adds a managed static registrar, which is a variation of the static registrar
that takes advantage of a few new features in C# and the runtime, as well as avoiding
metadata tokens, which NativeAOT doesn't support.
This registrar will generate most of the trampoline/interop code as managed code
using Cecil, and the Objective-C part is as small as possible.
Fixes https://github.com/xamarin/xamarin-macios/issues/17324.
When using the managed static registrar, we register types with the static registrar
before the linker does its work, so we need to follow-up after the linker has figured
out what will be trimmed away to remove any such types from the list of registered types.
It's not needed until later anyway.
This way we can add code for the managed static registrar (which does not need the
token reference, in fact creating a token reference for a method won't be possible
with the managed static registra) in the correct location in the code.
The managed static registrar will add code to the processed assemblies, which means
it must run before the trimmer sweeps unused code.
This means we have to split the current registrar logic in two:
1. First we process all the assemblies.
2. Then we write out the results.
When not using the managed static registrar, these two steps happens right after
oneanother (like they do now), while when using the managed static registrar, the
processing is done before the trimmer sweeps (where we'll also generate all the new
IL code), and then the generated native code will be done at the end of the build
process (like for the old-school static registrar).
The autoformat action doesn't necessarily run on macOS, and sed's syntax is
different between macOS and Linux - so make sure to cope with these
differences.
Also execute the nullability fixes in a separate subshell to not interfere
with the rest of the script.
This fixes an issue where autoformat would fail with:
+ sed -i '' -e 's/!= null/is not null/g' -e 's/== null/is null/g' builds/fix-maccatalyst-assembly/Program.cs
sed: can't read : No such file or directory
This is because the SetTopLevelPropertyGroupValue method doesn't always
work as expected (it doesn't always set seomthing), while SetProperty does.
Fixing the SetTopLevelPropertyGroup method is somewhat complex, since it
lives in the dotnet/xharness repository, so instead use the SetProperty
method, which is our own (working) version.
This is the pull request automatically created by the OneLocBuild task
in the build process to check-in localized files generated based upon
translation source files (.lcl files) handed-back from the downstream
localization pipeline. If there are issues in translations, visit
https://aka.ms/icxLocBug and log bugs for fixes. The OneLocBuild wiki is
https://aka.ms/onelocbuild and the localization process in general is
documented at https://aka.ms/AllAboutLoc.
---------
Co-authored-by: tj-devel709 <tjlambert@microsoft.com>
We no longer need to have overridable logic for remote builds, so the
non-abstract task class and the abstract base class can be merged.
Also enable nullability and fix any issues.
We no longer need to have overridable logic for remote builds, so the
non-abstract task class and the abstract base class can be merged.
Also enable nullability and fix any issues.
This makes it easier to diagnose problems loading/finding app manifests.
Specifying an app manifest that doesn't exist should probably be an
error, but that's very likely to break existing projects, so just make this a
warning for now.
Change all null checking expressions to use 'is null' and 'is not null'
instead of '== null' and '!= null'.
This was mostly done with sed, so code can probably be improved in many
other ways with manual inspection, but that will come over time.
Also add code to the autoformat script to automatically fix these issues in the future.
'dotnet build' doesn't work when MSBUILD_EXE_PATH is set (which we do in
some places for legacy tests), so make sure to unset MSBUILD_EXE_PATH before running
'dotnet build'.
This change didn't really get rid of the non-breaking space and caused
extra changes after we built xamarin-macios.
Co-authored-by: tj-devel709 <tjlambert@microsoft.com>
This pull request updates the following dependencies
## From https://github.com/dotnet/installer
- **Subscription**: fffd7604-ce46-455f-0f2f-08db24524baf
- **Build**: 20230504.11
- **Date Produced**: May 4, 2023 10:10:59 AM UTC
- **Commit**: ccc5191a306acdad77bbfea6675886dc72bf9454
- **Branch**: refs/heads/release/7.0.2xx
- **Updates**:
- **Microsoft.Dotnet.Sdk.Internal**: [from 7.0.204-servicing.23214.3 to
7.0.206-servicing.23254.11][2]