Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion build-tools/scripts/JavaCallableWrappers.targets
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@
Inputs="$(JavaCallableWrapperAbsAssembly);@(JavaCallableWrapperSource)"
Outputs="$(OutputPath)mono.android.jar">
<MakeDir Directories="$(IntermediateOutputPath)jcw;$(IntermediateOutputPath)jcw\bin" />
<ItemGroup>
<_CorlibPath Include="@(ReferencePath->'%(RootDir)%(Directory)')" Condition=" '%(FileName)%(Extension)' == 'mscorlib.dll' " />
</ItemGroup>
<PropertyGroup>
<_CorlibDir>@(_CorlibPath)</_CorlibDir>
<OutputPathAbs Condition="$([System.IO.Path]::IsPathRooted($(OutputPath)))">$(OutputPath)</OutputPathAbs>
<OutputPathAbs Condition=" '$(OutputPathAbs)' == '' ">$(MSBuildProjectDirectory)\$(OutputPath)</OutputPathAbs>
<JcwGen>"$(XAInstallPrefix)xbuild\Xamarin\Android\jcw-gen.exe" -v10</JcwGen>
<_LibDirs>-L "$(OutputPathAbs.TrimEnd('\'))" -L "$(OutputPathAbs)..\v1.0" -L "$(OutputPathAbs)..\v1.0\Facades"</_LibDirs>
<_LibDirs>-L "$(OutputPathAbs.TrimEnd('\'))"</_LibDirs>
<_LibDirs Condition=" '$(TargetFramework)' != 'netcoreapp3.1' ">$(_LibDirs) -L "$(OutputPathAbs)..\v1.0" -L "$(OutputPathAbs)..\v1.0\Facades"</_LibDirs>
<_LibDirs Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">$(_LibDirs) -L "$(_CorlibDir.TrimEnd('\'))"</_LibDirs>
<_Out>-o "$(MSBuildProjectDirectory)\$(IntermediateOutputPath)jcw\src"</_Out>
</PropertyGroup>
<Exec
Expand Down
2 changes: 2 additions & 0 deletions src/Mono.Android/Android.Runtime/JNIEnv.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ internal static unsafe void Initialize (JnienvInitializeArgs* args)
else
IdentityHash = v => v;

#if MONOANDROID1_0
Mono.SystemDependencyProvider.Initialize ();
#endif

BoundExceptionType = (BoundExceptionType)args->ioExceptionType;
androidRuntime = new AndroidRuntime (args->env, args->javaVm, androidSdkVersion > 10, args->grefLoader, args->Loader_loadClass, args->jniAddNativeMethodRegistrationAttributePresent != 0);
Expand Down
25 changes: 21 additions & 4 deletions src/Mono.Android/Mono.Android.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<Project>

<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<Import Project="..\..\Configuration.props" />

<PropertyGroup>
<TargetFramework>monoandroid10</TargetFramework>
<TargetFrameworks>monoandroid10;netcoreapp3.1</TargetFrameworks>
<RootNamespace>Android</RootNamespace>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\product.snk</AssemblyOriginatorKeyFile>
Expand All @@ -30,6 +31,11 @@
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
<OutputPath>$(XAInstallPrefix)xbuild-frameworks\Xamarin.Android.App\$(TargetFramework)\</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'monoandroid10' ">
<Reference Include="mscorlib">
<HintPath>$(OutputPath)..\v1.0\mscorlib.dll</HintPath>
Expand Down Expand Up @@ -73,6 +79,10 @@
</Reference>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
<ProjectReference Include="..\..\external\Java.Interop\src\Java.Interop\Java.Interop.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\..\external\Java.Interop\src\Java.Interop.Tools.TypeNameMappings\Java.Interop.Tools.TypeNameMappings\JavaNativeTypeManager.cs">
<Link>JavaNativeTypeManager.cs</Link>
Expand Down Expand Up @@ -325,9 +335,16 @@
<ProjectReference Include="..\..\build-tools\api-merge\api-merge.csproj" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\..\build-tools\api-xml-adjuster\api-xml-adjuster.csproj" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\..\build-tools\jnienv-gen\jnienv-gen.csproj" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\..\external\Java.Interop\tools\generator\generator.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" />
<ProjectReference Include="..\..\external\Java.Interop\tools\jcw-gen\jcw-gen.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" />
<!-- Explicitly pass the target framework of the project so we don't have conflicts with the multiple targets in this file. -->
<ProjectReference Include="..\..\external\Java.Interop\tools\generator\generator.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" AdditionalProperties="TargetFramework=net472"/>
<ProjectReference Include="..\..\external\Java.Interop\tools\jcw-gen\jcw-gen.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" AdditionalProperties="TargetFramework=net472" />
<ProjectReference Include="..\..\src\java-runtime\java-runtime.csproj" ReferenceOutputAssembly="false" />
</ItemGroup>

<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
<!-- Only build the 'netcoreapp3.1' version of 'Mono.Android.dll' once for the latest stable Android version. -->
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' And '$(AndroidFrameworkVersion)' != '$(AndroidLatestStableFrameworkVersion)' ">
<BuildDependsOn></BuildDependsOn>
</PropertyGroup>

</Project>
4 changes: 3 additions & 1 deletion src/Mono.Android/Mono.Android.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
</ItemGroup>
<Target Name="_BuildJavaInterop"
BeforeTargets="BeforeResolveReferences"
Condition=" '$(TargetFramework)' == 'monoandroid10' "
Inputs="$(MSBuildThisFile);$(JavaInteropFullPath)\src\Java.Interop\Java.Interop.csproj"
Outputs="$(OutputPath)\..\v1.0\Java.Interop.dll">
<PropertyGroup>
Expand Down Expand Up @@ -134,6 +135,7 @@
</ItemGroup>
<Target Name="_GenerateFrameworkList"
BeforeTargets="GetTargetFrameworkProperties;GetReferenceAssemblyPaths;ResolveReferences"
Condition=" '$(TargetFramework)' == 'monoandroid10' "
Inputs="$(MSBuildProjectFullPath)"
Outputs="$(OutputPath)RedistList\FrameworkList.xml">
<MakeDir Directories="$(OutputPath)RedistList" />
Expand Down Expand Up @@ -185,7 +187,7 @@
<Target
Name="_CheckApiCompatibility"
Condition=" '$(DisableApiCompatibilityCheck)' != 'True' "
AfterTargets="Build"
AfterTargets="CopyFilesToOutputDirectory"
Inputs="$(TargetPath);@(ApiCompatibilityFiles)"
Outputs="$(IntermediateOutputPath)CheckApiCompatibility.stamp">
<CheckApiCompatibility
Expand Down