-
Notifications
You must be signed in to change notification settings - Fork 538
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
[Mono.Android] introduce #if NATIVEAOT
for monodroid_get_log_categories()
#9624
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,8 @@ | |
<NoWarn>0618;0809;0108;0114;0465;8609;8610;8614;8617;8613;8764;8765;8766;8767;RS0041</NoWarn> | ||
<WarningsAsErrors>$(WarningsAsErrors);CS2002</WarningsAsErrors> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
<DefineConstants>$(DefineConstants);JAVA_INTEROP</DefineConstants> | ||
<DefineConstants Condition=" '$(AndroidRuntime)' == 'Mono' ">$(DefineConstants);JAVA_INTEROP;MONO</DefineConstants> | ||
<DefineConstants Condition=" '$(AndroidRuntime)' == 'NativeAOT' ">$(DefineConstants);JAVA_INTEROP;NATIVEAOT</DefineConstants> | ||
Comment on lines
+16
to
+17
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 was debating the names here. Should it be 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'd prefer a I'd really prefer the need for any such changes to |
||
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\$(TargetFramework)\android-$(AndroidPlatformId)\</IntermediateOutputPath> | ||
<ImplicitlyExpandDesignTimeFacades>false</ImplicitlyExpandDesignTimeFacades> | ||
<JavaCallableWrapperAfterTargets>CoreBuild</JavaCallableWrapperAfterTargets> | ||
|
@@ -410,7 +411,7 @@ | |
<_RefExtras Include="$(OutputPath)*.*" Exclude="$(OutputPath)*.dll" /> | ||
<_SourceFiles Include="$(OutputPath)Mono.Android.*" /> | ||
<_SourceFiles Include="$(OutputPath)Java.Interop.*" /> | ||
<_RuntimePackFiles Include="@(_SourceFiles)" AndroidRID="%(AndroidAbiAndRuntimeFlavor.AndroidRID)" AndroidRuntime="%(AndroidAbiAndRuntimeFlavor.AndroidRuntime)" /> | ||
<_RuntimePackFiles Include="@(_SourceFiles)" AndroidRID="%(AndroidAbiAndRuntimeFlavor.AndroidRID)" /> | ||
</ItemGroup> | ||
<Copy | ||
SourceFiles="@(_RefExtras)" | ||
|
@@ -424,7 +425,7 @@ | |
/> | ||
<Copy | ||
SourceFiles="%(_RuntimePackFiles.Identity)" | ||
DestinationFolder="$(BuildOutputDirectory)lib\packs\Microsoft.Android.Runtime.%(_RuntimePackFiles.AndroidRuntime).$(AndroidApiLevel).%(_RuntimePackFiles.AndroidRID)\$(AndroidPackVersion)\runtimes\%(_RuntimePackFiles.AndroidRID)\lib\$(DotNetTargetFramework)" | ||
DestinationFolder="$(BuildOutputDirectory)lib\packs\Microsoft.Android.Runtime.$(AndroidRuntime).$(AndroidApiLevel).%(_RuntimePackFiles.AndroidRID)\$(AndroidPackVersion)\runtimes\%(_RuntimePackFiles.AndroidRID)\lib\$(DotNetTargetFramework)" | ||
SkipUnchangedFiles="true" | ||
/> | ||
<Copy | ||
|
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.
wrt my earlier comment:
Could we instead have
LogCategories
(or anint
variation) be a member ofJnienvInitializeArgs
, and have both NativeAOT and MonoVM useJniEnvInit.Initialize(JnienvInitializeArgs*)
? This would allow removing the need formonodroid_get_log_categories()
entirely, and aim for consistent initialization between the two environments.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.
…especially when
logCategories
is already a field inJnnenvInitializeArgs
(?!):android/src/Mono.Android/Android.Runtime/JNIEnvInit.cs
Line 24 in 6b91b04
Why do we have this P/Invoke at all?!
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’ll open a new PR to remove the p/invoke. I’ll see if we still need a define later.
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.
It seems like this will work:
monodroid_get_log_categories()
#9625But we'll want to merge #9622 first, or the
pinvoke-table
will have conflicts.