-
Notifications
You must be signed in to change notification settings - Fork 534
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
[Xamarin.Android.Build.Tasks] introduce $(_AndroidRuntime)
property
#9686
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace Xamarin.Android.Tasks; | ||
|
||
public enum AndroidRuntime | ||
{ | ||
MonoVM, | ||
CoreCLR, | ||
NativeAOT, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -329,9 +329,9 @@ Copyright (C) 2011-2012 Xamarin. All rights reserved. | |
<AndroidUseAssemblyStore Condition=" '$(AndroidUseAssemblyStore)' == '' ">true</AndroidUseAssemblyStore> | ||
<AndroidAotEnableLazyLoad Condition=" '$(AndroidAotEnableLazyLoad)' == '' And '$(AotAssemblies)' == 'true' And '$(AndroidIncludeDebugSymbols)' != 'true' ">True</AndroidAotEnableLazyLoad> | ||
<AndroidEnableMarshalMethods Condition=" '$(AndroidEnableMarshalMethods)' == '' and ('$(UsingMicrosoftNETSdkRazor)' == 'true') ">False</AndroidEnableMarshalMethods> | ||
<AndroidEnableMarshalMethods Condition=" '$(AndroidEnableMarshalMethods)' == '' and '$(_AndroidNativeAot)' != 'true' ">True</AndroidEnableMarshalMethods> | ||
<AndroidEnableMarshalMethods Condition=" '$(AndroidEnableMarshalMethods)' == '' and '$(_AndroidRuntime)' != 'NativeAOT' ">True</AndroidEnableMarshalMethods> | ||
<!-- NOTE: temporarily disable for NativeAOT for now, to get build passing --> | ||
<AndroidEnableMarshalMethods Condition=" '$(AndroidEnableMarshalMethods)' == '' and '$(_AndroidNativeAot)' == 'true' ">False</AndroidEnableMarshalMethods> | ||
<AndroidEnableMarshalMethods Condition=" '$(AndroidEnableMarshalMethods)' == '' and '$(_AndroidRuntime)' == 'NativeAOT' ">False</AndroidEnableMarshalMethods> | ||
<_AndroidUseMarshalMethods Condition=" '$(AndroidIncludeDebugSymbols)' == 'True' ">False</_AndroidUseMarshalMethods> | ||
<_AndroidUseMarshalMethods Condition=" '$(AndroidIncludeDebugSymbols)' != 'True' ">$(AndroidEnableMarshalMethods)</_AndroidUseMarshalMethods> | ||
</PropertyGroup> | ||
|
@@ -1379,7 +1379,7 @@ because xbuild doesn't support framework reference assemblies. | |
DependsOnTargets="_CollectRuntimeJarFilenames;$(_BeforeAddStaticResources);_GetMonoPlatformJarPath"> | ||
<CopyResource ResourceName="machine.config" OutputPath="$(MonoAndroidIntermediateAssemblyDir)machine.config" /> | ||
<CopyResource | ||
Condition=" '$(_AndroidNativeAot)' != 'true' " | ||
Condition=" '$(_AndroidRuntime)' == 'MonoVM' " | ||
ResourceName="MonoRuntimeProvider.Bundled.java" | ||
OutputPath="$(_AndroidIntermediateJavaSourceDirectory)mono\MonoRuntimeProvider.java" | ||
/> | ||
|
@@ -1498,7 +1498,7 @@ because xbuild doesn't support framework reference assemblies. | |
</ItemGroup> | ||
|
||
<GenerateJavaStubs | ||
NativeAot="$(_AndroidNativeAot)" | ||
AndroidRuntime="$(_AndroidRuntime)" | ||
ResolvedAssemblies="@(_ResolvedAssemblies)" | ||
ResolvedUserAssemblies="@(_ResolvedUserMonoAndroidAssemblies)" | ||
ErrorOnCustomJavaObject="$(AndroidErrorOnCustomJavaObject)" | ||
|
@@ -1728,7 +1728,7 @@ because xbuild doesn't support framework reference assemblies. | |
</Target> | ||
|
||
<Target Name="_GeneratePackageManagerJava" | ||
Condition=" '$(_AndroidNativeAot)' != 'true' " | ||
Condition=" '$(_AndroidRuntime)' != 'NativeAOT' " | ||
DependsOnTargets="$(_GeneratePackageManagerJavaDependsOn)" | ||
Inputs="@(_GeneratePackageManagerJavaInputs)" | ||
Outputs="$(_AndroidStampDirectory)_GeneratePackageManagerJava.stamp"> | ||
|
@@ -1947,7 +1947,7 @@ because xbuild doesn't support framework reference assemblies. | |
|
||
<!-- Shrink Mono.Android.dll by removing attribute only needed for GenerateJavaStubs --> | ||
<RemoveRegisterAttribute | ||
Condition="'$(AndroidLinkMode)' != 'None' and '$(AndroidIncludeDebugSymbols)' != 'true' and '$(AndroidStripILAfterAOT)' != 'true' and '$(_AndroidNativeAot)' != 'true' " | ||
Condition="'$(AndroidLinkMode)' != 'None' and '$(AndroidIncludeDebugSymbols)' != 'true' and '$(AndroidStripILAfterAOT)' != 'true' and '$(_AndroidRuntime)' != 'NativeAOT' " | ||
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. Why wouldn't we run 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. Currently, it runs after the trimmer. Under NativeAOT, after the trimmer, it's down to a single We will revisit this, but I was hoping to just move |
||
ShrunkFrameworkAssemblies="@(_ShrunkAssemblies)" /> | ||
|
||
<MakeDir Directories="$(MonoAndroidIntermediateAssemblyDir)shrunk" /> | ||
|
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 don't quite understand the desired semantics; when would
$(UseMonoRuntime)
be set to false? When would CoreCLR be used? Or is it that CoreCLR support is still in-progress via #9572, and thus it currently isn't possible for$(_AndroidRuntime)
to be CoreCLR, and #9572 will change that? Or is the expectation that in the future, to use CoreCLR then devs must explicitly set$(UseMonoRuntime)
=false in their .csproj?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.
Right now, the best option we have to align with xamarin/xamarin-macios is that you would set
UseMonoRuntime=false
in your.csproj
file.