-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Android] Introduce NetTraceToMibcConverter task & streamline testing…
… targets (#72394) NetTraceToMibcConverter - Used in profiled AOT scenarios where a .nettrace file is given as input and is converted to a .mibc file that can be fed into the AOT compiler. This previously was in the AotCompiler task, but for clarity purposes is now separated out. Streamline Android testing targets - The testing targets function the same, but are now structured similarly to iOS and Wasm. - Introduced new testing properties to support profiled AOT: NetTraceFilePath - The path to a .nettrace file that will be converted into a .mibc file and fed into the aot compiler RuntimeComponents - The list of native components to include in the test app build (diagnostics_tracing) DiagnosticsPorts - The ip address:port where the runtime will listen when running diagnostic tooling DiagnosticStartupMode - The mode the runtime will use at startup for diagnostic scenarios. Suspend will halt the app very early and wait, while nosuspend will wait for a connection, but not halt the runtime Co-authored-by: Mitchell Hwang <[email protected]>
- Loading branch information
Showing
20 changed files
with
626 additions
and
351 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<BundleTestAppTargets>$(BundleTestAppTargets);BundleTestAndroidApp</BundleTestAppTargets> | ||
</PropertyGroup> | ||
|
||
<Import Project="$(MonoProjectRoot)\msbuild\android\build\AndroidApp.props" /> | ||
<Import Project="$(MonoProjectRoot)\msbuild\android\build\AndroidApp.InTree.targets" /> | ||
|
||
<PropertyGroup> | ||
<AndroidBuildAppDependsOn>PrepareForAndroidBuildApp;$(AndroidBuildAppDependsOn);_CopyTestArchive</AndroidBuildAppDependsOn> | ||
|
||
<BundleTestAndroidAppDependsOn>AndroidBuildApp</BundleTestAndroidAppDependsOn> | ||
</PropertyGroup> | ||
|
||
<!-- Target that kicks off the whole test build and run flow --> | ||
<Target Name="BundleTestAndroidApp" DependsOnTargets="$(BundleTestAndroidAppDependsOn)" /> | ||
|
||
<Target Name="PrepareForAndroidBuildApp"> | ||
<Error Condition="!Exists('$(MicrosoftNetCoreAppRuntimePackRidDir)')" Text="MicrosoftNetCoreAppRuntimePackRidDir=$(MicrosoftNetCoreAppRuntimePackRidDir) doesn't exist" /> | ||
|
||
<WriteLinesToFile File="$(PublishDir)xunit-excludes.txt" Lines="$(XunitExcludesTxtFileContent)" Overwrite="true" /> | ||
|
||
<PropertyGroup> | ||
<MainLibraryFileName Condition="'$(MainLibraryFileName)' == ''">AndroidTestRunner.dll</MainLibraryFileName> | ||
|
||
<AndroidAppDir>$(PublishDir)</AndroidAppDir> | ||
<AndroidAppBundleDir>$(BundleDir)</AndroidAppBundleDir> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<AndroidEnv Condition="'$(XUnitSingleThreadedMode)' == 'true'" Include="XUNIT_SINGLE_THREADED"> | ||
<Value>1</Value> | ||
</AndroidEnv> | ||
<AndroidEnv Condition="'$(XUnitUseRandomizedTestOrderer)' == 'true'" Include="XUNIT_RANDOM_ORDER_SEED"> | ||
<Value>1883302047</Value> | ||
</AndroidEnv> | ||
<AndroidEnv Condition="'$(XUnitSingleThreadedMode)' == 'true'" Include="XUNIT_VERBOSE"> | ||
<Value>1</Value> | ||
</AndroidEnv> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<AndroidAssembliesToBundle Include="@(NativeLibraries->'$(PublishDir)%(Identity)')"> | ||
<_InternalForceInterpret>true</_InternalForceInterpret> | ||
<_IsNative>true</_IsNative> | ||
</AndroidAssembliesToBundle> | ||
|
||
<_PublishAssemblies Include="$(PublishDir)\**\*.dll" Exclude="$(PublishDir)\**\*.resources.dll" /> | ||
<_SatelliteAssemblies Include="$(PublishDir)\**\*.resources.dll" /> | ||
|
||
<AndroidAssembliesToBundle Include="@(_PublishAssemblies)"> | ||
<_InternalForceInterpret Condition="'$(UseMonoJustInterp)' == 'true' and '%(FileName)%(Extension)' != 'System.Private.CoreLib.dll'">true</_InternalForceInterpret> | ||
<_IsNative>false</_IsNative> | ||
</AndroidAssembliesToBundle> | ||
|
||
<AndroidNativeFilesToBundle Include="$(PublishDir)\**\*.*" Exclude="$(PublishDir)\*.dll" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<Target Name="_CopyTestArchive" | ||
Condition="'$(ArchiveTests)' == 'true' and '$(IgnoreForCI)' != 'true'"> | ||
<Error Condition="'$(TestArchiveTestsDir)' == ''" Text="TestArchiveTestsDir property to archive the test folder must be set." /> | ||
|
||
<Message Importance="High" Text="PackageId: $(ApkPackageId)"/> | ||
<Message Importance="High" Text="Instrumentation: net.dot.MonoRunner"/> | ||
<Message Importance="High" Text="Apk: $(ApkBundlePath)"/> | ||
|
||
<Copy SourceFiles="$(ApkBundlePath)" | ||
DestinationFolder="$(TestArchiveTestsDir)" | ||
SkipUnchangedFiles="true" | ||
Condition="'$(ArchiveTests)' == 'true' and '$(IgnoreForCI)' != 'true'" /> | ||
</Target> | ||
|
||
</Project> |
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<Project> | ||
<!-- This depends on the root Directory.Build.props imported this file --> | ||
|
||
<Import Project="$(MSBuildThisFileDirectory)AndroidApp.props" /> | ||
<PropertyGroup> | ||
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework> | ||
<EnableTargetingPackDownload>false</EnableTargetingPackDownload> | ||
<EnableRuntimePackDownload>false</EnableRuntimePackDownload> | ||
<PublishTrimmed>true</PublishTrimmed> | ||
<TrimMode>link</TrimMode> | ||
<RunAnalyzers>false</RunAnalyzers> | ||
</PropertyGroup> | ||
</Project> |
This file contains 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<Project> | ||
<!-- This depends on the root Directory.Build.targets imported this file --> | ||
<UsingTask TaskName="MonoAOTCompiler" AssemblyFile="$(MonoAOTCompilerTasksAssemblyPath)" /> | ||
<UsingTask TaskName="NetTraceToMibcConverter" AssemblyFile="$(MonoTargetsTasksAssemblyPath)" /> | ||
<UsingTask TaskName="RuntimeConfigParserTask" AssemblyFile="$(MonoTargetsTasksAssemblyPath)" /> | ||
|
||
<Import Project="$(MSBuildThisFileDirectory)AndroidApp.targets" /> | ||
|
||
<!-- Use local runtime pack --> | ||
<Target Name="UpdateRuntimePack" AfterTargets="ResolveFrameworkReferences"> | ||
<PropertyGroup> | ||
<_LocalMicrosoftNetCoreAppRuntimePackDir>$(MicrosoftNetCoreAppRuntimePackDir)</_LocalMicrosoftNetCoreAppRuntimePackDir> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<ResolvedRuntimePack PackageDirectory="$(_LocalMicrosoftNetCoreAppRuntimePackDir)" | ||
Condition="'$(_LocalMicrosoftNetCoreAppRuntimePackDir)' != '' and | ||
'%(ResolvedRuntimePack.FrameworkName)' == 'Microsoft.NETCore.App'" /> | ||
</ItemGroup> | ||
<Message Text="Used runtime pack: %(ResolvedRuntimePack.PackageDirectory)" Importance="high" /> | ||
</Target> | ||
</Project> |
This file contains 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<RuntimeIdentifier>$(TargetOS.ToLowerInvariant())-$(TargetArchitecture.ToLowerInvariant())</RuntimeIdentifier> | ||
<UseMonoRuntime>true</UseMonoRuntime> | ||
<UseMonoJustInterp Condition="'$(RunAOTCompilation)' == 'true' and '$(MonoForceInterpreter)' == 'true'">true</UseMonoJustInterp> | ||
|
||
<AndroidBuildAppAfterThisTarget Condition="'$(AndroidBuildAppAfterThisTarget)' == ''">Publish</AndroidBuildAppAfterThisTarget> | ||
<AndroidBuildAppDependsOn> | ||
_InitializeCommonProperties; | ||
_BeforeAndroidBuildApp; | ||
_AndroidResolveReferences; | ||
_AndroidPrepareProfiledAot; | ||
_AndroidAotCompileApp; | ||
_AndroidGenerateAppBundle; | ||
_AfterAndroidBuildApp | ||
</AndroidBuildAppDependsOn> | ||
</PropertyGroup> | ||
</Project> |
Oops, something went wrong.