You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context: #9846
Context: dbb0b92
Context: d70db5b
While trying to *build* `tests/Mono.Android-Tests` with NativeAOT:
dotnet-local.cmd build tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj ^
-p:TestsFlavor=NativeAOT -p:PublishAot=true -c Release -bl -t:Install
it would fail to build:
tests\Mono.Android-Tests\Java.Interop-Tests\obj\Release\net10.0-android\generated\src\Net.Dot.Jni.Test.MyJavaInterfaceImpl.cs(19,81):
error CS1056: Unexpected character '`'
The offending code?
public partial class MyJavaInterfaceImpl : global::Java.Interop.JavaObjectArray`1, global::Net.Dot.Jni.Test.IJavaInterface {
}
which is deeply, *deeply*, wrong.
Further investigation showed that the problem was that
`Java.Interop-Tests` was trying to bind Java code, and in this case
was using `generator --codegen-target=JavaInterop1` output.
This is output we've never tried to use before in .NET for Android;
`generator --codegen-target=JavaInterop1` is experimental
(and @jonpryor's playground; see dotnet/java-interop#858), and
shouldn't be used *now* (if ever).
Ultimately, we realized that commit d70db5b was *wrong*, in that it
merged two different things:
1. Java stub generation's "codegen target", previously settable by
an MSBuild property `$(_AndroidCodeGenerationTarget)`
(introduced in dbb0b92)
2. C# `generator`s "codegen target" or `$(AndroidCodegenTarget)`
The problem was `$(_AndroidCodeGenerationTarget)` was just poorly
named making me think it was the same as `$(AndroidCodegenTarget)`.
Partially revert d70db5b and use the name `$(_AndroidJcwCodegenTarget)`
instead.
NativeAOT now defaults to:
* `$(_AndroidJcwCodegenTarget)=JavaInterop1`
* `$(AndroidCodegenTarget)=XAJavaInterop1`
Copy file name to clipboardexpand all lines: src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets
0 commit comments