-
Notifications
You must be signed in to change notification settings - Fork 524
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
Enable marshal methods support by default #7351
Changes from all commits
35f4e24
e34f88e
eb15bd2
a80e4a1
49751f7
803b3e3
e6101c1
657aff0
e8d3026
4d7ec30
39068d3
82ece43
acd5bc8
9a476d8
8d2503f
f913d24
52c99db
e5358f4
2f15f67
21c066f
3c8901a
7dc40fc
2b2ce55
9c38c68
85f2cfa
024b5f5
4d92570
20a2f00
2d3c043
071e9d3
710242e
af91895
673836c
ca2f92d
10e63e2
238417e
72c4b60
eb94adc
a8471cd
cfaabf2
8ca61bb
a473f27
d99b7e3
cfa1b30
9c9612d
334619b
c9332a8
e518a4e
905e784
f29f0d2
6ca1245
b988b7f
63bf193
3530c39
c516792
c8a2d9f
e8f3215
b60c767
0aa3e95
e3ac595
49895b8
a8cfd90
92fa671
f37b4dc
09678bd
d60fc08
6b116bf
1d88be2
aea0b0f
e1e59f0
aaff9f5
df04d47
7e9761f
f17ad9f
7a00e0e
d3d9007
73237a2
b459e4a
dfcf734
5dccadb
fc83958
8bdb607
cd832c7
a9995b0
86d9fca
1162a09
65471a8
7f87a37
ea4c57f
115c6fa
222163e
5bd03e2
e635b27
221ad8f
d03092d
e1a621e
f9bca3c
977a060
09eeb7e
312d84e
b143c95
c20ae31
8c9ceca
2b33563
94d9bea
73277aa
5b14a70
9077b6a
32347b7
ddedcc3
aed7b2d
2aa7cfe
92fb339
d3c54a0
170b5d1
3fdc653
504ced9
be9280e
983ad70
7d201e3
35d49d4
1ebb5d8
62a5138
9852cc5
fe2ae06
e1609d9
98655ea
5d138d0
71aafd5
d708edc
7124851
9be7e6b
edcf092
48c3328
5781643
5f433b1
8b1d3f9
724de1d
d26d9e1
d5016fe
f8db2d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<linker> | ||
<assembly fullname="Mono.Android.Runtime" preserve="all" /> | ||
</linker> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,17 +7,17 @@ | |
<type fullname="Android.Runtime.InputStreamInvoker" preserve="methods" /> | ||
<type fullname="Android.Runtime.JNIEnv"> | ||
<method name="Exit" /> | ||
<method name="Initialize" /> | ||
<method name="PropagateUncaughtException" /> | ||
</type> | ||
<type fullname="Android.Runtime.JNIEnvInit"> | ||
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 forget; does 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. It remains there for classic Xamarin, it is moved to the new assembly for .NET |
||
<method name="Initialize" /> | ||
<method name="RegisterJniNatives" /> | ||
</type> | ||
<type fullname="Android.Runtime.JNINativeWrapper" /> | ||
<type fullname="Android.Runtime.JObjectRefType" /> | ||
<type fullname="Android.Runtime.JValue" /> | ||
<type fullname="Android.Runtime.JniHandleOwnership" /> | ||
<type fullname="Android.Runtime.Logger" /> | ||
<type fullname="Android.Runtime.LogLevel" /> | ||
<type fullname="Android.Runtime.LogCategories" /> | ||
<type fullname="Android.Runtime.NamespaceMappingAttribute" /> | ||
<type fullname="Android.Runtime.OutputStreamAdapter" preserve="methods" /> | ||
<type fullname="Android.Runtime.OutputStreamInvoker" preserve="methods" /> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System; | ||
|
||
namespace Android.Runtime | ||
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. …and more name bikeshedding: I think it was a historical mistake to use I think 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. Likewise, I'd rather keep the |
||
{ | ||
internal static class AndroidEnvironmentInternal | ||
{ | ||
internal static Action<Exception>? UnhandledExceptionHandler; | ||
|
||
internal static void UnhandledException (Exception e) | ||
{ | ||
if (UnhandledExceptionHandler == null) { | ||
return; | ||
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 wonder if this should 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 wouldn't abort explicitly here. Hitting it during startup is very unlikely, and if it's not properly initialized, the app will crash anyway, implicitly aborting. |
||
} | ||
|
||
UnhandledExceptionHandler (e); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<Project> | ||
<UsingTask AssemblyFile="$(PrepTasksAssembly)" TaskName="Xamarin.Android.BuildTools.PrepTasks.ReplaceFileContents" /> | ||
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" /> | ||
<Import Project="..\..\Configuration.props" /> | ||
<Import Project="..\..\build-tools\scripts\XAVersionInfo.targets" /> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>$(DotNetTargetFramework)</TargetFrameworks> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> | ||
<AssemblyOriginatorKeyFile>..\..\product.snk</AssemblyOriginatorKeyFile> | ||
<EnableDefaultCompileItems>false</EnableDefaultCompileItems> | ||
<EnableSingleFileAnalyzer>true</EnableSingleFileAnalyzer> | ||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> | ||
<ImplicitlyExpandDesignTimeFacades>false</ImplicitlyExpandDesignTimeFacades> | ||
<LangVersion>10</LangVersion> | ||
<NoStdLib>true</NoStdLib> | ||
<Nullable>enable</Nullable> | ||
<ProduceReferenceAssembly>true</ProduceReferenceAssembly> | ||
<SignAssembly>true</SignAssembly> | ||
|
||
<!-- Ignore "unused member" warnings from code that originates from Mono.CodeGeneration --> | ||
<NoWarn>$(NoWarn);CS0169;CS0414;CS0649</NoWarn> | ||
|
||
<DefineConstants>$(DefineConstants);INSIDE_MONO_ANDROID_RUNTIME;JAVA_INTEROP</DefineConstants> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<OutputPath>$(_MonoAndroidNETDefaultOutDir)</OutputPath> | ||
</PropertyGroup> | ||
|
||
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" /> | ||
|
||
<!-- Only build the .NET 6+ version of 'Mono.Android.Export.dll' for the latest stable Android version. --> | ||
<PropertyGroup Condition=" '$(AndroidApiLevel)' != '$(AndroidLatestStableApiLevel)' "> | ||
<BuildDependsOn></BuildDependsOn> | ||
</PropertyGroup> | ||
|
||
<!-- Copy .NET ref/runtime assemblies to bin/$(Configuration)/dotnet/packs folder --> | ||
<PropertyGroup Condition=" '$(AndroidApiLevel)' == '$(AndroidLatestStableApiLevel)' "> | ||
<BuildDependsOn> | ||
$(BuildDependsOn); | ||
_CopyToPackDirs; | ||
</BuildDependsOn> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="$(IntermediateOutputPath)AssemblyInfo.cs" /> | ||
<Compile Include="..\Mono.Android\Android.Runtime\AndroidRuntimeInternal.cs" /> | ||
<Compile Include="..\Mono.Android\Android.Runtime\LogCategories.cs" /> | ||
<Compile Include="..\Mono.Android\Android.Runtime\LogLevel.cs" /> | ||
<Compile Include="..\Mono.Android\Android.Runtime\RuntimeConstants.cs" /> | ||
<Compile Include="..\Mono.Android\Android.Runtime\RuntimeNativeMethods.cs" /> | ||
<Compile Include="Android.Runtime\AndroidEnvironmentInternal.cs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\external\Java.Interop\src\Java.Interop\Java.Interop.csproj" /> | ||
</ItemGroup> | ||
|
||
<Import Project="Mono.Android.Runtime.targets" /> | ||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<!-- Creates 'AssemblyInfo.cs' with appropriate version information --> | ||
<Target Name="_BuildAssemblyInfo_cs" | ||
DependsOnTargets="GetXAVersionInfo" | ||
BeforeTargets="CoreCompile" | ||
Condition="!Exists ('$(IntermediateOutputPath)AssemblyInfo.cs')" | ||
Inputs="Properties\AssemblyInfo.cs.in" | ||
Outputs="$(IntermediateOutputPath)AssemblyInfo.cs"> | ||
<PropertyGroup Condition=" '$(TargetFramework)' == 'monoandroid10' "> | ||
<_PackageVersion>$(ProductVersion)</_PackageVersion> | ||
<_PackageVersionBuild>$(XAVersionCommitCount)</_PackageVersionBuild> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(TargetFramework)' != 'monoandroid10' "> | ||
<_PackageVersion>$(AndroidPackVersion)</_PackageVersion> | ||
<_PackageVersionBuild>$(PackVersionCommitCount)</_PackageVersionBuild> | ||
</PropertyGroup> | ||
<ReplaceFileContents | ||
SourceFile="Properties\AssemblyInfo.cs.in" | ||
DestinationFile="$(IntermediateOutputPath)AssemblyInfo.cs" | ||
Replacements="@PACKAGE_VERSION@=$(_PackageVersion);@PACKAGE_VERSION_BUILD@=$(_PackageVersionBuild);@PACKAGE_HEAD_REV@=$(XAVersionHash);@PACKAGE_HEAD_BRANCH@=$(XAVersionBranch);@API_LEVEL@=$(AndroidApiLevel);@MIN_API_LEVEL@=$(AndroidMinimumDotNetApiLevel)"> | ||
</ReplaceFileContents> | ||
</Target> | ||
|
||
<Target Name="_CopyToPackDirs" > | ||
<Copy | ||
SourceFiles="$(OutputPath)ref\Mono.Android.Runtime.dll" | ||
DestinationFolder="$(MicrosoftAndroidRefPackDir)" | ||
SkipUnchangedFiles="true" | ||
/> | ||
<Copy | ||
SourceFiles="$(OutputPath)Mono.Android.Runtime.dll" | ||
DestinationFolder="$(MicrosoftAndroidArmPackDir)lib\$(DotNetTargetFramework)" | ||
SkipUnchangedFiles="true" | ||
/> | ||
<Copy | ||
SourceFiles="$(OutputPath)Mono.Android.Runtime.dll" | ||
DestinationFolder="$(MicrosoftAndroidArm64PackDir)lib\$(DotNetTargetFramework)" | ||
SkipUnchangedFiles="true" | ||
/> | ||
<Copy | ||
SourceFiles="$(OutputPath)Mono.Android.Runtime.dll" | ||
DestinationFolder="$(MicrosoftAndroidx86PackDir)lib\$(DotNetTargetFramework)" | ||
SkipUnchangedFiles="true" | ||
/> | ||
<Copy | ||
SourceFiles="$(OutputPath)Mono.Android.Runtime.dll" | ||
DestinationFolder="$(MicrosoftAndroidx64PackDir)lib\$(DotNetTargetFramework)" | ||
SkipUnchangedFiles="true" | ||
/> | ||
</Target> | ||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// AssemblyInfo.cs.in | ||
// | ||
// Authors: | ||
// Jonathan Pryor (jonp@xamarin.com) | ||
// | ||
// Copyright 2014 Xamarin, Inc. | ||
// Copyright 2016 Microsoft Corporation. | ||
|
||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.Versioning; | ||
|
||
[assembly: AssemblyInformationalVersion ("@PACKAGE_VERSION@.@PACKAGE_VERSION_BUILD@; git-rev-head:@PACKAGE_HEAD_REV@; git-branch:@PACKAGE_HEAD_BRANCH@")] | ||
[assembly: AssemblyTitle ("Mono.Android.Runtime.dll")] | ||
[assembly: AssemblyProduct ("Xamarin.Android")] | ||
[assembly: AssemblyCompany ("Microsoft Corporation")] | ||
[assembly: TargetPlatform("Android@API_LEVEL@.0")] | ||
[assembly: SupportedOSPlatform("Android@MIN_API_LEVEL@.0")] | ||
|
||
[assembly: InternalsVisibleTo("Mono.Android, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")] |
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 fear that I'm gonna be "bikeshedding" half the naming here -- and I am! -- but…
Mono.Android.Runtime
is not "future-facing". We may stick withMono.Android.dll
"forever", but there are equal odds that we may do aMicrosoft.Android.dll
name in the future (.NET 10?).As such, we should choose names which are unlikely to need changing. Possible suggestions:
Microsoft.Android.Startup.dll
Microsoft.Android.Internals.dll
Microsoft.Android.Interop.dll
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'd rather keep it
Mono.Android.Runtime
for now, since it pairs nicely withMono.Android
(and that was the reason I chose this name)