-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[Android] Introduce NetTraceToMibcConverter task & streamline testing targets #72394
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
Changes from all commits
4042acb
5821443
3363776
55c411a
958b162
1541370
652720c
d4ac4a8
25f7010
a1a69e9
b4b107e
83d5af7
2144902
a6ae5f0
96d4bcb
86e498a
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,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)"> | ||||||||||||||||
Comment on lines
+48
to
+51
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. Nit since publish assesmblies naming implis all assemblies, and it doesnt seem like its being used elsewhere, so is there a benefit to having it in a separate itemgroup rather than explicitly defining
Suggested change
Is there a particular reason we are keeping track of SatelliteAssemblies in an itemgroup? 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. I could be wrong, but I think the paths need expanded in an item first before you can condition them like we do in 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. Ah do you mean the metadata getting set properly? I think it still works properly before getting expanded. With a console project with
So it looks like the metadata is still set properly |
||||||||||||||||
<_InternalForceInterpret Condition="'$(UseMonoJustInterp)' == 'true' and '%(FileName)%(Extension)' != 'System.Private.CoreLib.dll'">true</_InternalForceInterpret> | ||||||||||||||||
<_IsNative>false</_IsNative> | ||||||||||||||||
</AndroidAssembliesToBundle> | ||||||||||||||||
|
||||||||||||||||
<AndroidNativeFilesToBundle Include="$(PublishDir)\**\*.*" Exclude="$(PublishDir)\*.dll" /> | ||||||||||||||||
mdh1418 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||
</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> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<Project> | ||
steveisok marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<!-- 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> |
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)" /> | ||
steveisok marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<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> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<RuntimeIdentifier>$(TargetOS.ToLowerInvariant())-$(TargetArchitecture.ToLowerInvariant())</RuntimeIdentifier> | ||
steveisok marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<UseMonoRuntime>true</UseMonoRuntime> | ||
steveisok marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<UseMonoJustInterp Condition="'$(RunAOTCompilation)' == 'true' and '$(MonoForceInterpreter)' == 'true'">true</UseMonoJustInterp> | ||
|
||
<AndroidBuildAppAfterThisTarget Condition="'$(AndroidBuildAppAfterThisTarget)' == ''">Publish</AndroidBuildAppAfterThisTarget> | ||
mdh1418 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<AndroidBuildAppDependsOn> | ||
_InitializeCommonProperties; | ||
_BeforeAndroidBuildApp; | ||
_AndroidResolveReferences; | ||
_AndroidPrepareProfiledAot; | ||
_AndroidAotCompileApp; | ||
_AndroidGenerateAppBundle; | ||
_AfterAndroidBuildApp | ||
steveisok marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</AndroidBuildAppDependsOn> | ||
</PropertyGroup> | ||
</Project> |
Uh oh!
There was an error while loading. Please reload this page.