-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[android] Internal Android sample build improvements and CoreCLR support #111545
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
752511b
Move default AOT properties to a common props file
ivanpovazan b9f09c4
Use AndroidBuild.targets in AndroidSampleApp
ivanpovazan 5800ff8
Adding a comment on usage of UseAotDataFile opt
ivanpovazan a071826
Relocate MonoAOTCompiler.props and ship it as part of LibraryBuilder.…
ivanpovazan d44d25e
Add functional test for Android library mode
ivanpovazan 597de84
We need the comment as we are referring to OS versions in the AOT com…
ivanpovazan 80486c8
Disable the library mode tests
ivanpovazan 60bb3da
Do not force UseMonoRuntime in AndroidBuild.props
ivanpovazan 156cc0e
Avoid using CoreCLR properties when building mono runtime tests
ivanpovazan 0c11380
Revert "Avoid using CoreCLR properties when building mono runtime tests"
ivanpovazan 474d44d
workaround for runtime tests which imports coreCLR Directory.Build.pr…
ivanpovazan 831c6e9
Merge remote-tracking branch 'upstream/main' into helloandroid
ivanpovazan 35145cb
Adapt build integration targets to work with CoreCLR
ivanpovazan d242a8c
Use RuntimeHeaders everywhere
ivanpovazan bac92ad
Link issues for TODOs
ivanpovazan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,6 @@ | |
<EnableDefaultAssembliesToBundle Condition="'$(EnableDefaultAssembliesToBundle)' == ''">false</EnableDefaultAssembliesToBundle> | ||
</PropertyGroup> | ||
|
||
<UsingTask Condition="'$(RunAOTCompilation)' == 'true'" | ||
TaskName="NdkToolFinderTask" | ||
AssemblyFile="$(MobileBuildTasksAssemblyPath)" /> | ||
<UsingTask Condition="'$(AndroidGenerateAppBundle)' == 'true'" | ||
TaskName="AndroidAppBuilderTask" | ||
AssemblyFile="$(AndroidAppBuilderTasksAssemblyPath)" /> | ||
|
@@ -24,6 +21,8 @@ | |
<PropertyGroup> | ||
<_MobileIntermediateOutputPath>$([MSBuild]::NormalizeDirectory($(IntermediateOutputPath), 'mobile'))</_MobileIntermediateOutputPath> | ||
<TargetArchitecture Condition="'$(TargetArchitecture)' == ''">$(PlatformTarget)</TargetArchitecture> | ||
<AppName Condition="'$(AppName)' == ''">$(AssemblyName)</AppName> | ||
<StripDebugSymbols Condition="'$(StripDebugSymbols)' == ''">False</StripDebugSymbols> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
|
@@ -38,10 +37,11 @@ | |
<AndroidBundleDir Condition="'$(AndroidBundleDir)' == ''">$([MSBuild]::NormalizeDirectory('$(OutDir)', 'Bundle'))</AndroidBundleDir> | ||
|
||
<BundleDir>$(AndroidBundleDir)</BundleDir> | ||
<_MonoHeaderPath>$([MSBuild]::NormalizeDirectory($(MicrosoftNetCoreAppRuntimePackRidNativeDir), 'include', 'mono-2.0'))</_MonoHeaderPath> | ||
<RuntimeHeaders>$([MSBuild]::NormalizeDirectory($(MicrosoftNetCoreAppRuntimePackRidNativeDir), 'include', 'mono-2.0'))</RuntimeHeaders> | ||
ivanpovazan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<RuntimeHeaders Condition="'$(UseMonoRuntime)' == 'false' and '$(UseNativeAOTRuntime)' != 'true'">$(CoreClrProjectRoot)hosts\inc</RuntimeHeaders> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Condition="'$(UseNativeAOTRuntime)' != 'true'"> | ||
<ItemGroup Condition="'$(UseMonoRuntime)' == 'true' and '$(UseNativeAOTRuntime)' != 'true'"> | ||
<RuntimeComponents Condition="'$(UseAllRuntimeComponents)' == 'true'" Include="@(_MonoRuntimeAvailableComponents)" /> | ||
<!-- Make sure marshal-ilgen is included in the components list. --> | ||
<RuntimeComponents Condition="'$(UseAllRuntimeComponents)' != 'true'" Include="marshal-ilgen" KeepDuplicates="false" /> | ||
|
@@ -94,7 +94,7 @@ | |
<PropertyGroup> | ||
<_AOTMode Condition="'$(UseMonoJustInterp)' != 'true'">Normal</_AOTMode> | ||
<_AOTMode Condition="'$(UseMonoJustInterp)' == 'true'">JustInterp</_AOTMode> | ||
<_AOTMode Condition="'$(ForceFullAOT)' == 'true'">Full</_AOTMode> | ||
<_AOTMode Condition="'$(ForceAOT)' == 'true' and '$(AOTWithLibraryFiles)' != 'true'">Full</_AOTMode> | ||
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. @steveisok not sure if this is correct but I noticed we were using an undocumented property |
||
<_AotOutputType>AsmOnly</_AotOutputType> | ||
</PropertyGroup> | ||
<!-- Should consider renaming property to something more appropriate--> | ||
|
@@ -112,33 +112,11 @@ | |
<_AotOutputType>ObjectFile</_AotOutputType> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<_Triple Condition="'$(TargetArchitecture)' == 'arm'">armv7-linux-gnueabi</_Triple> | ||
<_Triple Condition="'$(TargetArchitecture)' == 'arm64'">aarch64-linux-android</_Triple> | ||
<_Triple Condition="'$(TargetArchitecture)' == 'x86'">i686-linux-android</_Triple> | ||
<_Triple Condition="'$(TargetArchitecture)' == 'x64'">x86_64-linux-android</_Triple> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<_AsOptions>-target $(_Triple) -c -x assembler</_AsOptions> | ||
<_LdName>clang</_LdName> | ||
<_LdOptions>-fuse-ld=lld</_LdOptions> | ||
<_AsName>clang</_AsName> | ||
</PropertyGroup> | ||
|
||
<!-- Extend default AOT arguments --> | ||
<ItemGroup> | ||
<MonoAOTCompilerDefaultAotArguments Include="static" /> | ||
<MonoAOTCompilerDefaultAotArguments Include="dwarfdebug" /> | ||
<MonoAOTCompilerDefaultAotArguments Condition="'$(_IsLibraryMode)' == 'true'" Include="direct-icalls" /> | ||
<MonoAOTCompilerDefaultAotArguments Condition="'$(_UsesRuntimeInitCallback)' == 'true' and $(CustomRuntimeInitCallback) == ''" Include="runtime-init-callback" /> | ||
<MonoAOTCompilerDefaultAotArguments Condition="'$(_UsesRuntimeInitCallback)' == 'true' and $(CustomRuntimeInitCallback) != ''" Include="runtime-init-callback=$(CustomRuntimeInitCallback)" /> | ||
|
||
<MonoAOTCompilerDefaultAotArguments Include="nimt-trampolines=2000" /> | ||
<MonoAOTCompilerDefaultAotArguments Include="ntrampolines=10000" /> | ||
<MonoAOTCompilerDefaultAotArguments Include="nrgctx-fetch-trampolines=256" /> | ||
<MonoAOTCompilerDefaultAotArguments Include="ngsharedvt-trampolines=4400" /> | ||
<MonoAOTCompilerDefaultAotArguments Include="nftnptr-arg-trampolines=4000" /> | ||
<MonoAOTCompilerDefaultAotArguments Include="nrgctx-trampolines=31000" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup> | ||
|
@@ -150,11 +128,6 @@ | |
<AndroidLibraryMinApiLevel Condition="'$(AndroidLibraryMinApiLevel)' == ''">21</AndroidLibraryMinApiLevel> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(AOTWithLibraryFiles)' == 'true' or '$(_IsLibraryMode)' == 'true'"> | ||
<_AsPrefixPath>$([MSBuild]::EnsureTrailingSlash('$(_AsPrefixPath)'))</_AsPrefixPath> | ||
<_ToolPrefixPath>$([MSBuild]::EnsureTrailingSlash('$(_ToolPrefixPath)'))</_ToolPrefixPath> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<_AotInputAssemblies Include="@(_AssembliesToBundleInternal)" | ||
Condition="'%(_AssembliesToBundleInternal._InternalForceInterpret)' != 'true'"> | ||
|
@@ -246,16 +219,23 @@ | |
</Target> | ||
|
||
|
||
<Target | ||
Name="_AndroidGenerateAppBundle" | ||
<Target Name="_AndroidGenerateAppBundle" | ||
Condition="$(AndroidGenerateAppBundle) == 'true'" | ||
DependsOnTargets="_AndroidGenerateRuntimeConfig"> | ||
|
||
<ItemGroup Condition="'$(_IsLibraryMode)' == 'true'"> | ||
<_NativeDependencies Include="$(LibraryOutputPath)" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup> | ||
<!-- TODO: Revisit this. | ||
We are using a private property to determine the target runtime, we should instead unify the resolution with Apple targets instead, (see: https://github.com/dotnet/runtime/issues/111923) --> | ||
<_RuntimeFlavor>Mono</_RuntimeFlavor> | ||
<_RuntimeFlavor Condition="'$(UseMonoRuntime)' == 'false' and '$(UseNativeAOTRuntime)' != 'true'">CoreCLR</_RuntimeFlavor> | ||
</PropertyGroup> | ||
|
||
<AndroidAppBuilderTask | ||
RuntimeFlavor="$(_RuntimeFlavor)" | ||
AppDir="$(AndroidBuildDir)" | ||
Assemblies="@(_AssembliesToBundleInternal)" | ||
DiagnosticPorts="$(DiagnosticPorts)" | ||
|
@@ -266,13 +246,13 @@ | |
ForceInterpreter="$(MonoForceInterpreter)" | ||
IsLibraryMode="$(_IsLibraryMode)" | ||
MainLibraryFileName="$(MainLibraryFileName)" | ||
MonoRuntimeHeaders="$(_MonoHeaderPath)" | ||
MonoRuntimeHeaders="$(RuntimeHeaders)" | ||
NativeDependencies="@(_NativeDependencies)" | ||
OutputDir="$(AndroidBundleDir)" | ||
ProjectName="$(AssemblyName)" | ||
ProjectName="$(AppName)" | ||
RuntimeComponents="@(RuntimeComponents)" | ||
RuntimeIdentifier="$(RuntimeIdentifier)" | ||
StripDebugSymbols="False"> | ||
StripDebugSymbols="$(StripDebugSymbols)"> | ||
<Output TaskParameter="ApkBundlePath" PropertyName="ApkBundlePath" /> | ||
<Output TaskParameter="ApkPackageId" PropertyName="ApkPackageId" /> | ||
</AndroidAppBuilderTask> | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.