Граф коммитов

5161 Коммитов

Автор SHA1 Сообщение Дата
Peter Collins 68b1b91a20
[build] Include MIT license in most NuGet packages (#8787)
Fixes: https://github.com/xamarin/xamarin-android/issues/8779

Updates all NuGet packages other than Microsoft.Android.Sdk to include
the MIT license at the root of the repo.

The license file name and contents have also been updated to improve
consistency with other dotnet repos.
2024-03-06 09:43:54 -08:00
dotnet-maestro[bot] 2fa3f3b10f
Bump to dotnet/installer/main@893b762b6e 9.0.100-preview.3.24153.2 (#8782)
Changes: d070660282...893b762b6e
Changes: 99b76018b6...5e603d595e
Changes: 2d3f1fe480...0f3e462442
Changes: 61250b0ed4...0d0bc8e0f4

Updates:

* Microsoft.Dotnet.Sdk.Internal: from 9.0.100-preview.3.24126.2 to 9.0.100-preview.3.24153.2
* Microsoft.NETCore.App.Ref: from 9.0.0-preview.2.24123.1 to 9.0.0-preview.3.24129.2
* Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport: from 9.0.0-preview.2.24121.1 to 9.0.0-preview.3.24126.1
* Microsoft.NET.ILLink.Tasks: from 9.0.0-preview.2.24123.1 to 9.0.0-preview.3.24129.2
* Microsoft.DotNet.Cecil: from 0.11.4-alpha.24119.1 to 0.11.4-alpha.24120.1
2024-03-06 11:22:42 -06:00
Jonathan Peppers 136dc83bff
[docs] update notes about `dotnet-trace` and `dotnet-gcdump` (#8713)
Context: https://github.com/dotnet/diagnostics/issues/4337

Update `Documentation/guides/tracing.md` to be up-to-date for .NET 8.
2024-03-06 11:07:11 -05:00
Šimon Rozsíval e41a31b952
[Mono.Android] Fix race condition in AndroidMessageHandler (#8753)
Fixes: https://github.com/xamarin/xamarin-android/issues/8740

There is a race condition in `AndroidMessageHandler` (see https://github.com/xamarin/xamarin-android/issues/8740#issuecomment-1960331579 
for more information). 

The solution is fairly simple: we should determine the decompression strategy only during the setup, when `AutomaticDecompression` is set. 
We don't need to do any more work during the request.

To prevent changing the decompression strategy while there are requests mid-flight, the setter will only accept values until the first request 
is sent. This is exactly what the `SocketsHttpHandler` does. I didn't want to touch any code unrelated to the race condition in this PR so if we 
want to prevent other properties from being mutated while HTTP requests are being sent, we should do it in a follow-up PR.
2024-03-05 13:07:01 +00:00
Peter Collins aea89e161f
[ci] Fix SDL Sources Analysis for PRs from forks (#8785)
The recent 1ES pipeline template migration added a new source code
analysis stage that is failing on PR builds from forks.  We should be
able to fix this by skipping AzDO build tagging and monodroid scanning
for such builds.
2024-03-04 14:08:43 -08:00
Peter Collins db49513040
[ci] Add 1ESPT override to MSBuild test stages (#8784)
The mega pipeline extends our msbuild stages and does not yet support
using the 1ES pipeline template.
2024-03-04 12:54:06 -08:00
Peter Collins 5cd9a267e2
[ci] Do not use @self annotation for templates (#8783)
The `@self` yaml template annotation only appears to be needed in the
pipeline file, and not in nested templates.  This should fix potential
issues with other repos that use these templates.
2024-03-04 11:28:24 -08:00
Peter Collins a1c5111469
[ci] Migrate to the 1ES template (#8747)
Context: https://aka.ms/1espt

The build pipeline has been updated to extend the 1ES pipeline template,
which will keep the pipeline up to date with the latest compliance and
security requirements.  Most compliance tasks and scans will now run
automatically as part of artifact upload steps.  API Scan and policheck 
scans against multiple languages are not supported and will continue to
run separately.
2024-03-04 10:22:15 -08:00
Jonathan Peppers 5205a5f0f0
[Mono.Android] fix trimming warnings, part 2 (#8758)
Context: https://github.com/xamarin/xamarin-android/issues/5652
Context: https://github.com/xamarin/xamarin-android/issues/8724
Context: https://github.com/xamarin/java.interop/issues/1165
Context: b8f6f8884a
Context: dc3dc3ccf28cdbe9f8c0a705400b83c11a85c81a980ccf2

Fix another set of trimmer warnings found via:

	<IsTrimmable>true</IsTrimmable>
	<EnableAotAnalyzer>true</EnableAotAnalyzer>

~~ JavaObjectExtensions ~~

`Extensions.JavaCast<T>()` now requires `PublicConstructors` and
`NonPublicConstructors` because `TypeManager.CreateProxy()` uses
`ConstructorInfo.Invoke()`.  This change bubbles up to various other
types that have a `Find*ById<T>()` method:

  * `Activity`
  * `Dialog`
  * `FragmentManager`
  * `View`
  * `Window`

`JavaObjectExtensions.GetInvokerType()` also has suppressions around
`Assembly.GetType()` and `Type.MakeGenericType()`.  We track this for
the future at xamarin/xamarin-android#8724.


~~ AndroidRuntime ~~

Update `[DynamicallyAccessedMembers]` based on changes to
`RegisterNativeMembers` in xamarin/java.interop@b8f6f888.


~~ JNINativeWrapper ~~

`$(EnableAotAnalyzer)` found usage of `DynamicMethod`.  Suppress for
now, as we track this for the future at xamarin/xamarin-android#8724.


~~ ResourceIdManager ~~

Usage of `Type.GetMethod ("UpdateIdValues")` leads to decoration of
`[ResourceDesignerAttribute]` with:

	[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)]
	public string FullName { get; set; }

I also had to suppress warnings around `Assembly.GetType()`.
This *should* be OK, as `Resource.designer.cs` is always in the
"root assembly" of Android application projects.

Additionally, this code should no longer be used in .NET 8+ apps;
see dc3ccf28.


~~ JavaProxyThrowable ~~

Suppress warning around `StackFrame.GetMethod()`; we already handle
`null` return values and exceptions.  The existing code appears to be
"best effort" to provide additional stack trace information.


~~ TypeManager ~~

Suppress warning around a call to `Type.GetType()` with a string
passed in from Java.  There is not much we can really do yet, except
rely on the `MarkJavaObjects` trimmer step.

Likely also a problem for the future:

  * xamarin/java.interop#1165
  * xamarin/xamarin-android#8724


~~ Impact on `.apk` size ~~

`BuildReleaseArm64XFormsDotNet.apkdesc` shows a ~33KB size increase
in the `.apk`.  Much of this is attributable to changes from
dotnet/runtime (`System.Private.CoreLib.dll` is ~20KB larger).

Some of this is due to increases in the size of `classes*.dex`.
These changes are because more managed constructors are now preserved
by the trimmer, which causes more constructors to be emitted into the
Java Callable Wrappers.
2024-03-01 15:31:11 -05:00
Jonathan Peppers 60dbcc9fe4
[Xamarin.Android.Build.Tasks] set `%(DefineConstantsOnly)` for older API levels (#8777)
Fixes: https://github.com/xamarin/xamarin-android/issues/8331
Context: https://github.com/xamarin/xamarin-android/pull/8569
Context: 25b360d579

Building for `net9.0-android33` would give a poor error message:

    error NETSDK1181: Error getting pack version: Pack 'Microsoft.Android.Ref.33' was not present in workload manifests.
    C:\Program Files\dotnet\sdk\8.0.100-preview.7.23376.3\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets

To solve this, you would either change 33 to 34, or just remove the number to rely on the default value.

To make this easier:

* Automatically switch to 34 if the user specifies 33 or less.

* Opt into `%(DefineConstantsOnly)=true` for API levels 21-33 (and not
  the latest), which allows the .NET SDK to emit the *better* .NET SDK
  error message instead.

So now users will get:

    (_CheckForInvalidTargetPlatformVersion target) ->
    dotnet/sdk/9.0.100-alpha.1.23628.5/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(243,5):
    error NETSDK1140: 33.0 is not a valid TargetPlatformVersion for Android.
    Valid versions include: 34.0

I added a test for this scenario.
2024-03-01 08:49:50 -06:00
Jonathan Peppers e873731229
[tests] fix duplicate sources in `NuGet.config` (#8772)
Context: https://github.com/NuGet/Home/issues/13269#issuecomment-1969883700

In 2f4e01ec, we saw a problem with no-op NuGet restore, no longer
being a no-op. So we temporarily disabled the failing
`IncrementalFastDeployment` test.

It turns out, it might be related to a duplicate source listed in our
`NuGet.config` during MSBuild tests:

    <add key="dotnet8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" />
    <add key="testsource2" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" />

This might have surfaced a bug in NuGet, but for now let's stop
emitting duplicate sources?

Additionally, use `ExtraNuGetConfigSources.Distinct ()` in case we have a test
that passes in duplicate sources.
2024-02-29 11:52:32 -06:00
Peter Collins 0d489b1574
Bump to xamarin/monodroid@e13723e701 (#8771)
Changes: cb01503327...e13723e701

  * xamarin/monodroid@e13723e70: Bump external/xamarin-android from `87d8914` to `8c7cf91`
  * xamarin/monodroid@905441a99: Pass the required parameters to BuildApk
  * xamarin/monodroid@59a052933: [ci] Add guardian supression file
2024-02-28 09:45:42 -08:00
dependabot[bot] 4a2179ce88
Bump to xamarin/xamarin-android-tools/main@37d79c9 (#8752)
Changes: a698a33aa4...37d79c9dcd

  * xamarin/xamarin-android-tools@37d79c9: Bump LibZipSharp to 3.1.1 (xamarin/xamarin-android-tools#228)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-27 17:22:52 -05:00
dotnet-maestro[bot] 2f4e01ec15
Bump to dotnet/installer/main@d070660282 9.0.100-preview.3.24126.2 (#8763)
Changes: 0a73f814e1...d070660282
Changes: dcc66a7ca2...99b76018b6
Changes: 258b51a8e5...2d3f1fe480

Updates:

* Microsoft.Dotnet.Sdk.Internal: from 9.0.100-preview.2.24122.3 to 9.0.100-preview.3.24126.2
* Microsoft.NETCore.App.Ref: from 9.0.0-preview.2.24122.2 to 9.0.0-preview.2.24123.1
* Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport: from 9.0.0-preview.2.24120.1 to 9.0.0-preview.2.24121.1
* Microsoft.NET.ILLink.Tasks: from 9.0.0-preview.2.24122.2 to 9.0.0-preview.2.24123.1

Other changes:

* [tests] ignore `IncrementalFastDeployment` for now

Context: https://github.com/NuGet/Home/issues/13269

Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
2024-02-27 13:43:58 -06:00
dependabot[bot] 43a397fa93
Bump to xamarin/java.interop/main@14a9470 (#8766)
Changes: c825dcad8e...14a9470176

* xamarin/java.interop/main@14a9470 [Java.Interop.Tools.TypeNameMappings] introduce project for net8.0
* xamarin/java.interop/main@bd793f1 [Java.Interop.Tools.TypeNameMappings] fix ToJniName()
* xamarin/java.interop/main@67c079c [Java.Interop.Tools.JavaCallableWrappers] fix net8.0 targeting in XA
* xamarin/java.interop/main@2197579 [Hello-NativeAOTFromJNI] Add NativeAOT sample
* xamarin/java.interop/main@c8fcf70 Bump to xamarin/xamarin-android-tools@37d79c9
* xamarin/java.interop/main@56b7eeb [Java.Interop.Tools.TypeNameMappings] fix trimmer warnings
2024-02-27 08:44:10 -06:00
Jonathan Peppers 37594cab81
$(AndroidPackVersionSuffix)=preview.3; net9 is 34.99.0.preview.3 (#8765)
Context: https://github.com/xamarin/xamarin-android/tree/release/9.0.1xx-preview2

We branched for .NET 9 Preview 2 from 8c7cf91f into release/9.0.1xx-preview2;
the main branch is now .NET 9 Preview 3.

Update xamarin-android/main's version number to 34.99.0-preview.3.
2024-02-27 09:39:47 -05:00
Šimon Rozsíval efcd007b0c
[Mono.Android] Do not dispose request content stream in AndroidMessageHandler (#8764)
Fixes: https://github.com/xamarin/xamarin-android/issues/2901
Fixes:  https://github.com/xamarin/xamarin-android/issues/4476
Fixes: https://github.com/xamarin/xamarin-android/issues/7086

Neither the `SocketsHttpHandler` nor the `iOS/macOS` `NSUrlSessionHandler` dispose the content stream,
let's follow suit.
2024-02-27 10:33:34 +00:00
dependabot[bot] 8c7cf91fc1
Bump com.android.tools:r8 from 8.2.42 to 8.2.47 (#8761)
Context: https://r8.googlesource.com/r8/+/refs/tags/8.2.44
Context: https://r8.googlesource.com/r8/+/62baf24ba2b71f4e5bc04c7f01930bc5d47b02be
Context: https://maven.google.com/web/index.html?q=r8#com.android.tools:r8:8.2.47

Note that I was not able to find an *exact* matching tag for this release, but found the commit.
2024-02-26 08:52:53 -06:00
Jonathan Peppers a82ac4e560
[Mono.Android] fix a set of the "easiest" trimmer warnings (#8731)
Context: https://github.com/xamarin/xamarin-android/issues/5652

Fixing the following trimmer warnings:

~~ TypeConverter ~~

Context: https://source.dot.net/#System.ComponentModel.TypeConverter/System/ComponentModel/TypeConverter.cs,226

	src\Mono.Android\System.Drawing\SizeFConverter.cs(121,49): error IL2046:
	  Base member 'System.ComponentModel.TypeConverter.GetProperties(ITypeDescriptorContext, Object, Attribute[])' with 'RequiresUnreferencedCodeAttribute' has a derived member
	  'System.Drawing.SizeFConverter.GetProperties(ITypeDescriptorContext, Object, Attribute[])' without 'RequiresUnreferencedCodeAttribute'.
	  'RequiresUnreferencedCodeAttribute' annotations must match across all interface implementations or overrides.

Various `TypeConverter` implementations need to specify
`[RequiresUnreferencedCode]` to match the base type.


~~ ColorValueMarshaler & IJavaObjectValueMarshaler ~~

Context: 7d1e7057cf

From the trimmer warnings solved in `Java.Interop.dll`, we need to
bring these changes forward to any `*Marshaler` types.


~~ AndroidClientHandler ~~

	'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.NonPublicFields' in call to 'System.Type.GetField(String, BindingFlags)'.
	The return value of method 'System.Collections.IEnumerator.Current.get' does not have matching annotations.
	The source value must declare at least the same requirements as those declared on the target location it is assigned to.

This class had a loop that was not trimming safe:

	for (var type = GetType (); type != null; type = type.BaseType) {
	    field = type.GetField (fieldName, BindingFlags.Instance | BindingFlags.NonPublic);
	    if (field != null)
	        break;
	}

If we *look* at the actual base types of `AndroidClientHandler`, we
can simplify this loop to something that *is* trimming safe:

	const BindingFlags flags = BindingFlags.Instance | BindingFlags.NonPublic;
	FieldInfo? field = typeof (HttpClientHandler).GetField (fieldName, flags) ??
	    typeof (HttpMessageHandler).GetField (fieldName, flags);

There should be no need to iterate *beyond* `HttpMessageHandler`, the
code is looking for this field:

  * 135fec006e/src/libraries/System.Net.Http/src/System/Net/Http/HttpClientHandler.AnyMobile.cs (L25)

As `AndroidClientHandler` is `[Obsolete]` and unlikely to have its
inheritance hierarchy changed, removing the loop is deemed safe.
2024-02-23 14:24:18 -05:00
dotnet-maestro[bot] 0665f44994
Bump to dotnet/installer/main@0a73f814e1 9.0.100-preview.2.24122.3 (#8716)
Changes: fb7b9a4b9e...0a73f814e1
Changes: d40c654c27...dcc66a7ca2
Changes: 687be2a32a...258b51a8e5
Changes: b8c2293cd1...61250b0ed4

Updates:

* Microsoft.Dotnet.Sdk.Internal: from 9.0.100-preview.2.24106.6 to 9.0.100-preview.2.24122.3
* Microsoft.NETCore.App.Ref: from 9.0.0-preview.2.24080.1 to 9.0.0-preview.2.24122.2
* Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport: from 9.0.0-preview.2.24076.1 to 9.0.0-preview.2.24120.1
* Microsoft.NET.ILLink.Tasks: from 9.0.0-preview.2.24080.1 to 9.0.0-preview.2.24122.2
* Microsoft.DotNet.Cecil: from 0.11.4-alpha.24065.1 to 0.11.4-alpha.24119.1

Other changes:

* Move *ahead* to newest dotnet/runtime build.

Ran `darc update-dependencies --id 213925`, using build ID from:

https://maestro-prod.westus2.cloudapp.azure.com/3883/https:%2F%2Fgithub.com%2Fdotnet%2Fruntime/latest/graph

This picks up a fix for the AOT compiler:

8819b222b3

* Fix assertions in `BuildAotApplicationWithSpecialCharactersInProject` test cases

There are fixes in the AOT compiler to support special characters.

Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
2024-02-23 08:16:48 -06:00
Peter Collins 87d8914eef
[ci] Always run the MAUI test job (#8750)
A new $(RunMAUITestJob) variable has been added to control execution of
the MAUI integration test job.  The value of this variable defaults to
true and it provides an easy way to disable the job on servicing/older
branches if needed.
2024-02-22 12:13:38 -08:00
Marek Habersack 7559d12bdf
Add a property required by #8478 (#8749)
* Add a property required by #8478

Context: https://github.com/xamarin/xamarin-android/pull/8478
Context: https://github.com/xamarin/monodroid/pull/1393

Merging this no-op change will make it easier to orchestrate merging
of the two PRs above.  It allows us to merge the `monodroid` one
before merging #8478 and prevents breaking of any other builds or
PRs in between merging of the two PRs.

* Don't require it yet

* Dummy change to kick-off the build

* Undo the former change
2024-02-22 14:06:40 +00:00
Jonathan Peppers d21f6dbf40
[xamarin-android-tools] import $(LibZipSharpVersion) value (#8738)
Fixes: https://github.com/dotnet/maui/issues/20752

Context: d1ba2ccdd1
Context: 34e98e2b65
Context: https://github.com/xamarin/xamarin-android/pull/8746

`dotnet build` (.NET Core) ignores assembly versions.
`msbuild.exe` (.NET Framework) does not.

Enter d1ba2ccd, which updates the `libZipSharp.dll` assembly version
from 3.0.0.0 to 3.1.1.0.  However, this change only impacted
`Xamarin.Android.Build.Tasks.dll`:

	% monodis --assemblyref bin/Release/lib/packs/Microsoft.Android.Sdk.Darwin/34.99.0/tools/Xamarin.Android.Build.Tasks.dll
	…
	11: Version=3.1.1.0
		Name=libZipSharp
		Flags=0x00000000

It did *not* impact `Microsoft.Android.Build.BaseTasks.dll`, as it
is built by `external/xamarin-android-tools` and was using a
`@(PackageReference)` for libZipSharp 3.0.0:

	% monodis --assemblyref bin/Release/lib/packs/Microsoft.Android.Sdk.Darwin/34.99.0/tools/Microsoft.Android.Build.BaseTasks.dll
	…
	5: Version=3.0.0.0
	        Name=libZipSharp
	        Flags=0x00000000

The resulting NuGet package only contains *one* `libZipSharp.dll`,
the 3.1.1.0 version (what `Xamarin.Android.Build.Tasks.dll` refs).

On PR builds and CI, everything was fine, because all the tests we
have use `dotnet build`, and .NET Core ignores assembly versions.

However, if you use *`msbuild.exe`* to invoke the tasks within
`Microsoft.Android.Build.BaseTasks.dll`, things fail:

	XARLP7028 System.IO.FileNotFoundException: Could not load file or assembly 'libZipSharp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=276db85bc4e20efc' or one of its dependencies.
	The system cannot find the file specified.File name: 'libZipSharp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=276db85bc4e20efc'
	   at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Extract(IDictionary`2 jars, ICollection`1 resolvedResourceDirectories, ICollection`1 resolvedAssetDirectories, ICollection`1 resolvedEnvironments, ICollection`1 proguardConfigFiles)
	   at Xamarin.Android.Tasks.ResolveLibraryProjectImports.RunTask()
	   at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25

Fix this by adding an `external/xamarin-android-tools.override.props`
file (xamarin/xamarin-android-tools@34e98e2b) which imports
`Directory.Build.props`, which causes `$(LibZipSharpVersion)` to be
set so that the xamarin-android-tools build uses values provided by
xamarin-android.

TODO: xamarin/xamarin-android#8746 adds a unit test for the
"build with `msbuild.exe`" scenario.
2024-02-21 15:41:12 -05:00
Jonathan Pobst e199d62210
Bump to xamarin/Java.Interop/main@c825dcad (#8701)
Changes: ae6560976d...c825dcad8e

  * xamarin/java.interop@c825dcad: [Java.Interop.Tools.JavaCallableWrappers] Refactor (xamarin/java.interop#1174)

`Java.Interop.Tools.JavaCallableWrappers.dll` was refactored and now
has a significant API changes.

Bump to xamarin/Java.Interop@c825dcad and update callsites accordingly.
2024-02-21 13:55:08 -05:00
Peter Collins 7680e6ef24
Bump to xamarin/monodroid@cb01503327 (#8742)
Changes: 848d1277b7...cb01503327

  * xamarin/monodroid@cb0150332: Bump external/xamarin-android from `0c0f1fe` to `7368487`
  * xamarin/monodroid@52e7c4c09: Bump external/android-sdk-installer from `4127490` to `13b2fb3`
  * xamarin/monodroid@5003ccb4d: Bump external/android-sdk-installer from `9e143d7` to `4127490`
  * xamarin/monodroid@d7ff10afb: Bump tools/msbuild/external/androidtools from `15350e7` to `8aeb717`
  * xamarin/monodroid@ae8c39d59: Bump external/xamarin-android from `80ee320` to `0c0f1fe`
  * xamarin/monodroid@d76e18694: [tools/msbuild] introduce $(_AndroidAllowJavaDebugging) feature switch
2024-02-21 10:08:31 -08:00
dependabot[bot] fc5506d8f7
Bump to xamarin/Java.Interop/main@ae65609 (#8744)
Changes: 7d1e7057cf...ae6560976d

  * xamarin/java.interop@ae656097: [Java.Interop] restore `IL2035` suppression (xamarin/java.interop#1195)
  * xamarin/java.interop@c6e38933: [Java.Interop] use `Type.GetType()` to find `MarshalMemberBuilder` (xamarin/java.interop#1193)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-21 08:30:50 -05:00
Marek Habersack 39ce2f94ae
Bring in changes from PR #8478 (#8727)
Context: https://github.com/xamarin/xamarin-android/pull/8478

Changes in this commit were originally made in #8478 but aren't
strictly tied to that PR.  To make reviews of #8478 easier, a portion
of changes were extracted and placed here.

Modify the LLVM IR generator to output more readable and compact
code:

  * Use hexadecimal integer notation wherever it makes sense (e.g.
     hashes, managed token IDs)
  * Use boolean literals `true` and `false` instead of previously used
     `1` and `0`, respectively
  * Improve formatting of arrays
  * Introduce arrays which can composed from various "sections",
     each with its own comment and with data provided during the
     generation process, instead of during the preparation phase.

Additional changes:

Extract portions of `MonoAndroidHelper.cs` and place them in a separate
file, `MonoAndroidHelper.Basic.cs` .   Code placed in there provides conversion
between RID, and various forms of Android ABI names as well as `xxHash` functions
used throughout the repository, as well as methods to handle paths of ZIP archive
entries in a uniform way.  #8478 uses these extracted methods in tests, in standalone
utilities in addition to build tasks.

Use maximum LZ4 compression level when compressing assemblies to be placed in
the application APK/AAB archives.
2024-02-21 09:14:27 +00:00
Marek Habersack 82133485cc
[xaprepare] Make 7zip work with "dangerous" symlinks in ZIPs (#8737)
From time to time, `7zip` invoked by `xaprepare` with an error similar to:

    ERROR: Dangerous symbolic link path was ignored : android-ndk-r26c/toolchains/llvm/prebuilt/linux-x86_64/lib/python3.10/site-packages/lldb/lldb-argdumper : ../../../../bin/lldb-argdumper
    ERROR: Dangerous symbolic link path was ignored : android-ndk-r26c/toolchains/llvm/prebuilt/linux-x86_64/lib/python3.10/site-packages/lldb/_lldb.cpython-310-x86_64-linux-gnu.so : ../../../liblldb.so

The problem is that this symlink is **not** a dangerous one, as it doesn't 
point outside the archived directory tree.

This happened on mac, Windows and Linux alike.

Try to work around the issue by using an undocumented `-snld` 7zip option 
when extracting ZIP archives.  Since the option is understood only from
`7-Zip` 20.x, check the version before using the argument.
2024-02-21 08:38:30 +00:00
Marek Habersack 73684872b3
Bump NDK to r26c (#8732)
Changes: https://github.com/android/ndk/wiki/Changelog-r26#r26c

  * Updated LLVM to clang-r487747e. See AndroidVersion.txt and clang_source_info.md 
     in the toolchain directory for version information.
  * [Issue 1928](https://github.com/android/ndk/issues/1928): Fixed Clang crash in 
     instruction selection for 32-bit armv8 floating point.
  * [Issue 1953](https://github.com/android/ndk/issues/1953): armeabi-v7a libc++ 
     libraries are once again built as thumb.

`AndroidVersion.txt` contains:

```
17.0.2
based on r487747e
```
2024-02-19 15:52:38 +00:00
Dean Ellis 0418e7b608
Debugging MSBuild Tasks (#8730)
* Debugging MSBuild Tasks

One thing that is very useful is the ability to debug your Tasks while
they are being run on a build process. This is possible thanks to the
`MSBUILDDEBUGONSTART` environment variable. When set to `2` this will
force MSBuild to wait for a debugger connection before continuing.
You will see the following prompt.

```dotnetcli
Waiting for debugger to attach (dotnet PID 13001).  Press enter to continue...
```

You can then use VS or VSCode to attach to this process and debug you tasks.

In the case of .NET Android we need to do a couple of thing first though. Firstly
we need to disable the use of `ILRepacker` on the `Xamarin.Android.Build.Tasks`
assembly. This is because `ILRepacker` does NOT handle debug symbols very well.
Assemblies it generates seem to be JIT optimized so the debugger will not load
the symbols. A new MSBuild property has been introduced to disable this feature
while debugging. `_ILRepackEnabled` can be set as an environment variable which
MSBuild will pickup.

```dotnetcli
make prepare && _ILRepackEnabled=false make jenkins
```

This will disable the `ILRepacker` for the build.

You can then start your test app with the `dotnet-local` script (so it uses your build)

```dotnetcli
MSBUILDDEBUGONSTART=2 ~/<some xamarin.android checkout>/dotnet-local.sh build -m:1
```

Once MSBuild starts it will print the following

```dotnetcli
Waiting for debugger to attach (dotnet PID xxxx).  Press enter to continue...
```

You need to copy the PID value so we can use this in the IDE. For Visual Studio you can use the `Attach to Process` menu option, while you have the Xamarin.Android.sln solution open. For VSCode open the workspace then use the `Debug MSBuild Task` Run and Debug option. You will be prompted for the PID and it will then connect.

Once connection go back to your command prompt and press ENTER so that the MSBuild process can continue.

You will be able to set breakpoints in Tasks (but not Targets) and step through code from this point on.
2024-02-19 13:08:56 +00:00
Marek Habersack e987ac4585
[xabuild] Remove xabuild, unused pipelines (#8720)
Context: 4b33a6229c

Remove `tools/xabuild` completely.  It is no longer required; use
`dotnet-local.*` instead (4b33a622).

Additionally, remove unneeded pipelines.  `build.groovy` and
`azure-pipelines-oss.yaml` (among others) haven't been executed in
*years*; there is no need to keep these files around.
2024-02-15 18:36:06 -05:00
Dean Ellis d1ba2ccdd1
Bump to xamarin/LibZipSharp/3.1.1@7abbbf4 (#8723)
Changes: https://github.com/xamarin/LibZipSharp/compare/3.0.0...3.1.1

  * xamarin/LibZipSharp@7abbbf4: Bump Version to 3.1.1 (xamarin/LibZipSharp#136)
  * xamarin/LibZipSharp@ca8a64a: [CMake] Add /PROFILE to MSVC link flags (xamarin/LibZipSharp#134)
  * xamarin/LibZipSharp@22957e4: Bump to microsoft/vcpkg@c8696863d3 (xamarin/LibZipSharp#133)
  * xamarin/LibZipSharp@ed2ccd5: A round of library version updates (xamarin/LibZipSharp#131)

Various compiler and linker flag changes to assist APIScan.
2024-02-15 15:26:50 -05:00
dependabot[bot] ef258f42cd
Bump to xamarin/java.interop/main@7d1e705 (#8722)
Changes: b8f6f8884a...7d1e7057cf

* xamarin/java.interop@7d1e705  [Java.Interop] ignore remaining trimming warnings (xamarin/java.interop#1190)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-15 08:45:19 -06:00
dependabot[bot] 3b5fa9d6ed
Bump to xamarin/Java.Interop/main@b8f6f88 (#8718)
Changes: dfcbd67030...b8f6f8884a

  * xamarin/java.interop@b8f6f888: [Java.Interop] address some "easy" trimmer warnings (xamarin/java.interop#1184)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-14 15:29:18 -05:00
Jonathan Peppers 0200a893c1
[Microsoft.Android.Sdk.ILLink] remove Java.Interop.Export reference (#8719)
It appears this is not needed?
2024-02-14 15:27:46 -05:00
Marek Habersack 71b6fcc92f
[tmt] Update to work with current `libxamarin-app.so` (#8694)
Context: 46f10fe0a5
Context? 68368189d6

`tools/tmt` (46f10fe0) is a utility to print typemap entries contained
within an application.

`tools/tmt` no longer supports dumping typemap entries; it was
possibly broken in 68368189:

	% ./dotnet-local.sh build tools/tmt/*.csproj
	% ./dotnet-local.sh build -c Release samples/HelloWorld/HelloWorld/HelloWorld.DotNet.csproj
	% bin/Debug/bin/tmt samples/HelloWorld/HelloWorld/bin/Release/net9.0-android/*-Signed.apk
	No type maps found in 'samples/HelloWorld/HelloWorld/bin/Release/net9.0-android/com.xamarin.android.helloworld-Signed.apk'

Update the `tools/tmt` utility to support the current format of
typemaps within `libxamarin-app.so`, and update it to generate nicely
formatted Markdown report files instead of the text file output:

	% bin/Debug/bin/tmt samples/HelloWorld/HelloWorld/bin/Release/net9.0-android/*-Signed.apk
	samples/HelloWorld/HelloWorld/bin/Release/net9.0-android/com.xamarin.android.helloworld-Signed.apk!lib/arm64-v8a/libxamarin-app.so:
	  File Type: Xamarin App Release DSO
	  Format version: 2
	  Map kind: Release
	  Map architecture: ARM64
	  Managed to Java entries: 56
	  Java to Managed entries: 46 (without duplicates)
	…

`typemap-v2-Release-ARM64.md` will be created (among other files)
which contains the actual typemap data, in Markdown tabular form:

> # Java to Managed

> | Java type name                                     | Managed type name                                                | Type token ID         | Is Generic?      | MVID                                 |
> | -------------------------------------------------- | ---------------------------------------------------------------- | --------------------- | ---------------- | ------------------------------------ |
> | android/app/Activity                               | Android.App.Activity, Mono.Android                               | 0x02000042 (33554498) | no               | 33da2efb-61bb-4fd5-b529-2dee309a3d65 |
> …
> | java/lang/Object                                   | Java.Lang.Object, Mono.Android                                   | 0x0200008B (33554571) | no               | 33da2efb-61bb-4fd5-b529-2dee309a3d65 |
> …

> # Managed to Java

> | Managed type name                                                       | Java type name                                     | Type token ID         | Is Generic? | Is Duplicate? | MVID                                 |
> | ----------------------------------------------------------------------- | -------------------------------------------------- | --------------------- | ----------- | ------------- | ------------------------------------ |
> | HelloLibrary.LibraryActivity, HelloLibrary.DotNet                       | mono/samples/hello/LibraryActivity                 | 0x02000002 (33554434) | no          | false         | ca140934-068f-47d0-a861-6179233e49aa |
> …
2024-02-14 14:00:12 -05:00
Jonathan Peppers 5472eec991
[Xamarin.Android.Build.Tasks] remove `$(AndroidSupportedAbis)` from `build.props` (#8717)
Fixes: https://developercommunity.visualstudio.com/t/Visual-Studio-2022-Community-1785-ver/10577484
Related: https://github.com/xamarin/xamarin-android/issues/8662

I found the following build performance issue using a .NET Android
project template inside VS Windows:

1. Create a new .NET Android project

2. Open some `AndroidResource` `.xml` file in the Android designer

3. *Every* incremental build appears to rebuild everything!

`obj\Debug\net8.0-android\build.props` appears to be changing between
builds with the change:

```diff
--androidsupportedabis=armeabi-v7a;arm64-v8a;x86;x86_64
++androidsupportedabis=arm64-v8a
```

I narrowed this down to the designer running two targets,
`PrepareResources;_GenerateCompileInputs`:

7b167eae94/src/Xamarin.Designer.Android/Xamarin.AndroidDesigner/MSBuildConstants.cs (L32)

In this example:

* The designer does *not* mark the build as a "design-time build" with
  `-p:DesignTimeBuild=true`. This would have used a design-time `build.props`.

* The designer does *not* pass in the selected Android device.

This code is *ancient*, so I suspect this has just always been an
issue? Perhaps, it only occurs in .NET 6+ projects and not
Xamarin.Android?

Because `$(AndroidSupportedAbis)` is not a "supported" thing in .NET
6+, let's just remove it?

Removing `$(AndroidSupportedAbis)` from this file manually does fix
the problem for me locally:

    C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.52\tools\Xamarin.Android.Common.targets

There is also a *second* `adb.props` file that triggers a subset of
things to rebuild if the selected Android device changes:

	<WriteLinesToFile
			File="$(_AdbPropertiesCache)"
			Lines="AdbTarget=$(AdbTarget);AdbOptions=$(AdbOptions)"

Usage of the new property, `$(RuntimeIdentifier)`, also changes
`$(IntermediateOutputPath)`, so I feel like we shouldn't need this
value in `build.props` in a .NET 6+ world.
2024-02-13 09:24:41 +00:00
Jonathan Peppers 55b47f1c71
[Xamarin.Android.Build.Tasks] BannedApiAnalyzers for Resolve() (#8715)
Context: 68c643b466/src/Microsoft.CodeAnalysis.BannedApiAnalyzers/BannedApiAnalyzers.Help.md
Context: 526172b431

In 526172b4, we had some reasonable performance wins just by using
`TypeDefinitionCache`.  Let's take this a step further by "banning"
usage of the methods:

  * `Mono.Cecil.FieldReference.Resolve()`
  * `Mono.Cecil.MethodReference.Resolve()`
  * `Mono.Cecil.TypeReference.Resolve()`

I applied this change to `Xamarin.Android.Build.Tasks.csproj` for now.

In various places, I had to pass `TypeDefinitionCache` around or use
an existing one.

In a future PR, I'll make a small change in xamarin/java.interop so we
can apply the same treatment to `Microsoft.Android.Sdk.ILLink.csproj`.
2024-02-12 19:36:47 -05:00
Jonathan Pryor b812506b9c
Bump to xamarin/Java.Interop/main@dfcbd670 (#8714)
Changes: 7f08b77f34...dfcbd67030

  * xamarin/Java.Interop@dfcbd670: Bump to xamarin/xamarin-android-tools/main@a698a33 (xamarin/Java.Interop#1189)
  * xamarin/Java.Interop@6182baff: [build] Target `net8.0` (xamarin/Java.Interop#1186)

xamarin/java.interop@6182baff updated Java.Interop to target .NET 8
instead of .NET 7.  This introduced a build break:

	…/xamarin-android/src/Mono.Android/Mono.Android.csproj(402,5):
	  error MSB3030: Could not copy the file
	  "…/xamarin-android/external/Java.Interop/bin/Debug-net7.0/ref/Java.Interop.dll"
	  because it was not found.

Introduce a new `$(JavaInteropTargetFrameworkVersion)` MSBuild
property within `Configuration.props` which contains the .NET version
that Java.Interop is targeting.

Update `Mono.Android.csproj` and `Microsoft.Android.Ref.proj` so that
they use `$(JavaInteropTargetFrameworkVersion)` to locate the
reference `Java.Interop.dll` assembly.
2024-02-09 15:12:47 -05:00
Marek Habersack 3212213e4e
[monodroid] C++ tweaks and legacy code cleanup (#8638)
Remove old and unused code originally written for:

  * Classic Xamarin.Android
  * [Xamarin.Android Designer][0] on Windows
  * Xamarin.Android Designer on macOS

Remove a collection of platform and compiler compatibility macros,
typedefs and wrapper functions.

Migrate from `char` arrays to `std::string_view` for more strongly
typed code.

Move `-fstack-clash-protection` from `LOCAL_COMMON_COMPILER_ARGS` to
`LOCAL_COMMON_LINKER_ARGS`; it's a linker flag.

Use `#pragma clang diagnostic ignored "-Warray-bounds"` around
certain "MonoVM-isms" in the GC bridge to silence array bounds
checking warnings.

Refactor to use new(er) C++ types such as `std::span`, `std::array`,
and `std::string_view`.  This helps reduce memory allocations in some
scenarios, allows usage of the newer `for (e : collection)` syntax,
and increases type safety.

[0]: ff833dc5af/docs/android/user-interface/android-designer/designer-basics.md
2024-02-09 15:12:15 -05:00
dependabot[bot] 1ead0c6ebc
Bump to xamarin/xamarin-android-tools/main@a698a33 (#8710)
Changes: ed102fc908...a698a33aa4

  * xamarin/xamarin-android-tools@a698a33: Merge pull request xamarin/xamarin-android-tools#227 from xamarin/dev/jestedfa/uses-sdk
  * xamarin/xamarin-android-tools@8b13954: Added unit tests
  * xamarin/xamarin-android-tools@84c2911: Only conditionally include <uses-sdk /> in the AndroidManifest.xml when saving

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-09 13:21:36 -05:00
Jonathan Pobst f9a6c8ae1c
[readme] Add `d17-8` download links. (#8709)
Fixes: https://github.com/xamarin/xamarin-android/issues/8708

Add README links to Android SDK 13.2.2 packages. (The most recent available.)

Also, remove mention of OSS packages, as the pipeline has not run in 2 years.
2024-02-08 15:30:46 -10:00
dependabot[bot] fd20498400
Bump external/Java.Interop from `07c7300` to `7f08b77` (#8702)
Bumps [external/Java.Interop](https://github.com/xamarin/java.interop) from `07c7300` to `7f08b77`.
- [Commits](07c7300957...7f08b77f34)

---
updated-dependencies:
- dependency-name: external/Java.Interop
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-08 10:23:41 -10:00
Peter Collins 0c0f1feb22
Bump to xamarin/monodroid/main@848d1277b7 (#8691)
Changes: 66a65e3b3e...848d1277b7

The `<_InstallAndroidJdk/>` target has been removed from the
`<InstallAndroidDependencies/>` target, as Java SDK installation support
has been added to `Xamarin.Installer.Build.Tasks`.

Changes in monodroid:

* Bump external/xamarin-android from a2472a1 to 87341cc (#1417)

* Bump tools/msbuild/external/androidtools from 5bd9cb3 to 34aa04b (#… 

* Bump external/android-sdk-installer from 4b563c7 to b9665c8 (#1416)

* Bump tools/msbuild/external/androidtools from 34aa04b to fa69e26 (#… 

* [ci] Use NuGetAuthenticate@1 (#1421) 

* Bump tools/msbuild/external/androidtools from fa69e26 to 21f6c6f 

* Bump external/xamarin-android from 87341cc to 80ee320

* Bump to xamarin/android-sdk-installer@9e143d7298
2024-02-07 21:55:33 -06:00
Jonathan Peppers 526172b431
[Xamarin.Android.Build.Tasks] `FixAbstractMethodsStep` performance (#8650)
Context: https://github.com/xamarin/xamarin-android/issues/8421

Working a bit on build performance, I tested:

  * `dotnet new maui`

  * `dotnet build -bl`

The `.binlog` shows:

	LinkAssembliesNoShrink 3.797s

Attaching `dotnet-trace` as mentioned on:

2f192386e8/Documentation/guides/tracing.md (how-to-dotnet-trace-our-build)

I see time broken down such as:

	FixAbstractMethods: 37%
	AssemblyDefinition.Write: 27%
	ProcessAssemblyDesigner: 20%
	CopyIfChanged: 13%
	DirectoryAssemblyResolver.GetAssembly: 4.4%

This made me focus in on `FixAbstractMethodsStep` and make the
following changes:

  * All calls for `TypeReference.Resolve()` and
    `MethodReference.Resolve()` should go through the
    `TypeDefinitionCache` to avoid repeated lookups.

  * `IsInOverrides()` can compare the `MethodReference.Name` before
    calling `Resolve()`.  It could resolve many unnecessary methods
    otherwise.

After these changes, I instead see from `dotnet-trace`:

	--1.45s (3.7%)    xamarin.android.build.tasks!MonoDroid.Tuner.FixAbstractMethodsStep.FixAbstractMethods()
	++949.70ms (2.5%) xamarin.android.build.tasks!MonoDroid.Tuner.FixAbstractMethodsStep.FixAbstractMethods()

Time is now broken down differently, such as:

	AssemblyDefinition.Write: 31%
	FixAbstractMethods: 28%
	ProcessAssemblyDesigner: 23%
	CopyIfChanged: 12%
	DirectoryAssemblyResolver.GetAssembly: 4.8%

In an overall `.binlog` (without `dotnet-trace` attached):

	--LinkAssembliesNoShrink 3.797s
	++LinkAssembliesNoShrink 3.105s

This saved ~700ms on initial build of a new MAUI project.
2024-02-07 11:23:54 -05:00
dotnet-maestro[bot] dbefbad787
Bump to dotnet/installer/main@fb7b9a4b9e 9.0.100-preview.2.24106.6 (#8700)
Changes: 1c496970b7...fb7b9a4b9e
Changes: bcc1d3d6f0...d40c654c27
Changes: ae7c93e25a...687be2a32a

Updates:

* Microsoft.Dotnet.Sdk.Internal: from 9.0.100-preview.2.24078.1 to 9.0.100-preview.2.24106.6
* Microsoft.NETCore.App.Ref: from 9.0.0-preview.2.24076.4 to 9.0.0-preview.2.24080.1
* Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport: from 9.0.0-alpha.1.24072.1 to 9.0.0-preview.2.24076.1
* Microsoft.NET.ILLink.Tasks: from 9.0.0-preview.2.24076.4 to 9.0.0-preview.2.24080.1
2024-02-07 08:32:33 -06:00
Jonathan Pobst 0c495deebd
[Mono.Android] Cache `Profiles/api-34.xml` contents (#8679)
Previously, we would regenerate `api.xml` for `Mono.Android` API-34
on every build.

This involves:

  - Installing Android SDK platforms 23 - 34 (2.2 GB)
  - Running `class-parse` on every API level
  - Running `api-xml-adjuster` on every API level
  - Running `api-merge` to merge every level into a single `api.xml`

However, the output ~never changes, as the Android API should not
change once it has shipped.  Thus, we can save disk space and build
time by committing a completed `api.xml` instead of rebuilding it.

Additionally, `xaprepare` no longer installs all Android SDK Platforms
by default.  Instead it defaults to only installing the latest stable
version and any unstable preview version(s).

A new `xaprepare -android-sdk-platforms=all` command line option is
added to request all platforms be installed instead.

Updated the `HowTo: Add a new Android API Level` document to instruct
how to generate a new `api.xml`.

This saves:

  - ~1 minute on the macOS Build (where all platform SDKs are already
    installed because we reuse CI agents)

  - ~16 minutes on Windows Builds with fresh CI agents (where we
    previously had to download all the platform SDKs)
2024-02-05 21:38:08 -05:00
dependabot[bot] 06b1d7f821
[monodroid] typemaps may need to load assemblies (#8625)
Context: 005c914170
Context: https://github.com/xamarin/java.interop/pull/1181
Context: 25d1f007a7

When attempting to bump to xamarin/java.interop@005c9141, multiple
unit tests would fail, e.g.

	Java.Lang.LinkageError : net.dot.jni.test.CallVirtualFromConstructorDerived
	----> System.NotSupportedException : Could not find System.Type corresponding to Java type JniTypeSignature(TypeName=net/dot/jni/test/CallVirtualFromConstructorDerived ArrayRank=0 Keyword=False) .

This happened because xamarin/java.interop@005c9141 implicitly
required that typemaps exist for `Java.Interop.JavaObject` subclasses.

Fair enough; enter xamasrin/java.interop#1181, which added support to
`Java.Interop.Tools.JavaCallableWrappers` to emit typemaps for
`Java.Interop.JavaObject` subclasses.

That caused *crashes* in `tests/Mono.Android-Tests`:

	E droid.NET_Test: JNI ERROR (app bug): accessed stale Local 0x75  (index 7 in a table of size 7)
	F droid.NET_Test: java_vm_ext.cc:570] JNI DETECTED ERROR IN APPLICATION: use of deleted local reference 0x75
	…
	F droid.NET_Test: runtime.cc:630]   native: #13 pc 00000000003ce865  /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::CheckJNI::GetObjectClass(_JNIEnv*, _jobject*)+837)

The immediate cause of the crash was a "use after free" bug within
`TypeManager.CreateInstance()` in a never-hit-before error path; the
"use after free" bug was fixed in 25d1f007.

However, the cause of the hitting a never-hit-before error path is
because `EmbeddedAssemblies::typemap_java_to_managed()` would only
map Java types to `System.Type` instances for assemblies that have
*already been loaded*.  If the assembly had not yet been loaded, then
`EmbeddedAssemblies::typemap_java_to_managed()` would return `null`,
and if the binding it couldn't find happens to be for
`java.lang.Object`, we hit the (buggy!) "Where is the Java.Lang.Object
wrapper" error condition.

Commit 25d1f007 fixes that and a great many other related issues.

What's left is `EmbeddedAssemblies::typemap_java_to_managed()`:
it should *never* return null *unless* there is no typemap at all.
Whether the target assembly has been loaded or not should be
irrelevant.

Update `EmbeddedAssemblies::typemap_java_to_managed()` so that it
will load the target assembly if necessary.

Additionally, before we figured out that we had a "use after free"
bug, all we had to go on was that *something* related to
`JNIEnv::GetObjectClass()` was involved.  Review JNI usage around
`JNIEnv::GetObjectClass()` and related invocations, and cleanup:

  * Simplify logic related to `JNIEnv::DeleteLocalRef()`.
  * Decrease scope of local variables.
  * Clear variables passed to `JNIEnv.DeleteLocalRef()`.

Co-authored-by: Jonathan Pryor <jonpryor@vt.edu>
Co-authored-by: Marek Habersack <grendel@twistedcode.net>
2024-02-02 16:28:46 -05:00
Jonathan Peppers bf73889a48
Bump $(AndroidNetPreviousVersion) to 34.0.79 (#8693)
Context: fd47b02761
Context: https://dotnet.microsoft.com/platform/support/policy/maui

Changes: d12da3a1...87e4a6d8

  * xamarin/xamarin-android@87e4a6d89: [release/8.0.1xx] localization changes for `XA1039` (xamarin/xamarin-android#8674)
  * xamarin/xamarin-android@f61c76030: [workload] Allow installation on linux-arm64 (xamarin/xamarin-android#8500)
  * xamarin/xamarin-android@4cdf1e018: [Xamarin.Android.build.Tasks] `<CheckDuplicateJavaLibraries/>` ignores `repackaged.jar` (xamarin/xamarin-android#8664)
  * xamarin/xamarin-android@77ac82a11: [release/8.0.1xx] [Xamarin.Android.Build.Tasks] XA1039 warning for Android.Support (xamarin/xamarin-android#8648)
  * xamarin/xamarin-android@c22c17fbe: [Xamarin.Android.Build.Tasks] fix warning when missing `proguard-android.txt` (xamarin/xamarin-android#8641)
  * xamarin/xamarin-android@31f031a67: Localized file check-in by OneLocBuild Task (xamarin/xamarin-android#8643)
  * xamarin/xamarin-android@3da479192: LEGO: Merge pull request 8642
  * xamarin/xamarin-android@dbf100d49: Update a number of l18n files (xamarin/xamarin-android#8633)
  * xamarin/xamarin-android@d2da5bf4e: Bump com.android.tools:r8 from 8.1.72 to 8.2.33 (xamarin/xamarin-android#8577)
  * xamarin/xamarin-android@9f9114afc: Bump com.android.tools:r8 from 8.1.56 to 8.1.72 (xamarin/xamarin-android#8532)
  * xamarin/xamarin-android@666777248: Fix ServerCertificateCustomValidator on API 21-23 (xamarin/xamarin-android#8637)
  * xamarin/xamarin-android@940f059b8: [Mono.Android] Fix ServerCertificateCustomValidator (xamarin/xamarin-android#8594)
  * xamarin/xamarin-android@351bfa3f0: Bump to dotnet/runtime/release/8.0@a6e4834d53 8.0.1 (xamarin/xamarin-android#8616)
  * xamarin/xamarin-android@64363367d: [Microsoft.Android.Templates] New files should open editor (xamarin/xamarin-android#8623)
  * xamarin/xamarin-android@26752564d: Bump to dotnet/installer@461c776642 8.0.101-servicing.23614.6
  * xamarin/xamarin-android@6972027f0: Localized file check-in by OneLocBuild Task (xamarin/xamarin-android#8589)
  * xamarin/xamarin-android@73efcfcad: [Xamarin.Android.Buid.Tasks] don't set $(PublishSelfContained) for .NET 9 (xamarin/xamarin-android#8565)
  * xamarin/xamarin-android@3333306b8: LEGO: Merge pull request 8587
  * xamarin/xamarin-android@38e950b41: Localized file check-in by OneLocBuild Task (xamarin/xamarin-android#8576)
  * xamarin/xamarin-android@607115fd5: LEGO: Merge pull request 8575
  * xamarin/xamarin-android@a1fd1b2cb: Localized file check-in by OneLocBuild Task (xamarin/xamarin-android#8570)
  * xamarin/xamarin-android@c020626b0: [Xamarin.Android.Build.Tasks] Update XA5207 for VSCode (xamarin/xamarin-android#8494)
  * xamarin/xamarin-android@b0aab545a: Bump to dotnet/installer/release/8.0.1xx@822071c28a 8.0.101-servicing.23578.14 (xamarin/xamarin-android#8558)


The .NET MAUI Support policy, which covers .NET Android, states:

> A major version of .NET MAUI receives support for a minimum of 6
> months after a successor (the next major release) ships.

meaning that a given version of .NET Android only needs to support
building `$(TargetFramework)` values for the current .NET Android
version and the previous .NET Android version.

Meanwhlie, from fd47b027:

> We currently have a hard dependency between:
> 
>   * `Xamarin.Android.Build.Tasks.dll`
>   * `libmonodroid.so`

…in order to safely build projects targeting the previous .NET Android
version with the current .NET Android version, the current .NET Android
version workload *includes the previous workload version contents*.

The `$(AndroidNetPreviousVersion)` MSBuild property specifies the
.NET Android SDK version, as obtained from `dotnet workllad list`,
which should be used to build previous `$(TargetFramework)` versions.

`$(AndroidNetPreviousVersion)` should be updated in
xamarin-android/main whenever a .NET servicing release for the previous
.NET version is shipped.

.NET Android 34.0.79 will be shipped as part of .NET 8.0.2.
Update `$(AndroidNetPreviousVersion)` to so that .NET 9 previews use
the latest .NET 8 workload contents.
2024-02-02 13:33:49 -05:00
Jonathan Pryor 25d1f007a7
Bump to xamarin/java.interop/main@07c73009 (#8681)
Context: https://github.com/xamarin/java.interop/issues/1165
Context: 005c914170
Context: https://github.com/xamarin/xamarin-android/pull/8543
Context: 07c7300957
Context: https://github.com/xamarin/xamarin-android/pull/8625
Context: e3e4f123d8
Context: a04b73b30e
Context: efbec22767

Changes: 8b85462e5f...07c7300957

  * xamarin/java.interop@07c73009: [Java.Interop] Typemap support for JavaObject & `[JniTypeSignature]` (xamarin/java.interop#1181)
  * xamarin/java.interop@d529f3be: Bump to xamarin/xamarin-android-tools/main@ed102fc (xamarin/java.interop#1182)
  * xamarin/java.interop@def5bc0d: [ci] Add API Scan job (xamarin/java.interop#1178)
  * xamarin/java.interop@d5afa0af: [invocation-overhead] Add generated source files (xamarin/java.interop#1175)
  * xamarin/java.interop@473ef74c: Bump to xamarin/xamarin-android-tools/main@4889bf0 (xamarin/java.interop#1172)
  * xamarin/java.interop@005c9141: [Java.Interop] Avoid `Type.GetType()` in `ManagedPeer` (xamarin/java.interop#1168)
  * xamarin/java.interop@0f1efebd: [Java.Interop] Use PublicApiAnalyzers to ensure we do not break API (xamarin/java.interop#1170)

(From the "infinite scream" department…)

It started with a desire to remove some linker warnings
(xamarin/java.interop#1165):

	external/Java.Interop/src/Java.Interop/Java.Interop/ManagedPeer.cs(93,19,93,112):
	warning IL2057: Unrecognized value passed to the parameter 'typeName' of method 'System.Type.GetType(String, Boolean)'.
	It's not possible to guarantee the availability of the target type.

xamarin/java.interop@005c9141 attempted to fix this by requiring the
use of "typemaps" mapping Java type signatures to managed types,
replacing e.g.:

	Type            type            = Type.GetType ("Example.Type, AssemblyName", throwOnError: true)!;
	Type[]          parameterTypes  = GetParameterTypes ("System.Int32:System.Int32");
	ConstructorInfo ctor            = type.GetConstructor (ptypes);
	// ctor=Example.Type(int, int) constructor

with (not exactly, but for expository purposes):

	Type            type            = GetTypeFromSignature("crc64…/Type");
	Type[]          parameterTypes  = GetConstructorCandidateParameterTypes ("(II)V");
	ConstructorInfo ctor            = type.GetConstructor (ptypes);
	// ctor=Example.Type(int, int) constructor
	
among other changes.

This was a *significant* change that would alter *Java.Interop*
semantics but *not* .NET Android semantics -- .NET Android uses
`Java.Interop.TypeManager.n_Activate()` (in this repo) for Java-side
"activation" scenarios, not `Java.Interop.ManagedPeer` -- so in an
abundance of caution we did a manual integration test in
xamarin/xamarin-android#8543 to make sure nothing broke before
merging it.

Something was apparently "off" in that integration.  (We're still not
sure what was off, or why it was completely green.)

Ever since xamarin/java.interop@005c9141 was merged, every attempt to
bump xamarin/Java.Interop has failed, in a number of ways described
below.  However, instead of reverting xamarin/java.interop@005c9141
we took this as an opportunity to understand *how and why* things
were failing, as apparently we had encountered some *long-standing*
corner cases in How Things Work.

The oversights and failures include:

 1. In order to make the Java.Interop unit tests work in .NET Android,
    the (largely hand-written) Java.Interop test types *also* need to
    participate with .NET Android typemap support, so that there is a
    typemap entry mapping `net/dot/jni/test/GenericHolder` to
    `Java.InteropTests.GenericHolder<T>` and vice-versa.

    xamarin/java.interop@07c73009 updates
    `Java.Interop.Tools.JavaCallableWrappers` to support creating
    typemap entries for `Java.Interop.JavaObject` subclasses,
    introducing a new `TypeDefinition.HasJavaPeer()` extension method.

 2. (1) meant that, for the first time ever, types in
    `Java.Interop-Tests` participated in .NET Android type mapping.
    This *sounds* fine, except that `Java.Interop-Tests` contains
    "competing bindings" for `java.lang.Object`:

        [JniTypeSignature ("java/lang/Object", GenerateJavaPeer=false)]
        partial class JavaLangRemappingTestObject : JavaObject {
        }

 3. (2) means that, for the first time ever, we *could* have the
    typemap entry for `java/lang/Object` map to
    `Java.InteropTests.JavaLangRemappingTestObject, Java.Interop-Tests`,
    *not* `Java.Lang.Object, Mono.Android`.

    Arguably a bug, arguably "meh", but this setup triggered some
    never previously encountered error conditions:

 4. `EmbeddedAssemblies::typemap_java_to_managed()` within
    `libmonodroid.so` returns a `System.Type` that corresponds to a
    JNI type.  `typemap_java_to_managed()` has a bug/corner case
    wherein it will only provide `Type` instances from assemblies
    which have already been loaded.

    Early in startup, `Java.Interop-Tests` hasn't been loaded yet, so
    when `java/lang/Object` was mapped to
    `Java.InteropTests.JavaLangRemappingTestObject, Java.Interop-Tests`,
    `typemap_java_to_managed()` would return `null`.

    This is a bug/corner case, which is being investigated in
    xamarin/xamarin-android#8625.

 5. Calls to `Java.Lang.Object.GetObject<T>()` call
    `Java.Interop.TypeManager.CreateInstance()`, which loops through
    the type and all base types to find a known binding/wrapper.
    Because of (3)+(4), if (when) we try to find the wrapper for
    `java/lang/Object`, we would find *no* mapping.

    This would cause an `JNI DETECTED ERROR IN APPLICATION` *crash*.

    This was due to a "use after free" bug.

    See the "TypeManager.CreateInstance() Use After Free Bug" section.

 6. Once (5) is fixed we encounter our next issue: the
    `Java.InteropTests.JnienvTest.NewOpenGenericTypeThrows()` unit
    test started failing because
    `crc641855b07eca6dcc03.GenericHolder_1` couldn't be found.

    This was caused by a bug in `acw-map.txt` parsing within `<R8/>`.

    See the "`<R8/>` and `acw-map.txt` parsing.`" section.

 7. Once (6) was fixed, (3) caused a *new* set of failures:
    multiple tests started failing because `java/lang/Object` was
    being mapped to the wrong managed type.

    (3) becomes less "meh" and more "definitely a bug".

    See the "Correct `java/lang/Object` mappings" section.

*Now* things should work reliably.


~~ TypeManager.CreateInstance() Use After Free Bug ~~

On 2011-Oct-19, xamarin/monodroid@e3e4f123d8 introduced a
use-after-free bug within `TypeManager.CreateInstance()`:

	JNIEnv.DeleteRef (handle, transfer);
	throw new NotSupportedException (
	        FormattableString.Invariant ($"Internal error finding wrapper class for '{JNIEnv.GetClassNameFromInstance (handle)}'. (Where is the Java.Lang.Object wrapper?!)"),
	        CreateJavaLocationException ());

`handle` *cannot be used* after `JNIEnv.DeleteRef(handle)`.
Failure to do so results in a `JNI DETECTED ERROR IN APPLICATION`
crash; with `adb shell setprop debug.mono.log lref+` set, we see:

	I monodroid-lref: +l+ lrefc 1 handle 0x71/L from thread '(null)'(1)
	D monodroid-gref:    at Android.Runtime.AndroidObjectReferenceManager.CreatedLocalReference(JniObjectReference , Int32& )
	D monodroid-gref:    at Java.Interop.JniRuntime.JniObjectReferenceManager.CreatedLocalReference(JniEnvironmentInfo , JniObjectReference )
	D monodroid-gref:    at Java.Interop.JniEnvironment.LogCreateLocalRef(JniObjectReference )
	D monodroid-gref:    at Java.Interop.JniEnvironment.LogCreateLocalRef(IntPtr )
	D monodroid-gref:    at Java.Interop.JniEnvironment.InstanceMethods.CallObjectMethod(JniObjectReference , JniMethodInfo )
	D monodroid-gref:    …
	…
	I monodroid-lref: -l- lrefc 0 handle 0x71/L from thread '(null)'(1)
	D monodroid-gref:    at Android.Runtime.AndroidObjectReferenceManager.DeleteLocalReference(JniObjectReference& , Int32& )
	D monodroid-gref:    at Java.Interop.JniRuntime.JniObjectReferenceManager.DeleteLocalReference(JniEnvironmentInfo , JniObjectReference& )
	D monodroid-gref:    at Java.Interop.JniObjectReference.Dispose(JniObjectReference& reference)
	D monodroid-gref:    at Android.Runtime.JNIEnv.DeleteLocalRef(IntPtr )
	D monodroid-gref:    at Android.Runtime.JNIEnv.DeleteRef(IntPtr , JniHandleOwnership )
	D monodroid-gref:    at Java.Interop.TypeManager.CreateInstance(IntPtr , JniHandleOwnership , Type )
	D monodroid-gref:    at Java.Lang.Object.GetObject(IntPtr , JniHandleOwnership , Type )
	D monodroid-gref:    at Java.Lang.Object._GetObject[IIterator](IntPtr , JniHandleOwnership )
	D monodroid-gref:    at Java.Lang.Object.GetObject[IIterator](IntPtr handle, JniHandleOwnership transfer)
	D monodroid-gref:    …
	D monodroid-gref:
	E droid.NET_Test: JNI ERROR (app bug): accessed stale Local 0x71  (index 7 in a table of size 7)
	F droid.NET_Test: java_vm_ext.cc:570] JNI DETECTED ERROR IN APPLICATION: use of deleted local reference 0x71
	…
	F droid.NET_Test: runtime.cc:630]   native: #13 pc 00000000003ce865  /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::CheckJNI::GetObjectClass(_JNIEnv*, _jobject*)+837)

The immediate fix is Don't Do That™; use a temporary:

	class_name = JNIEnv.GetClassNameFromInstance (handle);
	JNIEnv.DeleteRef (handle, transfer);
	throw new NotSupportedException (
	        FormattableString.Invariant ($"Internal error finding wrapper class for '{class_name}'. (Where is the Java.Lang.Object wrapper?!)"),
	        CreateJavaLocationException ());

Unfortunately, *just* fixing the "use-after-free" bug is insufficient;
if we throw that `NotSupportedException`, things *will* break
elsewhere.  We'll just have an "elegant unhandled exception" app crash
instead of a "THE WORLD IS ENDING" failed assertion crash.

We could go with the simple fix for the crash, but this means that in
order to integrate xamarin/java.interop@005c9141 &
xamarin/java.interop@07c73009 we'd have to figure out how to *ensure*
that `java/lang/Object` is bound as `Java.Lang.Object, Mono.Android`,
not `Java.InteropTests.JavaLangRemappingTestObject, Java.Interop-Tests`.
(We actually need to do this *anyway*; see the
"Correct `java/lang/Object` mappings" section.  At the time we I was
trying to *avoid* special-casing `Mono.Android.dll`…)

There is a*slightly* more complicated approach which fixes (5)
while supporting (4) `typemap_java_to_managed()` returning null;
consider the `-l-` callstack:

	at Android.Runtime.JNIEnv.DeleteRef(IntPtr , JniHandleOwnership )
	at Java.Interop.TypeManager.CreateInstance(IntPtr , JniHandleOwnership , Type )
	at Java.Lang.Object.GetObject(IntPtr , JniHandleOwnership , Type )
	at Java.Lang.Object._GetObject[IIterator](IntPtr , JniHandleOwnership )
	at Java.Lang.Object.GetObject[IIterator](IntPtr handle, JniHandleOwnership transfer)
	at Android.Runtime.JavaSet.Iterator()

This is part of a generic `Object.GetObject<IIterator>()` invocation!
Additionally, because `IIterator` is an interface, in *normal* use
the `type` variable within `TypeManager.CreateInstance()` would be
`Java.Lang.Object, Mono.Android` and then *immediately discarded*
because `Java.Lang.Object` cannot be assigned to `IIterator`.

Moving the type compatibility check to *before* the
`type == null` check fixes *an* issue with `typemap_java_to_managed()`
returning null.


~~ `<R8/>` and `acw-map.txt` parsing.` ~~

There are many ways for Android+Java code to refer to managed types.

For example, consider the following View subclass:

	namespace Example {
	  partial class MyCoolView : Android.Views.View {
	    // …
	  }
	}

Within layout `.axml` files, you can mention an `Android.Views.View`
subclass by:

  * Using the .NET Full Class Name as an element name.

        <Example.MyCoolView />

  * Using the .NET Full Class Name with a *lowercased* namespace
    name as the element name.

        <example.MyCoolView />

  * Use the Java-side name directly.

        <crc64….NiftyView />

Within Fragments, you can also use the *assembly-qualified name*:

	<fragment class="Example.MyCoolView, AssemblyName" />

At build time, all instances of the .NET type names will be
*replaced* with the Java type names before the Android toolchain
processes the files.

The association between .NET type names and Java names is stored
within `$(IntermediateOutputPath)acw-map.txt`, which was introduced
in xamarin/monodroid@a04b73b3.

*Normally* `acw-map.txt` contains three entries:

 1. The fully-qualified .NET type name
 2. The .NET type name, no assembly
 3. (2) with a lowercased namespace name, *or* the `[Register]`
    value, if provided.

For example:

	Mono.Android_Test.Library.CustomTextView, Mono.Android-Test.Library.NET;crc6456ab8145c81c4100.CustomTextView
	Mono.Android_Test.Library.CustomTextView;crc6456ab8145c81c4100.CustomTextView   
	mono.android_test.library.CustomTextView;crc6456ab8145c81c4100.CustomTextView   
	Java.InteropTests.GenericHolder`1, Java.Interop-Tests;net.dot.jni.test.tests.GenericHolder
	Java.InteropTests.GenericHolder`1;net.dot.jni.test.tests.GenericHolder          
	net.dot.jni.test.tests.GenericHolder;net.dot.jni.test.tests.GenericHolder    

However, when warning XA4214 is emitted (efbec227), there is a
"collision" on the .NET side (but *not* the Java side); (2) and (3)
are potentially *ambiguous*, so one .NET type is arbitrarily chosen.
(Collisions on the Java side result in XA4215 *errors*.)

The first line is still possible, because of assembly qualification.

Enter ``Java.InteropTests.GenericHolder`1``: this type is present in
*both* `Java.Interop-Tests.dll` *and* `Mono.Android-Tests.dll`.
xamarin/java.interop@07c73009, this was "fine" because the
`GenericHolder<T>` within `Java.Interop-Tests.dll` did not participate
in typemap generation.  Now it does, resulting in the XA4214 warning.
XA4214 *also* means that instead of three lines, it's *one* line:

	Java.InteropTests.GenericHolder`1, Mono.Android.NET-Tests;crc641855b07eca6dcc03.GenericHolder_1

Enter `<R8/>`, which parses `acw-map.txt` to create a
`proguard_project_primary.cfg` file.  `<R8/>` did it's *own* parsing
of `acw-map.txt`, parsing only *one of every three lines*, on the
assumption that *all* entries took three lines.

This breaks in the presence of XA4214, because some entries only take
one line, not three lines.  This in turn meant that
`proguard_project_primary.cfg` could *miss* types, which could mean
that `r8` would *remove* the unspecified types, resulting in
`ClassNotFoundException` at runtime:

	Java.Lang.ClassNotFoundException : crc641855b07eca6dcc03.GenericHolder_1
	----> Java.Lang.ClassNotFoundException : Didn't find class "crc641855b07eca6dcc03.GenericHolder_1" on path: DexPathList[[zip file "/data/app/Mono.Android.NET_Tests-2stBqO43ov5F6bHfYemJHQ==/base.apk", zip file "/data/app/Mono.Android.NET_Tests-2stBqO43ov5F6bHfYemJHQ==/split_config.x86_64.apk", zip file "/data/app/Mono.Android.NET_Tests-2stBqO43ov5F6bHfYemJHQ==/split_config.xxhdpi.apk"],nativeLibraryDirectories=[/data/app/Mono.Android.NET_Tests-2stBqO43ov5F6bHfYemJHQ==/lib/x86_64, /system/fake-libs64, /data/app/Mono.Android.NET_Tests-2stBqO43ov5F6bHfYemJHQ==/base.apk!/lib/x86_64, /data/app/Mono.Android.NET_Tests-2stBqO43ov5F6bHfYemJHQ==/split_config.x86_64.apk!/lib/x86_64, /data/app/Mono.Android.NET_Tests-2stBqO43ov5F6bHfYemJHQ==/split_config.xxhdpi.apk!/lib/x86_64, /system/lib64, /system/product/lib64]]
	   at Java.Interop.JniEnvironment.StaticMethods.CallStaticObjectMethod(JniObjectReference , JniMethodInfo , JniArgumentValue* )
	   at Android.Runtime.JNIEnv.FindClass(String )

Update `<R8/>` to instead use `MonoAndroidHelper.LoadMapFile()`,
which reads all lines within `acw-map.txt`.  This results in a
`proguard_project_primary.cfg` file which properly contains a `-keep`
entry for XA4214-related types, such as
`crc641855b07eca6dcc03.GenericHolder_1`.


~~ Correct `java/lang/Object` mappings ~~`

Previous valiant efforts to allow `java/lang/Object` to be mapped to
"anything", not just `Java.Lang.Object, Mono.Android`, eventually
resulted in lots of unit test failures, e.g.:

`Android.RuntimeTests.XmlReaderPullParserTest.ToLocalJniHandle()`:

	System.NotSupportedException : Unable to activate instance of type Java.InteropTests.JavaLangRemappingTestObject from native handle 0x19 (key_handle 0x2408476).
	----> System.MissingMethodException : No constructor found for Java.InteropTests.JavaLangRemappingTestObject::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership)
	----> Java.Interop.JavaLocationException : Exception_WasThrown, Java.Interop.JavaLocationException
	   at Java.Interop.TypeManager.CreateInstance(IntPtr , JniHandleOwnership , Type )
	   at Java.Interop.TypeManager.CreateInstance(IntPtr , JniHandleOwnership )
	   at Android.Runtime.XmlResourceParserReader.FromNative(IntPtr , JniHandleOwnership )
	   at Android.Runtime.XmlResourceParserReader.FromJniHandle(IntPtr handle, JniHandleOwnership transfer)
	   at Android.Content.Res.Resources.GetXml(Int32 )
	   at Android.RuntimeTests.XmlReaderPullParserTest.ToLocalJniHandle()
	   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
	   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object , BindingFlags )
	--MissingMethodException
	   at Java.Interop.TypeManager.CreateProxy(Type , IntPtr , JniHandleOwnership )
	   at Java.Interop.TypeManager.CreateInstance(IntPtr , JniHandleOwnership , Type )

With a partially heavy heart, we need to special-case typemap entries
by processing `Mono.Android.dll` *first*, so that it gets first dibs
at bindings for `java/lang/Object` and other types.

Update `NativeTypeMappingData` to process types from `Mono.Android`
before processing any other module.

Note that the special-casing needs to happen in `NativeTypeMappingData`
because typemaps were formerly processed in *sorted module order*, in
which the sort order is based on the *byte representation* of the
module's MVID (a GUID).  Additionally, *linking changes the MVID*,
which means module order is *effectively random*.  Consequently,
trying to special case typemap ordering anywhere else is ineffective.


~~ Other ~~

Update `JavaCompileToolTask` to log the contents of its response file.

Update LLVM-IR -related types within
`src/Xamarin.Android.Build.Tasks/Utilities` to use `TaskLoggingHelper`
for logging purposes, *not* `Action<string>`.  Update related types
to accept `TaskLoggingHelper`, so that we can more easily add
diagnostic messages to these types in the future.
2024-02-02 12:03:51 -05:00