From de8dba43067c634f2a109f4d621c9403cd183db9 Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Tue, 11 Apr 2023 15:10:51 -0500 Subject: [PATCH] [Xamarin.Android.Build.Tasks] remove `pdb2mdb` Remove where we `ILRepack` `pdb2mdb.exe` into `Xamarin.Android.Build.Tasks.dll` and the `` MSBuild task. These are not used in .NET 6+, and can be removed in xamarin-android/main. I also removed: * Code or tests around `.mdb` files * Tests around `DebugType=Full` In future PRs, I think we can remove: * `ILRepack` completely * `Xamarin.Android.Legacy.targets` * Other unused MSBuild tasks --- .../symbols/SymbolArchiveWhiteList.csv | 1 - .../xaprepare/ConfigAndData/Runtimes.cs | 1 - .../Tasks/BuildApk.cs | 8 +- .../Tasks/ConvertDebuggingFiles.cs | 44 -------- .../BuildTest.TestCaseSource.cs | 101 ------------------ .../Xamarin.Android.Build.Tests/BuildTest.cs | 80 +------------- .../Xamarin.Android.Build.Tests/BuildTest2.cs | 78 ++------------ .../IncrementalBuildTest.cs | 5 - .../Utilities/ArchiveAssemblyHelper.cs | 1 - .../Xamarin.Android.Build.Tasks.csproj | 3 - .../Xamarin.Android.Build.Tasks.targets | 1 - .../Xamarin.Android.Common.targets | 10 -- .../Xamarin.Android.Legacy.targets | 27 +---- .../Tests/DebuggingTest.cs | 19 +--- 14 files changed, 15 insertions(+), 364 deletions(-) delete mode 100644 src/Xamarin.Android.Build.Tasks/Tasks/ConvertDebuggingFiles.cs diff --git a/build-tools/create-vsix/symbols/SymbolArchiveWhiteList.csv b/build-tools/create-vsix/symbols/SymbolArchiveWhiteList.csv index ab5916189e8..96de1bfcc56 100644 --- a/build-tools/create-vsix/symbols/SymbolArchiveWhiteList.csv +++ b/build-tools/create-vsix/symbols/SymbolArchiveWhiteList.csv @@ -17,4 +17,3 @@ xamarin.android.sdk*\xamarin.android.sdk*.vsixdir\*msbuild\xamarin\android\Java. xamarin.android.sdk*\xamarin.android.sdk*.vsixdir\*msbuild\xamarin\android\mdoc.exe, Fails Pdb2Pdb.exe conversion. xamarin.android.sdk*\xamarin.android.sdk*.vsixdir\*msbuild\xamarin\android\mkbundle.exe, Fails Pdb2Pdb.exe conversion. xamarin.android.sdk*\xamarin.android.sdk*.vsixdir\*msbuild\xamarin\android\mono-symbolicate.exe, Fails Pdb2Pdb.exe conversion. -xamarin.android.sdk*\xamarin.android.sdk*.vsixdir\*msbuild\xamarin\android\pdb2mdb.exe, Fails Pdb2Pdb.exe conversion. diff --git a/build-tools/xaprepare/xaprepare/ConfigAndData/Runtimes.cs b/build-tools/xaprepare/xaprepare/ConfigAndData/Runtimes.cs index 8625b0df471..92a0646928b 100644 --- a/build-tools/xaprepare/xaprepare/ConfigAndData/Runtimes.cs +++ b/build-tools/xaprepare/xaprepare/ConfigAndData/Runtimes.cs @@ -407,7 +407,6 @@ partial class Runtimes new MonoUtilityFile ("monodoc.dll.config", ignoreDebugInfo: true), new MonoUtilityFile ("mono-api-html.exe", remap: true), new MonoUtilityFile ("mono-api-info.exe", remap: true), - new MonoUtilityFile ("pdb2mdb.exe", remap: true), new MonoUtilityFile ("ICSharpCode.SharpZipLib.dll", remap: false), new MonoUtilityFile ("Mono.CompilerServices.SymbolWriter.dll", remap: false), new MonoUtilityFile ("aprofutil.exe", remap: false), diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs b/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs index 3b9b763d3af..1fc8295b0c1 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs @@ -464,17 +464,11 @@ void AddAssembliesFromCollection (ITaskItem[] assemblies) // Try to add symbols if Debug if (debug) { - var symbols = Path.ChangeExtension (assembly.ItemSpec, "dll.mdb"); + var symbols = Path.ChangeExtension (assembly.ItemSpec, "pdb"); string symbolsPath = null; if (File.Exists (symbols)) { symbolsPath = symbols; - } else { - symbols = Path.ChangeExtension (assembly.ItemSpec, "pdb"); - - if (File.Exists (symbols)) { - symbolsPath = symbols; - } } if (!String.IsNullOrEmpty (symbolsPath)) { diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/ConvertDebuggingFiles.cs b/src/Xamarin.Android.Build.Tasks/Tasks/ConvertDebuggingFiles.cs deleted file mode 100644 index edb79829e5c..00000000000 --- a/src/Xamarin.Android.Build.Tasks/Tasks/ConvertDebuggingFiles.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.IO; -using System.Collections.Generic; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; -using Pdb2Mdb; -using Microsoft.Android.Build.Tasks; - -namespace Xamarin.Android.Tasks -{ - public class ConvertDebuggingFiles : AndroidTask - { - public override string TaskPrefix => "CDF"; - - // The .pdb files we need to convert - [Required] - public ITaskItem[] Files { get; set; } - - [Output] - public ITaskItem[] ConvertedFiles { get; set; } - - public override bool RunTask () - { - var convertedFiles = new List (); - foreach (var file in Files) { - var pdb = file.ItemSpec; - - if (!File.Exists (pdb)) - continue; - - try { - Microsoft.Android.Build.Tasks.Files.SetWriteable (pdb); - Converter.Convert (Path.ChangeExtension (pdb, ".dll")); - convertedFiles.Add (new TaskItem (Path.ChangeExtension (pdb, ".dll"))); - } catch (Exception ex) { - Log.LogWarningFromException (ex, true); - } - } - ConvertedFiles = convertedFiles.ToArray (); - Log.LogDebugTaskItems ("[Output] ConvertedFiles:", ConvertedFiles); - return true; - } - } -} diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.TestCaseSource.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.TestCaseSource.cs index e12617fa18a..f0f22e2ef53 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.TestCaseSource.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.TestCaseSource.cs @@ -16,7 +16,6 @@ public partial class BuildTest : BaseTest new object[] { /* supportedAbi */ "armeabi-v7a", /* debugSymbols */ true , - /* debugType */ "Full", /* optimize */ true , /* embedassebmlies */ true , /* expectedResult */ "release", @@ -24,7 +23,6 @@ public partial class BuildTest : BaseTest new object[] { /* supportedAbi */ "armeabi-v7a", /* debugSymbols */ true , - /* debugType */ "Full", /* optimize */ true , /* embedassebmlies */ false , /* expectedResult */ CommercialBuildAvailable ? "debug" : "release", @@ -32,7 +30,6 @@ public partial class BuildTest : BaseTest new object[] { /* supportedAbi */ "armeabi-v7a", /* debugSymbols */ true , - /* debugType */ "Full", /* optimize */ false , /* embedassebmlies */ true , /* expectedResult */ "debug", @@ -40,39 +37,6 @@ public partial class BuildTest : BaseTest new object[] { /* supportedAbi */ "armeabi-v7a", /* debugSymbols */ true , - /* debugType */ "Full", - /* optimize */ false , - /* embedassebmlies */ false , - /* expectedResult */ "debug", - }, - new object[] { - /* supportedAbi */ "armeabi-v7a", - /* debugSymbols */ true , - /* debugType */ "", - /* optimize */ true , - /* embedassebmlies */ true , - /* expectedResult */ "release", - }, - new object[] { - /* supportedAbi */ "armeabi-v7a", - /* debugSymbols */ true , - /* debugType */ "", - /* optimize */ true , - /* embedassebmlies */ false , - /* expectedResult */ CommercialBuildAvailable ? "debug" : "release", - }, - new object[] { - /* supportedAbi */ "armeabi-v7a", - /* debugSymbols */ true , - /* debugType */ "", - /* optimize */ false , - /* embedassebmlies */ true , - /* expectedResult */ "debug", - }, - new object[] { - /* supportedAbi */ "armeabi-v7a", - /* debugSymbols */ true , - /* debugType */ "", /* optimize */ false , /* embedassebmlies */ false , /* expectedResult */ "debug", @@ -80,7 +44,6 @@ public partial class BuildTest : BaseTest new object[] { /* supportedAbi */ "armeabi-v7a", /* debugSymbols */ false , - /* debugType */ "", /* optimize */ null , /* embedassebmlies */ null , /* expectedResult */ CommercialBuildAvailable ? "debug" : "release", @@ -88,63 +51,11 @@ public partial class BuildTest : BaseTest }; static object [] SequencePointChecks () => new object [] { - new object[] { - /* isRelease */ false, - /* monoSymbolArchive */ false , - /* aotAssemblies */ false, - /* debugSymbols */ true, - /* debugType */ "Full", - /* embedMdb */ !CommercialBuildAvailable, // because we don't use FastDev in the OSS repo - /* expectedRuntime */ "debug", - /* usesAssemblyBlobs */ false, - }, - new object[] { - /* isRelease */ false, - /* monoSymbolArchive */ false , - /* aotAssemblies */ false, - /* debugSymbols */ true, - /* debugType */ "Full", - /* embedMdb */ !CommercialBuildAvailable, // because we don't use FastDev in the OSS repo - /* expectedRuntime */ "debug", - /* usesAssemblyBlobs */ true, - }, - new object[] { - /* isRelease */ true, - /* monoSymbolArchive */ false, - /* aotAssemblies */ false, - /* debugSymbols */ true, - /* debugType */ "Full", - /* embedMdb */ false, - /* expectedRuntime */ "release", - /* usesAssemblyBlobs */ false, - }, - new object[] { - /* isRelease */ true, - /* monoSymbolArchive */ false, - /* aotAssemblies */ false, - /* debugSymbols */ true, - /* debugType */ "Full", - /* embedMdb */ false, - /* expectedRuntime */ "release", - /* usesAssemblyBlobs */ true, - }, - new object[] { - /* isRelease */ true, - /* monoSymbolArchive */ true, - /* aotAssemblies */ false, - /* debugSymbols */ true, - /* debugType */ "Full", - /* embedMdb */ false, - /* expectedRuntime */ "release", - /* usesAssemblyBlobs */ false, - }, new object[] { /* isRelease */ true, /* monoSymbolArchive */ true , /* aotAssemblies */ false, /* debugSymbols */ true, - /* debugType */ "Portable", - /* embedMdb */ false, /* expectedRuntime */ "release", /* usesAssemblyBlobs */ false, }, @@ -153,8 +64,6 @@ public partial class BuildTest : BaseTest /* monoSymbolArchive */ true , /* aotAssemblies */ true, /* debugSymbols */ true, - /* debugType */ "Portable", - /* embedMdb */ false, /* expectedRuntime */ "release", /* usesAssemblyBlobs */ false, }, @@ -163,8 +72,6 @@ public partial class BuildTest : BaseTest /* monoSymbolArchive */ false , /* aotAssemblies */ false, /* debugSymbols */ true, - /* debugType */ "Portable", - /* embedMdb */ false, /* expectedRuntime */ "release", /* usesAssemblyBlobs */ false, }, @@ -173,8 +80,6 @@ public partial class BuildTest : BaseTest /* monoSymbolArchive */ false , /* aotAssemblies */ false, /* debugSymbols */ true, - /* debugType */ "Portable", - /* embedMdb */ false, /* expectedRuntime */ "release", /* usesAssemblyBlobs */ true, }, @@ -183,8 +88,6 @@ public partial class BuildTest : BaseTest /* monoSymbolArchive */ false , /* aotAssemblies */ true, /* debugSymbols */ false, - /* debugType */ "", - /* embedMdb */ false, /* expectedRuntime */ "release", /* usesAssemblyBlobs */ false, }, @@ -193,8 +96,6 @@ public partial class BuildTest : BaseTest /* monoSymbolArchive */ true , /* aotAssemblies */ true, /* debugSymbols */ false, - /* debugType */ "", - /* embedMdb */ false, /* expectedRuntime */ "release", /* usesAssemblyBlobs */ false, }, @@ -203,8 +104,6 @@ public partial class BuildTest : BaseTest /* monoSymbolArchive */ true , /* aotAssemblies */ true, /* debugSymbols */ false, - /* debugType */ "", - /* embedMdb */ false, /* expectedRuntime */ "release", /* usesAssemblyBlobs */ 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 639e05fcb9d..5579c486fbc 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 @@ -210,11 +210,10 @@ public static string GetLinkedPath (ProjectBuilder builder, bool isRelease, stri [Test] [TestCaseSource (nameof (RuntimeChecks))] - public void CheckWhichRuntimeIsIncluded (string supportedAbi, bool debugSymbols, string debugType, bool? optimize, bool? embedAssemblies, string expectedRuntime) { + public void CheckWhichRuntimeIsIncluded (string supportedAbi, bool debugSymbols, bool? optimize, bool? embedAssemblies, string expectedRuntime) { var proj = new XamarinAndroidApplicationProject (); proj.SetAndroidSupportedAbis (supportedAbi); proj.SetProperty (proj.ActiveConfigurationProperties, "DebugSymbols", debugSymbols); - proj.SetProperty (proj.ActiveConfigurationProperties, "DebugType", debugType); if (optimize.HasValue) proj.SetProperty (proj.ActiveConfigurationProperties, "Optimize", optimize.Value); else @@ -255,7 +254,7 @@ public void CheckWhichRuntimeIsIncluded (string supportedAbi, bool debugSymbols, [Category ("AOT"), Category ("MonoSymbolicate")] [TestCaseSource (nameof (SequencePointChecks))] public void CheckSequencePointGeneration (bool isRelease, bool monoSymbolArchive, bool aotAssemblies, - bool debugSymbols, string debugType, bool embedMdb, string expectedRuntime, bool usesAssemblyBlobs) + bool debugSymbols, string expectedRuntime, bool usesAssemblyBlobs) { var proj = new XamarinAndroidApplicationProject () { IsRelease = isRelease, @@ -265,7 +264,6 @@ public void CheckSequencePointGeneration (bool isRelease, bool monoSymbolArchive proj.SetAndroidSupportedAbis (abis); proj.SetProperty (proj.ActiveConfigurationProperties, "MonoSymbolArchive", monoSymbolArchive); proj.SetProperty (proj.ActiveConfigurationProperties, "DebugSymbols", debugSymbols); - proj.SetProperty (proj.ActiveConfigurationProperties, "DebugType", debugType); proj.SetProperty (proj.ActiveConfigurationProperties, "AndroidUseAssemblyStore", usesAssemblyBlobs.ToString ()); using (var b = CreateApkBuilder ()) { Assert.IsTrue (b.Build (proj), "Build should have succeeded."); @@ -273,14 +271,11 @@ public void CheckSequencePointGeneration (bool isRelease, bool monoSymbolArchive proj.OutputPath, $"{proj.PackageName}-Signed.apk"); var msymarchive = Path.Combine (Root, b.ProjectDirectory, proj.OutputPath, proj.PackageName + ".apk.mSYM"); var helper = new ArchiveAssemblyHelper (apk, usesAssemblyBlobs); - var mdbExits = helper.Exists ("assemblies/UnnamedProject.dll.mdb") || helper.Exists ("assemblies/UnnamedProject.pdb"); - Assert.AreEqual (embedMdb, mdbExits, - $"assemblies/UnnamedProject.dll.mdb or assemblies/UnnamedProject.pdb should{0}be in the {proj.PackageName}-Signed.apk", embedMdb ? " " : " not "); if (aotAssemblies) { foreach (var abi in abis) { var assemblies = Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "aot", abi, "libaot-UnnamedProject.dll.so"); - var shouldExist = monoSymbolArchive && debugSymbols && (debugType == "PdbOnly" || debugType == "Portable"); + var shouldExist = monoSymbolArchive && debugSymbols; var symbolicateFile = Directory.GetFiles (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "aot", abi), "UnnamedProject.dll.msym", SearchOption.AllDirectories).FirstOrDefault (); if (shouldExist) @@ -1061,75 +1056,6 @@ public void CompileBeforeUpgradingNuGet () } } - [Test] - [Category ("DotNetIgnore")] // .mdb and non-portable .pdb files not supported in .NET 5+ - public void BuildBasicApplicationCheckPdb () - { - var proj = new XamarinAndroidApplicationProject { - EmbedAssembliesIntoApk = true, - }; - using (var b = CreateApkBuilder ()) { - var reference = new BuildItem.Reference ("PdbTestLibrary.dll") { - WebContentFileNameFromAzure = "PdbTestLibrary.dll" - }; - proj.References.Add (reference); - var pdb = new BuildItem.NoActionResource ("PdbTestLibrary.pdb") { - WebContentFileNameFromAzure = "PdbTestLibrary.pdb" - }; - proj.References.Add (pdb); - var netStandardRef = new BuildItem.Reference ("NetStandard16.dll") { - WebContentFileNameFromAzure = "NetStandard16.dll" - }; - proj.References.Add (netStandardRef); - var netStandardpdb = new BuildItem.NoActionResource ("NetStandard16.pdb") { - WebContentFileNameFromAzure = "NetStandard16.pdb" - }; - proj.References.Add (netStandardpdb); - Assert.IsTrue (b.Build (proj), "Build should have succeeded."); - var pdbToMdbPath = Path.Combine (Root, b.ProjectDirectory, "PdbTestLibrary.dll.mdb"); - Assert.IsTrue ( - File.Exists (pdbToMdbPath), - "PdbTestLibrary.dll.mdb must be generated next to the .pdb"); - Assert.IsTrue ( - File.Exists (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "android", "assets", "UnnamedProject.pdb")), - "UnnamedProject.pdb must be copied to the Intermediate directory"); - Assert.IsFalse ( - File.Exists (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "android", "assets", "PdbTestLibrary.pdb")), - "PdbTestLibrary.pdb must not be copied to Intermediate directory"); - Assert.IsTrue ( - File.Exists (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "android", "assets", "PdbTestLibrary.dll.mdb")), - "PdbTestLibrary.dll.mdb must be copied to Intermediate directory"); - FileAssert.AreNotEqual (pdbToMdbPath, - Path.Combine (Root, b.ProjectDirectory, "PdbTestLibrary.pdb"), - "The .pdb should NOT match the .mdb"); - Assert.IsTrue ( - File.Exists (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "android", "assets", "NetStandard16.pdb")), - "NetStandard16.pdb must be copied to Intermediate directory"); - var apk = Path.Combine (Root, b.ProjectDirectory, - proj.OutputPath, $"{proj.PackageName}-Signed.apk"); - using (var zipFile = ZipHelper.OpenZip (apk)) { - Assert.IsNotNull (ZipHelper.ReadFileFromZip (zipFile, - "assemblies/NetStandard16.pdb"), - "assemblies/NetStandard16.pdb should exist in the apk."); - Assert.IsNotNull (ZipHelper.ReadFileFromZip (zipFile, - "assemblies/PdbTestLibrary.dll.mdb"), - "assemblies/PdbTestLibrary.dll.mdb should exist in the apk."); - Assert.IsNull (ZipHelper.ReadFileFromZip (zipFile, - "assemblies/PdbTestLibrary.pdb"), - "assemblies/PdbTestLibrary.pdb should not exist in the apk."); - } - b.BuildLogFile = "build1.log"; - Assert.IsTrue (b.Build (proj, doNotCleanupOnUpdate: true), "second build failed"); - b.BuildLogFile = "build2.log"; - var lastTime = File.GetLastWriteTimeUtc (pdbToMdbPath); - pdb.Timestamp = DateTimeOffset.UtcNow; - Assert.IsTrue (b.Build (proj, doNotCleanupOnUpdate: true), "third build failed"); - Assert.Less (lastTime, - File.GetLastWriteTimeUtc (pdbToMdbPath), - "{0} should have been updated", pdbToMdbPath); - } - } - [Test] public void BuildInDesignTimeMode ([Values(false, true)] bool useManagedParser) { diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs index 679b7afc62e..754feee9dd9 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs @@ -1415,33 +1415,27 @@ abstract class ExtendsClassValue extends ClassValue {} [Test] - public void BuildBasicApplicationCheckMdb () + public void BuildBasicApplicationCheckPdb () { var proj = new XamarinAndroidApplicationProject (); - using (var b = CreateApkBuilder ("temp/BuildBasicApplicationCheckMdb", false)) { + using (var b = CreateApkBuilder ()) { Assert.IsTrue (b.Build (proj), "Build should have succeeded."); - Assert.IsTrue ( - File.Exists (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "android/assets/UnnamedProject.dll.mdb")) || - File.Exists (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "android/assets/UnnamedProject.pdb")), - "UnnamedProject.dll.mdb must be copied to the Intermediate directory"); + Assert.IsTrue (File.Exists (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "android/assets/UnnamedProject.pdb")), + "UnnamedProject.pdb must be copied to the Intermediate directory"); } } [Test] - public void BuildBasicApplicationCheckMdbRepeatBuild () + public void BuildBasicApplicationCheckPdbRepeatBuild () { var proj = new XamarinAndroidApplicationProject (); using (var b = CreateApkBuilder ()) { Assert.IsTrue (b.Build (proj), "Build should have succeeded."); - Assert.IsTrue ( - File.Exists (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "android/assets/UnnamedProject.dll.mdb")) || - File.Exists (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "android/assets/UnnamedProject.pdb")), - "UnnamedProject.dll.mdb must be copied to the Intermediate directory"); + Assert.IsTrue (File.Exists (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "android/assets/UnnamedProject.pdb")), + "UnnamedProject.pdb must be copied to the Intermediate directory"); Assert.IsTrue (b.Build (proj), "second build failed"); - Assert.IsTrue ( - File.Exists (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "android/assets/UnnamedProject.dll.mdb")) || - File.Exists (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "android/assets/UnnamedProject.pdb")), - "UnnamedProject.dll.mdb must be copied to the Intermediate directory"); + Assert.IsTrue (File.Exists (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "android/assets/UnnamedProject.pdb")), + "UnnamedProject.pdb must be copied to the Intermediate directory"); } } @@ -1525,60 +1519,6 @@ public Class2 () } } - [Test] - [Category ("DotNetIgnore")] // .mdb and non-portable .pdb files not supported in .NET 5+ - public void BuildBasicApplicationCheckMdbAndPortablePdb () - { - var proj = new XamarinAndroidApplicationProject (); - using (var b = CreateApkBuilder ()) { - var reference = new BuildItem.Reference ("PdbTestLibrary.dll") { - WebContentFileNameFromAzure = "PdbTestLibrary.dll" - }; - proj.References.Add (reference); - var pdb = new BuildItem.NoActionResource ("PdbTestLibrary.pdb") { - WebContentFileNameFromAzure = "PdbTestLibrary.pdb" - }; - proj.References.Add (pdb); - var netStandardRef = new BuildItem.Reference ("NetStandard16.dll") { - WebContentFileNameFromAzure = "NetStandard16.dll" - }; - proj.References.Add (netStandardRef); - var netStandardpdb = new BuildItem.NoActionResource ("NetStandard16.pdb") { - WebContentFileNameFromAzure = "NetStandard16.pdb" - }; - proj.References.Add (netStandardpdb); - Assert.IsTrue (b.Build (proj), "Build should have succeeded."); - StringAssertEx.Contains ("XA0125", b.LastBuildOutput, "Output should contain XA0125 warnings"); - var pdbToMdbPath = Path.Combine (Root, b.ProjectDirectory, "PdbTestLibrary.dll.mdb"); - Assert.IsTrue ( - File.Exists (pdbToMdbPath), - "PdbTestLibrary.dll.mdb must be generated next to the .pdb"); - Assert.IsTrue ( - File.Exists (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "android", "assets", "UnnamedProject.dll.mdb")) || - File.Exists (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "android", "assets", "UnnamedProject.pdb")), - "UnnamedProject.dll.mdb/UnnamedProject.pdb must be copied to the Intermediate directory"); - Assert.IsFalse ( - File.Exists (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "android", "assets", "PdbTestLibrary.pdb")), - "PdbTestLibrary.pdb must not be copied to Intermediate directory"); - Assert.IsTrue ( - File.Exists (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "android", "assets", "PdbTestLibrary.dll.mdb")), - "PdbTestLibrary.dll.mdb must be copied to Intermediate directory"); - FileAssert.AreNotEqual (pdbToMdbPath, - Path.Combine (Root, b.ProjectDirectory, "PdbTestLibrary.pdb"), - "The .pdb should NOT match the .mdb"); - Assert.IsTrue ( - File.Exists (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "android", "assets", "NetStandard16.pdb")), - "NetStandard16.pdb must be copied to Intermediate directory"); - Assert.IsTrue (b.Build (proj, doNotCleanupOnUpdate: true), "second build failed"); - var lastTime = File.GetLastWriteTimeUtc (pdbToMdbPath); - pdb.Timestamp = DateTimeOffset.UtcNow; - Assert.IsTrue (b.Build (proj, doNotCleanupOnUpdate: true), "third build failed"); - Assert.Less (lastTime, - File.GetLastWriteTimeUtc (pdbToMdbPath), - "{0} should have been updated", pdbToMdbPath); - } - } - [Test] public void BuildBasicApplicationCheckConfigFiles () { diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/IncrementalBuildTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/IncrementalBuildTest.cs index 06636e8da12..fbe71e843df 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/IncrementalBuildTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/IncrementalBuildTest.cs @@ -442,11 +442,6 @@ public void AppProjectTargetsDoNotBreak () } } }; - if (IsWindows && !Builder.UseDotNet) { - //NOTE: pdb2mdb will run on Windows on the current project's symbols if DebugType=Full - proj.SetProperty (proj.DebugProperties, "DebugType", "Full"); - targets.Add ("_ConvertPdbFiles"); - } using (var b = CreateApkBuilder (Path.Combine ("temp", TestName))) { Assert.IsTrue (b.Build (proj), "first build should succeed"); var firstBuildTime = b.LastBuildTime; diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/ArchiveAssemblyHelper.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/ArchiveAssemblyHelper.cs index 78f0aabd3fa..3966c85180a 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/ArchiveAssemblyHelper.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/ArchiveAssemblyHelper.cs @@ -19,7 +19,6 @@ public class ArchiveAssemblyHelper ".dll", ".config", ".pdb", - ".mdb", }; static readonly Dictionary ArchToAbi = new Dictionary (StringComparer.OrdinalIgnoreCase) { diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj index b677c0ece0e..96efe7fea5b 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj @@ -23,9 +23,6 @@ - - $(MicrosoftAndroidSdkOutDir)pdb2mdb.exe - $(MicrosoftAndroidSdkOutDir)Mono.CompilerServices.SymbolWriter.dll diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets index cd4782e7bba..d29d385d6d0 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets @@ -287,7 +287,6 @@ - @@ -405,15 +404,6 @@ Copyright (C) 2011-2012 Xamarin. All rights reserved. /> - - - - $(AllowedReferenceRelatedFileExtensions); - .dll.mdb; - .exe.mdb - - - diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Legacy.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Legacy.targets index 97e8d06aa43..d80244fcace 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Legacy.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Legacy.targets @@ -219,7 +219,6 @@ projects. .NET 5 projects will not import this file. - @@ -388,17 +387,10 @@ projects. .NET 5 projects will not import this file. - - <_ConvertedMdbFiles Include="@(_ResolvedPdbFiles->'%(RootDir)%(Directory)%(Filename).dll.mdb')" /> - - - <_DeprecatedSymbols Include="@(_ResolvedMdbFiles);@(_ResolvedPdbFiles)" /> @@ -408,26 +400,9 @@ projects. .NET 5 projects will not import this file. FormatArguments="%(_DeprecatedSymbols.FileName)%(_DeprecatedSymbols.Extension)" Condition=" '%(_DeprecatedSymbols.Identity)' != '' " /> - - - - - - - - - - - - + diff --git a/tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs b/tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs index 6ab4c6a8d8b..dafe5d5a031 100755 --- a/tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs +++ b/tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs @@ -280,56 +280,42 @@ public override void OnCreate () /* fastDevType */ "Assemblies", /* allowDeltaInstall */ false, /* user */ null, - /* debugType */ "", - }, - new object[] { - /* embedAssemblies */ true, - /* fastDevType */ "Assemblies", - /* allowDeltaInstall */ false, - /* user */ null, - /* debugType */ "full", }, new object[] { /* embedAssemblies */ false, /* fastDevType */ "Assemblies", /* allowDeltaInstall */ false, /* user */ null, - /* debugType */ "", }, new object[] { /* embedAssemblies */ false, /* fastDevType */ "Assemblies", /* allowDeltaInstall */ true, /* user */ null, - /* debugType */ "", }, new object[] { /* embedAssemblies */ false, /* fastDevType */ "Assemblies:Dexes", /* allowDeltaInstall */ false, /* user */ null, - /* debugType */ "", }, new object[] { /* embedAssemblies */ false, /* fastDevType */ "Assemblies:Dexes", /* allowDeltaInstall */ true, /* user */ null, - /* debugType */ "", }, new object[] { /* embedAssemblies */ true, /* fastDevType */ "Assemblies", /* allowDeltaInstall */ false, /* user */ DeviceTest.GuestUserName, - /* debugType */ "", }, new object[] { /* embedAssemblies */ false, /* fastDevType */ "Assemblies", /* allowDeltaInstall */ false, /* user */ DeviceTest.GuestUserName, - /* debugType */ "", }, }; #pragma warning restore 414 @@ -337,7 +323,7 @@ public override void OnCreate () [Test, Category ("Debugger")] [TestCaseSource (nameof(DebuggerTestCases))] [Retry (5)] - public void ApplicationRunsWithDebuggerAndBreaks (bool embedAssemblies, string fastDevType, bool allowDeltaInstall, string username, string debugType) + public void ApplicationRunsWithDebuggerAndBreaks (bool embedAssemblies, string fastDevType, bool allowDeltaInstall, string username) { AssertCommercialBuild (); SwitchUser (); @@ -384,9 +370,6 @@ public Foo () app.AddReference (lib); app.SetAndroidSupportedAbis ("armeabi-v7a", "x86", "x86_64"); app.SetProperty (KnownProperties._AndroidAllowDeltaInstall, allowDeltaInstall.ToString ()); - if (!string.IsNullOrEmpty (debugType)) { - app.SetProperty ("DebugType", debugType); - } app.SetDefaultTargetDevice (); using (var libBuilder = CreateDllBuilder (Path.Combine (path, lib.ProjectName))) using (var appBuilder = CreateApkBuilder (Path.Combine (path, app.ProjectName))) {