diff --git a/Configuration.props b/Configuration.props index ff1173c1d4b..db6017ebbc4 100644 --- a/Configuration.props +++ b/Configuration.props @@ -40,6 +40,7 @@ $(AndroidLatestStableFrameworkVersion) True $(AndroidLatestStableApiLevel) + Mono portable True latest @@ -60,7 +61,7 @@ False <_XABinRelativeInstallPrefix>lib\xamarin.android $(MSBuildThisFileDirectory)bin\$(Configuration)\$(_XABinRelativeInstallPrefix)\ - <_MonoAndroidNETOutputRoot>$(XAInstallPrefix)xbuild-frameworks\Microsoft.Android\ + <_MonoAndroidNETOutputRoot>$(XAInstallPrefix)xbuild-frameworks\Microsoft.Android.$(AndroidRuntime)\ <_MonoAndroidNETDefaultOutDir>$(_MonoAndroidNETOutputRoot)$(AndroidApiLevel)\ $(BuildOutputDirectory)lib\packs\Microsoft.Android.Ref.$(AndroidApiLevel)\$(AndroidPackVersion)\ref\$(DotNetTargetFramework)\ $(BuildOutputDirectory)lib\packs\$(MicrosoftAndroidSdkPackName)\$(AndroidPackVersion)\ @@ -214,7 +215,8 @@ - - + + + diff --git a/build-tools/create-packs/Microsoft.Android.Runtime.proj b/build-tools/create-packs/Microsoft.Android.Runtime.proj index 9c3c22c1390..96f7d691886 100644 --- a/build-tools/create-packs/Microsoft.Android.Runtime.proj +++ b/build-tools/create-packs/Microsoft.Android.Runtime.proj @@ -11,7 +11,6 @@ projects that use the Microsoft.Android framework in .NET 6+. android-arm64 - Mono Microsoft.Android.Runtime.$(AndroidRuntime).$(AndroidApiLevel).$(AndroidRID) Microsoft.Android runtime components for API $(AndroidApiLevel). Please do not reference directly. <_AndroidRuntimePackAssemblyPath>runtimes\$(AndroidRID)\lib\$(DotNetTargetFramework) diff --git a/build-tools/scripts/DotNet.targets b/build-tools/scripts/DotNet.targets index cda033d1108..1683919fd96 100644 --- a/build-tools/scripts/DotNet.targets +++ b/build-tools/scripts/DotNet.targets @@ -29,22 +29,30 @@ + + + + + DependsOnTargets="BuildExtraApiLevels;BuildOtherRuntimes"> diff --git a/src/Mono.Android/Android.Runtime/Logger.cs b/src/Mono.Android/Android.Runtime/Logger.cs index 29e13cd6302..9bf9aa8809e 100644 --- a/src/Mono.Android/Android.Runtime/Logger.cs +++ b/src/Mono.Android/Android.Runtime/Logger.cs @@ -58,12 +58,19 @@ public static void Log (LogLevel level, string appname, string? log) { } } + #if !NATIVEAOT [DllImport (RuntimeConstants.InternalDllName, CallingConvention = CallingConvention.Cdecl)] extern static uint monodroid_get_log_categories (); + #endif static Logger () { + #if NATIVEAOT + // TODO: p/invoke into __system_property_get + Categories = LogCategories.Default | LogCategories.Assembly; + #else // !NATIVEAOT Categories = (LogCategories) monodroid_get_log_categories (); + #endif // !NATIVEAOT } } } diff --git a/src/Mono.Android/Mono.Android.csproj b/src/Mono.Android/Mono.Android.csproj index 5b062533b27..2c0c4bd2bda 100644 --- a/src/Mono.Android/Mono.Android.csproj +++ b/src/Mono.Android/Mono.Android.csproj @@ -13,7 +13,8 @@ 0618;0809;0108;0114;0465;8609;8610;8614;8617;8613;8764;8765;8766;8767;RS0041 $(WarningsAsErrors);CS2002 true - $(DefineConstants);JAVA_INTEROP + $(DefineConstants);JAVA_INTEROP;MONO + $(DefineConstants);JAVA_INTEROP;NATIVEAOT $(BaseIntermediateOutputPath)$(Configuration)\$(TargetFramework)\android-$(AndroidPlatformId)\ false CoreBuild @@ -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)" />