-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[android] Internal Android sample build improvements #111545
base: main
Are you sure you want to change the base?
Conversation
/azp run runtime-android, runtime-androidemulator |
Azure Pipelines successfully started running 2 pipeline(s). |
/azp run runtime-android, runtime-androidemulator |
Azure Pipelines successfully started running 2 pipeline(s). |
324207b
to
99460e7
Compare
/azp run runtime-android, runtime-androidemulator |
Azure Pipelines successfully started running 2 pipeline(s). |
/azp run runtime-android, runtime-androidemulator |
Azure Pipelines successfully started running 2 pipeline(s). |
/azp run runtime-android, runtime-androidemulator |
Azure Pipelines successfully started running 2 pipeline(s). |
/azp run runtime-ioslike-mono |
No pipelines are associated with this pull request. |
/azp run runtime-ioslike |
Azure Pipelines successfully started running 1 pipeline(s). |
TaskName="NdkToolFinderTask" | ||
AssemblyFile="$(MobileBuildTasksAssemblyPath)" /> | ||
<!-- Import default AOT arguments --> | ||
<Import Condition="'$(RunAOTCompilation)' == 'true'" Project="$(RepoTasksDir)AotCompilerTask\MonoAOTCompiler.props" /> |
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.
The path to the props file needs generically set similarly to how we locate the task assembly.
See
<UsingTask TaskName="MonoAOTCompiler" AssemblyFile="$(MonoAOTCompilerTasksAssemblyPath)" /> |
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.
It'll need to be shipped as well, so whatever property you define, add one here too.
runtime/src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Sdk/MonoTargetsTasks.props.in
Lines 2 to 5 in fc55602
<PropertyGroup> | |
<MonoTargetsTasksAssemblyPath Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tasks\${NetCoreAppToolCurrent}\MonoTargetsTasks.dll</MonoTargetsTasksAssemblyPath> | |
<MonoTargetsTasksAssemblyPath Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tasks\${NetFrameworkToolCurrent}\MonoTargetsTasks.dll</MonoTargetsTasksAssemblyPath> | |
</PropertyGroup> |
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.
Thanks, please see: 0b338b8
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.
- Added a functional tests for testing library mode on CI,
- Verified that the
LibraryBuilder.Sdk.10.0.0-dev.nupkg
contains the props file:
x _rels/.rels
x Microsoft.NET.Runtime.LibraryBuilder.Sdk.nuspec
x Icon.png
x LICENSE.TXT
x Sdk/AutoImport.props
x Sdk/Sdk.props
x Sdk/AndroidBuild.props
x Sdk/AndroidBuild.targets
x Sdk/AppleBuild.props
x Sdk/AppleBuild.targets
x Sdk/LibraryBuilder.props
x Sdk/LibraryBuilder.targets
x Sdk/CommonMobileBuild.props
x Sdk/MonoAOTCompiler.props
...
- Verified that the properties are properly included with E2E test
I think we can close #110811 after the PR is merged |
<ItemGroup Condition="'$(TargetOS)' == 'android' or '$(TargetOS)' == 'ios' or '$(TargetOS)' == 'iossimulator' or '$(TargetOS)' == 'tvos' or '$(TargetOS)' == 'tvossimulator' or '$(TargetOS)' == 'maccatalyst'"> | ||
<!-- Default trampolines run out for libraries tests --> | ||
<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=21000" /> |
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.
Interesting, seems we had different values between sample and android/build. Great to see it unified
/azp run runtime-android, runtime-androidemulator, runtime-ioslike |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run runtime-android, runtime-androidemulator, runtime-ioslike |
Azure Pipelines successfully started running 3 pipeline(s). |
@@ -94,7 +93,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 comment
The 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 ForceFullAOT
(I found its usage only on your library sample repo).
So I switched it to this combination, maybe it needs a refinement
Description
In context of runtime consolidation efforts, this PR simplifies the Android sample build process by moving default AOT properties to a common props file and using
AndroidBuild.targets
in AndroidSampleApp.Fixes: #110811