From 6941ea1c957be97e32ceb696e616752f9526b6bf Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Tue, 17 Aug 2021 13:25:53 -0400 Subject: [PATCH 1/2] [One .NET] Include symbol files in runtime packs Adds the .pdb files associated with our framework assemblies to the .NET runtime packs. This will allow them to be fast deployed or included in an .aab/.apk for Debug builds. A couple of symbol related tests have been updated to also check for Mono.Android.pdb. --- build-tools/create-packs/Microsoft.Android.Runtime.proj | 1 + .../Tests/Xamarin.Android.Build.Tests/BuildTest.cs | 3 +++ tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/build-tools/create-packs/Microsoft.Android.Runtime.proj b/build-tools/create-packs/Microsoft.Android.Runtime.proj index cdf18885614..ece5b3b99c7 100644 --- a/build-tools/create-packs/Microsoft.Android.Runtime.proj +++ b/build-tools/create-packs/Microsoft.Android.Runtime.proj @@ -46,6 +46,7 @@ projects that use the Microsoft.Android framework in .NET 5. <_PackageFiles Include="@(_AndroidRuntimePackAssemblies)" PackagePath="$(_AndroidRuntimePackAssemblyPath)" TargetPath="$(_AndroidRuntimePackAssemblyPath)" /> + <_PackageFiles Include="@(_AndroidRuntimePackAssemblies->'%(RelativeDir)%(Filename).pdb')" PackagePath="$(_AndroidRuntimePackAssemblyPath)" /> <_PackageFiles Include="@(_AndroidRuntimePackAssets)" PackagePath="$(_AndroidRuntimePackNativePath)" TargetPath="$(_AndroidRuntimePackNativePath)" IsNative="true" /> diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs index 71fedcecc38..d6d2ee7e680 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs @@ -1435,6 +1435,9 @@ public Class2 () var outputPath = Path.Combine (Root, b.ProjectDirectory, proj.OutputPath); var assetsPdb = Path.Combine (intermediate, "android", "assets", "Library1.pdb"); var binSrc = Path.Combine (outputPath, "Library1.pdb"); + Assert.IsTrue ( + File.Exists (Path.Combine (intermediate, "android", "assets", "Mono.Android.pdb")), + "Mono.Android.pdb must be copied to Intermediate directory"); Assert.IsTrue ( File.Exists (assetsPdb), "Library1.pdb must be copied to Intermediate directory"); diff --git a/tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs b/tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs index 2ed567d90a3..01af7277dda 100755 --- a/tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs +++ b/tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs @@ -361,11 +361,13 @@ public Foo () Assert.True (appBuilder.Install (app, parameters: parameters.ToArray ()), "App should have installed."); if (!embedAssemblies) { - // Check that we deployed .pdb files + // Check that we deployed app and framework .pdb files StringAssertEx.ContainsRegex ($@"NotifySync CopyFile.+{app.ProjectName}\.pdb", appBuilder.LastBuildOutput, $"{app.ProjectName}.pdb should be deployed!"); StringAssertEx.ContainsRegex ($@"NotifySync CopyFile.+{lib.ProjectName}\.pdb", appBuilder.LastBuildOutput, $"{lib.ProjectName}.pdb should be deployed!"); + StringAssertEx.ContainsRegex ($@"NotifySync CopyFile.+Mono.Android\.pdb", appBuilder.LastBuildOutput, + $"Mono.Android.pdb should be deployed!"); } int breakcountHitCount = 0; From c49c403d00eb449a1a2829fa0dedd8313ea3fa2a Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Tue, 17 Aug 2021 18:41:09 -0400 Subject: [PATCH 2/2] Don't skip net6.0 msbuild smoke tests --- .../automation/yaml-templates/run-msbuild-device-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-tools/automation/yaml-templates/run-msbuild-device-tests.yaml b/build-tools/automation/yaml-templates/run-msbuild-device-tests.yaml index 92376221e17..8f5ece7abde 100644 --- a/build-tools/automation/yaml-templates/run-msbuild-device-tests.yaml +++ b/build-tools/automation/yaml-templates/run-msbuild-device-tests.yaml @@ -59,7 +59,7 @@ jobs: testRunTitle: MSBuildDeviceIntegration On Device - macOS - ${{ parameters.job_suffix }} testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/MSBuildDeviceIntegration/${{ parameters.target_framework }}/MSBuildDeviceIntegration.dll nunitConsoleExtraArgs: --where "cat != SystemApplication && cat != TimeZoneInfo && cat != SmokeTests ${{ parameters.nunit_categories }}" - dotNetTestExtraArgs: --filter "TestCategory != TimeZoneInfo & TestCategory != SmokeTests ${{ parameters.nunit_categories }}" + dotNetTestExtraArgs: --filter "TestCategory != TimeZoneInfo ${{ parameters.nunit_categories }}" testResultsFile: TestResult-MSBuildDeviceIntegration-${{ parameters.job_name }}-$(XA.Build.Configuration).xml - task: MSBuild@1