From 83bdddbd4d9da64f2daaaeeb753932d10b13e01b Mon Sep 17 00:00:00 2001 From: Dean Ellis Date: Thu, 20 Jul 2023 14:28:09 +0100 Subject: [PATCH 1/2] Clean up DotNetIgnore Unit Tests (#8163) We have recently begun to remove suport for Xamarin.Android Classic. Many of the Unit Tests labeled with the "DotNetIgnore" Category were flagged as such because they did not work under .Net Android. This commit goes through and removes tests which are not relevant in the .Net Android context. It also modifies some of these tests which are relevant to work under .Net Android. --- .../AndroidUpdateResourcesTest.cs | 23 +- .../BindingBuildTest.cs | 44 --- .../Xamarin.Android.Build.Tests/BuildTest.cs | 242 +------------ .../Xamarin.Android.Build.Tests/BuildTest2.cs | 7 +- .../EnvironmentContentTests.cs | 52 --- .../MSBuildSdkExtrasTests.cs | 93 ----- .../PackagingTest.cs | 324 ------------------ .../Android/KnownPackages.cs | 11 +- .../Tests/DeleteBinObjTest.cs | 98 ------ .../Tests/InstallAndRunTests.cs | 53 --- 10 files changed, 14 insertions(+), 933 deletions(-) delete mode 100644 src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/MSBuildSdkExtrasTests.cs delete mode 100644 tests/MSBuildDeviceIntegration/Tests/DeleteBinObjTest.cs diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidUpdateResourcesTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidUpdateResourcesTest.cs index 43d6b89a580..dd811c1d880 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidUpdateResourcesTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidUpdateResourcesTest.cs @@ -1102,40 +1102,25 @@ public void BuildAppWithManagedResourceParserAndLibraries () } [Test] - [Category ("DotNetIgnore")] // n/a in .NET 5, not possible to use $(TFV) of v8.0 - public void CheckMaxResWarningIsEmittedAsAWarning([Values (false, true)] bool useAapt2) + public void CheckMaxResWarningIsEmittedAsAWarning() { - AssertAaptSupported (useAapt2); var path = Path.Combine ("temp", TestName); var proj = new XamarinAndroidApplicationProject () { - TargetFrameworkVersion = "v8.0", - TargetSdkVersion = "26", - MinSdkVersion = null, - UseLatestPlatformSdk = false, IsRelease = true, OtherBuildItems = { - new BuildItem.Folder ("Resources\\values-v27\\") { + new BuildItem.Folder ("Resources\\values-v33\\") { }, }, }; - proj.AndroidUseAapt2 = useAapt2; - proj.AndroidResources.Add (new AndroidItem.AndroidResource ("Resources\\values-v27\\Strings.xml") { + proj.AndroidResources.Add (new AndroidItem.AndroidResource ("Resources\\values-v33\\Strings.xml") { TextContent = () => @" Test ", }); using (var builder = CreateApkBuilder (path)) { - if (!builder.TargetFrameworkExists (proj.TargetFrameworkVersion)) { - Assert.Ignore ($"Skipping Test. TargetFrameworkVersion {proj.TargetFrameworkVersion} was not available."); - } Assert.IsTrue (builder.Build (proj), "Build should have succeeded."); - if (useAapt2) { - StringAssertEx.DoesNotContain ("APT0000", builder.LastBuildOutput, "Build output should not contain an APT0000 warning"); - } else { - var expected = "warning APT1146: max res 26, skipping values-v27"; - StringAssertEx.Contains (expected, builder.LastBuildOutput, "Build output should contain an APT1146 warning about 'max res 26, skipping values-v27'"); - } + StringAssertEx.DoesNotContain ("APT0000", builder.LastBuildOutput, "Build output should not contain an APT0000 warning"); } } diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BindingBuildTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BindingBuildTest.cs index d258a865619..99142a257c8 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BindingBuildTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BindingBuildTest.cs @@ -442,30 +442,6 @@ public void RemoveEventHandlerResolution () } } - [Test] - [Category ("DotNetIgnore")] - public void JavaDocJar () - { - var binding = new XamarinAndroidBindingProject () { - AndroidClassParser = "class-parse", - }; - binding.SetProperty ("DocumentationFile", "UnnamedProject.xml"); - using (var bindingBuilder = CreateDllBuilder ()) { - binding.Jars.Add (new AndroidItem.EmbeddedJar ("javasourcejartest.jar") { - BinaryContent = () => ResourceData.JavaSourceJarTestJar, - }); - binding.OtherBuildItems.Add (new BuildItem ("JavaDocJar", "javasourcejartest-javadoc.jar") { - BinaryContent = () => ResourceData.JavaSourceJarTestJavadocJar, - }); - Assert.IsTrue (bindingBuilder.Build (binding), "binding build should have succeeded"); - - var cs_file = bindingBuilder.Output.GetIntermediaryPath ( - Path.Combine ("generated", "src", "Com.Xamarin.Android.Test.Msbuildtest.JavaSourceJarTest.cs")); - FileAssert.Exists (cs_file); - StringAssert.Contains ("Greet (string name, global::Java.Util.Date date)", File.ReadAllText (cs_file)); - } - } - [Test] public void JavaSourceJar () { @@ -622,26 +598,6 @@ public void NothingToBind (string classParser) } } - [Test] - [Category ("DotNetIgnore")] //TODO: @(LibraryProjectProperties) not supported yet in .NET 5+ - public void BugzillaBug11964 () - { - var proj = new XamarinAndroidBindingProject (); - - proj.Sources.Add (new BuildItem ("LibraryProjectProperties", "project.properties") { - TextContent = () => "" - }); - - using (var builder = CreateDllBuilder ()) { - builder.ThrowOnBuildFailure = false; - Assert.IsFalse (builder.Build (proj), "Build should have failed."); - string error = builder.LastBuildOutput - .SkipWhile (x => !x.StartsWith ("Build FAILED.", StringComparison.Ordinal)) - .FirstOrDefault (x => x.Contains ("error XA1019:")); - Assert.IsNotNull (error, "Build should have failed with XA1019."); - } - } - [Test] public void BindingWithAndroidJavaSource () { 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 1048b4c1858..57a188a4741 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 @@ -927,43 +927,6 @@ public void BuildAfterUpgradingNuget () } } - [Test] - [Category ("DotNetIgnore")] // Xamarin.Forms version is too old, uses net45 MSBuild tasks - [NonParallelizable] - public void CompileBeforeUpgradingNuGet () - { - var proj = new XamarinAndroidApplicationProject (); - proj.MainActivity = proj.DefaultMainActivity.Replace ("public class MainActivity : Activity", "public class MainActivity : Xamarin.Forms.Platform.Android.FormsAppCompatActivity"); - - proj.PackageReferences.Add (KnownPackages.XamarinForms_2_3_4_231); - proj.PackageReferences.Add (KnownPackages.AndroidSupportV4_27_0_2_1); - proj.PackageReferences.Add (KnownPackages.SupportCompat_27_0_2_1); - proj.PackageReferences.Add (KnownPackages.SupportCoreUI_27_0_2_1); - proj.PackageReferences.Add (KnownPackages.SupportCoreUtils_27_0_2_1); - proj.PackageReferences.Add (KnownPackages.SupportDesign_27_0_2_1); - proj.PackageReferences.Add (KnownPackages.SupportFragment_27_0_2_1); - proj.PackageReferences.Add (KnownPackages.SupportMediaCompat_27_0_2_1); - proj.PackageReferences.Add (KnownPackages.SupportV7AppCompat_27_0_2_1); - proj.PackageReferences.Add (KnownPackages.SupportV7CardView_27_0_2_1); - proj.PackageReferences.Add (KnownPackages.SupportV7MediaRouter_27_0_2_1); - - using (var b = CreateApkBuilder (Path.Combine ("temp", TestName))) { - b.ThrowOnBuildFailure = false; - var projectDir = Path.Combine (Root, b.ProjectDirectory); - if (Directory.Exists (projectDir)) - Directory.Delete (projectDir, true); - Assert.IsTrue (b.DesignTimeBuild (proj), "design-time build should have succeeded."); - - proj.PackageReferences.Clear (); - //NOTE: we can get all the other dependencies transitively, yay! - proj.PackageReferences.Add (KnownPackages.XamarinForms_4_4_0_991265); - Assert.IsTrue (b.Restore (proj, doNotCleanupOnUpdate: true), "Restore should have worked."); - Assert.IsTrue (b.Build (proj, saveProject: true, doNotCleanupOnUpdate: true), "second build should have succeeded."); - Assert.IsTrue (StringAssertEx.ContainsText (b.LastBuildOutput, "Refreshing Xamarin.Android.Support.v7.AppCompat.dll"), "`ResolveLibraryProjectImports` should not skip `Xamarin.Android.Support.v7.AppCompat.dll`!"); - Assert.IsTrue (StringAssertEx.ContainsText (b.LastBuildOutput, "Deleting unknown jar: support-annotations.jar"), "`support-annotations.jar` should be deleted!"); - } - } - [Test] public void BuildInDesignTimeMode ([Values(false, true)] bool useManagedParser) { @@ -993,71 +956,6 @@ public void BuildInDesignTimeMode ([Values(false, true)] bool useManagedParser) } [Test] - [Category ("DotNetIgnore")] // n/a in .NET 5+, test validates __AndroidLibraryProjects__.zip generation - public void CheckLibraryImportsUpgrade () - { - var path = Path.Combine ("temp", TestContext.CurrentContext.Test.Name); - var libproj = new XamarinAndroidLibraryProject () { - IsRelease = true, - ProjectName = "Library1" - }; - var proj = new XamarinAndroidApplicationProject () { - IsRelease = true, - ProjectName = "App1", - }; - proj.References.Add (new BuildItem ("ProjectReference", $"..\\Library1\\Library1.csproj")); - proj.SetProperty ("_AndroidLibrayProjectIntermediatePath", Path.Combine (proj.IntermediateOutputPath, "__library_projects__")); - using (var libb = CreateDllBuilder (Path.Combine (path, libproj.ProjectName), false, false)) { - Assert.IsTrue (libb.Build (libproj), "Build should have succeeded."); - using (var builder = CreateApkBuilder (Path.Combine (path, proj.ProjectName), false, false)) { - Assert.IsTrue (builder.Build (proj), "Build should have succeeded."); - Assert.IsTrue (Directory.Exists (Path.Combine (Root, path, proj.ProjectName, proj.IntermediateOutputPath, "__library_projects__")), - "The __library_projects__ directory should exist."); - proj.RemoveProperty ("_AndroidLibrayProjectIntermediatePath"); - Assert.IsTrue (builder.Build (proj), "Build should have succeeded."); - Assert.IsFalse (Directory.Exists (Path.Combine (Root, path, proj.ProjectName, proj.IntermediateOutputPath, "__library_projects__")), - "The __library_projects__ directory should not exist, due to IncrementalClean."); - Assert.IsTrue (libb.Clean (libproj), "Clean should have succeeded."); - Assert.IsTrue (libb.Build (libproj), "Build should have succeeded."); - Assert.IsTrue (builder.Build (proj), "Build should have succeeded."); - var zipFile = libb.Output.GetIntermediaryPath ("__AndroidLibraryProjects__.zip"); - Assert.IsTrue (File.Exists (zipFile)); - using (var zip = ZipHelper.OpenZip (zipFile)) { - Assert.IsTrue (zip.ContainsEntry ("library_project_imports/__res_name_case_map.txt"), $"{zipFile} should contain a library_project_imports/__res_name_case_map.txt entry"); - } - Assert.IsFalse (Directory.Exists (Path.Combine (Root, path, proj.ProjectName, proj.IntermediateOutputPath, "__library_projects__")), - "The __library_projects__ directory should not exist."); - Assert.IsTrue (Directory.Exists (Path.Combine (Root, path, proj.ProjectName, proj.IntermediateOutputPath, "lp")), - "The lp directory should exist."); - - } - } - } - - [Test] - [Category ("DotNetIgnore")] // n/a in .NET 5+, because it uses 'netcoreapp1.0\pclcrypto.dll' - public void ResolveLibraryImportsWithInvalidZip () - { - var proj = new XamarinAndroidApplicationProject { - PackageReferences = { - KnownPackages.PCLCrypto_Alpha, - }, - }; - using (var b = CreateApkBuilder ()) { - b.Target = "Build"; - b.ThrowOnBuildFailure = false; - if (b.Build (proj)) { - //NOTE: `:` in a file path should fail on Windows, but passes on macOS - if (IsWindows) - Assert.Fail ("Build should have failed."); - } else { - Assert.IsTrue (StringAssertEx.ContainsText (b.LastBuildOutput, "error XA4303: Error extracting resources from"), "Should receive XA4303 error."); - } - } - } - - [Test] - [Category ("DotNetIgnore")] // n/a in .NET 5+, test validates __AndroidLibraryProjects__.zip generation public void AndroidLibraryProjectsZipWithOddPaths () { var proj = new XamarinAndroidLibraryProject (); @@ -1075,10 +973,10 @@ public void AndroidLibraryProjectsZipWithOddPaths () using (var b = CreateDllBuilder ()) { Assert.IsTrue (b.Build (proj), "Build should have succeeded."); - var zipFile = Path.Combine (Root, b.ProjectDirectory, b.Output.IntermediateOutputPath, "foo", "__AndroidLibraryProjects__.zip"); + var zipFile = Path.Combine (Root, b.ProjectDirectory, b.Output.OutputPath, $"{proj.ProjectName}.aar"); FileAssert.Exists (zipFile); using (var zip = ZipHelper.OpenZip (zipFile)) { - Assert.IsTrue (zip.ContainsEntry ("library_project_imports/res/values/foo.xml"), $"{zipFile} should contain a library_project_imports/res/values/foo.xml entry"); + Assert.IsTrue (zip.ContainsEntry ("res/values/foo.xml"), $"{zipFile} should contain a res/values/foo.xml entry"); } } } @@ -1097,14 +995,14 @@ public void AndroidLibraryProjectsZipWithOddPaths () /*buildToolsVersion*/ "24.0.1", /*JavaVersion*/ "1.7.0_101", /*latestSupportedJavaVersion*/ "1.8.0", - /*expectedResult*/ false, + /*expectedResult*/ true, }, new object [] { /*targetFrameworkVersion*/ "v7.1", /*buildToolsVersion*/ "24.0.1", /*JavaVersion*/ "1.6.0_101", /*latestSupportedJavaVersion*/ "1.8.0", - /*expectedResult*/ false, + /*expectedResult*/ true, }, new object [] { /*targetFrameworkVersion*/ "v6.0", @@ -1125,7 +1023,7 @@ public void AndroidLibraryProjectsZipWithOddPaths () /*buildToolsVersion*/ "24.0.0", /*JavaVersion*/ "1.6.0_101", /*latestSupportedJavaVersion*/ "1.8.0", - /*expectedResult*/ false, + /*expectedResult*/ true, }, new object [] { /*targetFrameworkVersion*/ "v5.0", @@ -1153,7 +1051,7 @@ public void AndroidLibraryProjectsZipWithOddPaths () /*buildToolsVersion*/ "24.0.1", /*JavaVersion*/ "1.6.0_101", /*latestSupportedJavaVersion*/ "1.8.0", - /*expectedResult*/ false, + /*expectedResult*/ true, }, new object [] { /*targetFrameworkVersion*/ "v7.1", @@ -1167,14 +1065,13 @@ public void AndroidLibraryProjectsZipWithOddPaths () /*buildToolsVersion*/ "24.0.1", /*JavaVersion*/ "9.0.4", /*latestSupportedJavaVersion*/ "1.8.0", - /*expectedResult*/ false, + /*expectedResult*/ true, }, }; #pragma warning restore 414 [Test] [TestCaseSource (nameof (validateJavaVersionTestCases))] - [Category ("DotNetIgnore")] // n/a under .NET 5+ public void ValidateJavaVersion (string targetFrameworkVersion, string buildToolsVersion, string javaVersion, string latestSupportedJavaVersion, bool expectedResult) { var path = Path.Combine ("temp", $"ValidateJavaVersion_{targetFrameworkVersion}_{buildToolsVersion}_{latestSupportedJavaVersion}_{javaVersion}"); @@ -1188,10 +1085,8 @@ public void ValidateJavaVersion (string targetFrameworkVersion, string buildTool UseLatestPlatformSdk = false, }; using (var builder = CreateApkBuilder (Path.Combine (path, proj.ProjectName), false, false)) { - if (!Directory.Exists (Path.Combine (TestEnvironment.MonoAndroidFrameworkDirectory, targetFrameworkVersion))) - Assert.Ignore ("This is a Pull Request Build. Ignoring test."); builder.ThrowOnBuildFailure = false; - builder.Target = "_SetLatestTargetFrameworkVersion"; + builder.Target = "_ResolveSdks"; Assert.AreEqual (expectedResult, builder.Build (proj, parameters: new string[] { $"JavaSdkDirectory={javaPath}", $"JavaToolExe={javaExe}", @@ -1232,77 +1127,6 @@ public void IfAndroidJarDoesNotExistThrowXA5207 () Directory.Delete (AndroidSdkDirectory, recursive: true); } - [Test] - [Category ("DotNetIgnore")] // n/a under .NET 5+ - public void ValidateUseLatestAndroid () - { - var apis = new ApiInfo [] { - new ApiInfo () { Id = "23", Level = 23, Name = "Marshmallow", FrameworkVersion = "v6.0", Stable = true }, - new ApiInfo () { Id = "26", Level = 26, Name = "Oreo", FrameworkVersion = "v8.0", Stable = true }, - new ApiInfo () { Id = "27", Level = 27, Name = "Oreo", FrameworkVersion = "v8.1", Stable = true }, - new ApiInfo () { Id = "P", Level = 28, Name = "P", FrameworkVersion="v8.99", Stable = false }, - }; - var path = Path.Combine ("temp", TestName); - var androidSdkPath = CreateFauxAndroidSdkDirectory (Path.Combine (path, "android-sdk"), - "23.0.6", apis); - var referencesPath = CreateFauxReferencesDirectory (Path.Combine (path, "xbuild-frameworks"), apis); - var proj = new XamarinAndroidApplicationProject () { - IsRelease = true, - TargetFrameworkVersion = "v8.0", - UseLatestPlatformSdk = false, - }; - var parameters = new string [] { - $"TargetFrameworkRootPath={referencesPath}", - $"AndroidSdkDirectory={androidSdkPath}", - }; - var envVar = new Dictionary { - { "XBUILD_FRAMEWORK_FOLDERS_PATH", referencesPath }, - }; - using (var builder = CreateApkBuilder (Path.Combine (path, proj.ProjectName), false, false)) { - builder.ThrowOnBuildFailure = false; - builder.Target = "_SetLatestTargetFrameworkVersion"; - Assert.True (builder.Build (proj, parameters: parameters, environmentVariables: envVar), - string.Format ("First Build should have succeeded")); - - //NOTE: these are generally of this form, from diagnostic log output: - // Task Parameter:TargetFrameworkVersion=v8.0 - // ... - // Output Property: TargetFrameworkVersion=v8.0 - // ValidateJavaVersion and ResolveAndroidTooling take input, ResolveAndroidTooling has final output - - Assert.IsTrue (builder.LastBuildOutput.ContainsOccurances ("Task Parameter:TargetFrameworkVersion=v8.0", 2), "TargetFrameworkVersion should initially be v8.0"); - Assert.IsTrue (builder.LastBuildOutput.ContainsOccurances ("Output Property: TargetFrameworkVersion=v8.0", 1), "TargetFrameworkVersion should be v8.0"); - - proj.TargetFrameworkVersion = "v8.0"; - Assert.True (builder.Build (proj, parameters: parameters, environmentVariables: envVar), - string.Format ("Second Build should have succeeded")); - Assert.IsTrue (builder.LastBuildOutput.ContainsOccurances ("Task Parameter:TargetFrameworkVersion=v8.0", 2), "TargetFrameworkVersion should initially be v8.0"); - Assert.IsTrue (builder.LastBuildOutput.ContainsOccurances ("Output Property: TargetFrameworkVersion=v8.0", 1), "TargetFrameworkVersion should be v8.0"); - - proj.UseLatestPlatformSdk = true; - proj.TargetFrameworkVersion = "v8.1"; - Assert.True (builder.Build (proj, parameters: parameters, environmentVariables: envVar), - string.Format ("Third Build should have succeeded")); - Assert.IsTrue (builder.LastBuildOutput.ContainsOccurances ("Task Parameter:TargetFrameworkVersion=v8.1", 2), "TargetFrameworkVersion should initially be v8.1"); - Assert.IsTrue (builder.LastBuildOutput.ContainsOccurances ("Output Property: TargetFrameworkVersion=v8.1", 1), "TargetFrameworkVersion should be v8.1"); - - proj.UseLatestPlatformSdk = true; - proj.TargetFrameworkVersion = "v8.99"; - Assert.True (builder.Build (proj, parameters: parameters, environmentVariables: envVar), - string.Format ("Third Build should have succeeded")); - Assert.IsTrue (builder.LastBuildOutput.ContainsOccurances ("Task Parameter:TargetFrameworkVersion=v8.99", 2), "TargetFrameworkVersion should initially be v8.99"); - Assert.IsTrue (builder.LastBuildOutput.ContainsOccurances ("Output Property: TargetFrameworkVersion=v8.99", 1), "TargetFrameworkVersion should be v8.99"); - - proj.UseLatestPlatformSdk = true; - proj.TargetFrameworkVersion = "v6.0"; - Assert.True (builder.Build (proj, parameters: parameters, environmentVariables: envVar), - string.Format ("Forth Build should have succeeded")); - Assert.IsTrue (builder.LastBuildOutput.ContainsOccurances ("Task Parameter:TargetFrameworkVersion=v6.0", 2), "TargetFrameworkVersion should initially be v6.0"); - Assert.IsTrue (builder.LastBuildOutput.ContainsOccurances ("Output Property: TargetFrameworkVersion=v8.1", 1), "TargetFrameworkVersion should be v8.1"); - } - Directory.Delete (referencesPath, recursive: true); - } - [Test] public void XA4212 () { @@ -1333,27 +1157,6 @@ public void Dispose () } } - [Test] - [Category ("DotNetIgnore")] // n/a for .NET 5+ - public void RunXABuildInParallel () - { - var xabuild = new ProjectBuilder ("temp/RunXABuildInParallel").BuildTool; - var psi = new ProcessStartInfo (xabuild, "/version") { - CreateNoWindow = true, - RedirectStandardOutput = true, - RedirectStandardError = true, - WindowStyle = ProcessWindowStyle.Hidden, - UseShellExecute = false, - }; - - Parallel.For (0, 10, i => { - using (var p = Process.Start (psi)) { - p.WaitForExit (); - Assert.AreEqual (0, p.ExitCode); - } - }); - } - [Test] public void Desugar ([Values (true, false)] bool isRelease, [Values ("", "r8")] string linkTool) { @@ -1477,7 +1280,6 @@ public void MissingOrgApacheHttpClient () //NOTE: tests type forwarders in Mono.Android.dll to System.Drawing.Common.dll [Test] - [Category ("DotNetIgnore")] // Fails with: error CS0433: The type 'Color' exists in both 'Splat' and 'System.Drawing.Primitives' public void SystemDrawingCommon () { var proj = new XamarinAndroidApplicationProject { @@ -1489,7 +1291,6 @@ public void SystemDrawingCommon () }, PackageReferences = { KnownPackages.Acr_UserDialogs, - KnownPackages.Xamarin_Build_Download_0_4_11, } }; using (var b = CreateApkBuilder (Path.Combine ("temp", TestName))) { @@ -1526,22 +1327,6 @@ public void MicrosoftExtensionsHttp () } } - [Test] - [Category ("DotNetIgnore")] // n/a on .NET 5+, does not use $(AndroidSupportedAbis) - [TestCase ("armeabi;armeabi-v7a", TestName = "XA0115")] - [TestCase ("armeabi,armeabi-v7a", TestName = "XA0115Commas")] - public void XA0115 (string abis) - { - var proj = new XamarinAndroidApplicationProject (); - proj.SetProperty (KnownProperties.AndroidSupportedAbis, abis); - using (var builder = CreateApkBuilder ()) { - builder.ThrowOnBuildFailure = false; - Assert.IsFalse (builder.Build (proj), "Build should have failed with XA0115."); - StringAssertEx.Contains ($"error XA0115", builder.LastBuildOutput, "Error should be XA0115"); - Assert.IsTrue (builder.Clean (proj), "Clean should have succeeded."); - } - } - [Test] public void XA0119 () { @@ -1918,17 +1703,6 @@ public void AllResourcesInClassLibrary ([Values (true, false)] bool useAapt2, [V } } - [Test] - [Category ("DotNetIgnore")] // n/a on .NET 5+, does not use $(AndroidSupportedAbis) - public void AbiDelimiters ([Values ("armeabi-v7a%3bx86", "armeabi-v7a,x86")] string abis) - { - var proj = new XamarinAndroidApplicationProject (); - proj.SetProperty (KnownProperties.AndroidSupportedAbis, abis); - using (var b = CreateApkBuilder (Path.Combine ("temp", $"{nameof (AbiDelimiters)}_{abis.GetHashCode ()}"))) { - Assert.IsTrue (b.Build (proj), "Build should have succeeded."); - } - } - [Test] public void WorkManager () { 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 219fa75914f..539ee7c8242 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 @@ -816,12 +816,10 @@ public void AndroidResourceNotExist () } [Test] - [Category ("DotNetIgnore")] // n/a for .NET 5+ public void TargetFrameworkMonikerAssemblyAttributesPath () { - const string filePattern = "MonoAndroid,Version=v*.AssemblyAttributes.cs"; + const string filePattern = ".NETCoreApp,Version=*.AssemblyAttributes.cs"; var proj = new XamarinAndroidApplicationProject { - TargetFrameworkVersion = "v6.0", }; proj.SetProperty ("AndroidUseLatestPlatformSdk", "True"); @@ -829,12 +827,9 @@ public void TargetFrameworkMonikerAssemblyAttributesPath () Assert.IsTrue (b.Build (proj), "build should have succeeded."); var intermediate = Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath); - var old_assemblyattributespath = Path.Combine (intermediate, $"MonoAndroid,Version={proj.TargetFrameworkVersion}.AssemblyAttributes.cs"); - FileAssert.DoesNotExist (old_assemblyattributespath, "TargetFrameworkMonikerAssemblyAttributesPath should have the newer TargetFrameworkVersion."); var new_assemblyattributespath = Directory.EnumerateFiles (intermediate, filePattern).SingleOrDefault (); Assert.IsNotNull (new_assemblyattributespath, $"A *single* file of pattern {filePattern} should exist in `$(IntermediateOutputPath)`."); - StringAssert.DoesNotContain (proj.TargetFrameworkVersion, File.ReadAllText (new_assemblyattributespath), $"`{new_assemblyattributespath}` should not contain `{proj.TargetFrameworkVersion}`!"); } } diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/EnvironmentContentTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/EnvironmentContentTests.cs index 24b03b51b49..99608f4f796 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/EnvironmentContentTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/EnvironmentContentTests.cs @@ -242,57 +242,5 @@ public void CheckHttpClientHandlerType () Assert.AreEqual (expectedUpdatedValue, envvars[httpClientHandlerVarName]); } } - - static object [] TlsProviderTestCases = - { - // androidTlsProvider, isRelease, extpected - new object[] { "", true, true, }, - new object[] { "default", true, true, }, - new object[] { "legacy", true, true, }, - new object[] { "btls", true, true, } - }; - - [Test] - [Category ("DotNetIgnore")] // .NET 5+ does not use these native libraries - [TestCaseSource (nameof (TlsProviderTestCases))] - public void BuildWithTlsProvider (string androidTlsProvider, bool isRelease, bool expected) - { - var proj = new XamarinAndroidApplicationProject () { - IsRelease = isRelease, - }; - var supportedAbis = new string [] { "armeabi-v7a", "arm64-v8a" }; - proj.SetAndroidSupportedAbis (supportedAbis); - - using (var b = CreateApkBuilder (Path.Combine ("temp", $"BuildWithTlsProvider_{androidTlsProvider}_{isRelease}_{expected}"))) { - proj.SetProperty ("AndroidTlsProvider", androidTlsProvider); - Assert.IsTrue (b.Build (proj), "Build should have succeeded."); - var intermediateOutputDir = Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath); - var outpath = Path.Combine (Root, b.ProjectDirectory, proj.OutputPath); - var apk = Path.Combine (outpath, $"{proj.PackageName}-Signed.apk"); - using (var zipFile = ZipHelper.OpenZip (apk)) { - foreach (var abi in supportedAbis) { - if (expected) { - Assert.IsNotNull (ZipHelper.ReadFileFromZip (zipFile, - $"lib/{abi}/libmono-btls-shared.so"), - $"lib/{abi}/libmono-btls-shared.so should exist in the apk."); - } - else { - Assert.IsNull (ZipHelper.ReadFileFromZip (zipFile, - $"lib/{abi}/libmono-btls-shared.so"), - $"lib/{abi}/libmono-btls-shared.so should not exist in the apk."); - } - } - } - List envFiles = EnvironmentHelper.GatherEnvironmentFiles (intermediateOutputDir, string.Join (";", supportedAbis), true); - Dictionary envvars = EnvironmentHelper.ReadEnvironmentVariables (envFiles); - Assert.IsTrue (envvars.ContainsKey ("XA_TLS_PROVIDER"), "Environment should contain XA_TLS_PROVIDER."); - if (androidTlsProvider == string.Empty) { - Assert.AreEqual ("btls", envvars["XA_TLS_PROVIDER"], "'XA_TLS_PROVIDER' should have been 'btls' when provider is not set."); - } else { - Assert.AreEqual (androidTlsProvider, envvars["XA_TLS_PROVIDER"], $"'XA_TLS_PROVIDER' should have been '{androidTlsProvider}'."); - } - } - } - } } diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/MSBuildSdkExtrasTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/MSBuildSdkExtrasTests.cs deleted file mode 100644 index 09346a9f2a9..00000000000 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/MSBuildSdkExtrasTests.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System.IO; -using System.Linq; -using Mono.Cecil; -using NUnit.Framework; -using Xamarin.ProjectTools; - -namespace Xamarin.Android.Build.Tests -{ - [TestFixture] - [NonParallelizable] // On MacOS, parallel /restore causes issues - [Category ("DotNetIgnore")] // Uses MSBuild.Sdk.Extras - public class MSBuildSdkExtrasTests : BaseTest - { - [Test] - public void ClassLibrary () - { - var proj = new MSBuildSdkExtrasProject (); - using (var b = CreateDllBuilder (Path.Combine ("temp", TestName))) { - Assert.IsTrue (b.Build (proj), "Build should have succeeded."); - var output = Path.Combine (Root, b.ProjectDirectory, proj.OutputPath, proj.ProjectName + ".dll"); - FileAssert.Exists (output); - AssertContainsClass (output, "Class1", contains: true); - } - } - - [Test] - public void ClassLibraryNoResources () - { - var proj = new MSBuildSdkExtrasProject (); - proj.Sources.Remove (proj.Sources.First (s => s.BuildAction == "AndroidResource")); - using (var b = CreateDllBuilder (Path.Combine ("temp", TestName))) { - Assert.IsTrue (b.Build (proj), "Build should have succeeded."); - var output = Path.Combine (Root, b.ProjectDirectory, proj.OutputPath, proj.ProjectName + ".dll"); - FileAssert.Exists (output); - AssertContainsClass (output, "Class1", contains: true); - } - } - - [Test] - public void BindingProject () - { - var proj = new MSBuildSdkExtrasProject { - IsBindingProject = true, - }; - proj.OtherBuildItems.Add (new AndroidItem.EmbeddedJar ("Jars\\svg-android.jar") { - WebContent = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/svg-android/svg-android.jar" - }); - using (var b = CreateDllBuilder (Path.Combine ("temp", TestName))) { - Assert.IsTrue (b.Build (proj), "Build should have succeeded."); - var output = Path.Combine (Root, b.ProjectDirectory, proj.OutputPath, proj.ProjectName + ".dll"); - FileAssert.Exists (output); - AssertContainsClass (output, "Com.Larvalabs.Svgandroid.SVG", contains: true); - } - } - - [Test] - public void MultiTargeting () - { - var proj = new MSBuildSdkExtrasProject (); - proj.TargetFrameworks += ";netstandard2.0"; - proj.Sources.Add (new BuildItem.Source ("MyView.cs") { - TextContent = () => -@"#if __ANDROID__ -class MyView : Android.Views.View -{ - public MyView (Android.Content.Context c) : base (c) { } -} -#endif", - }); - using (var b = CreateDllBuilder (Path.Combine ("temp", TestName))) { - Assert.IsTrue (b.Build (proj), "Build should have succeeded."); - var output = Path.Combine (Root, b.ProjectDirectory, proj.OutputPath, proj.ProjectName + ".dll"); - FileAssert.Exists (output); - AssertContainsClass (output, "MyView", contains: true); - output = Path.Combine (Root, b.ProjectDirectory, proj.OutputPath, "..", "netstandard2.0", proj.ProjectName + ".dll"); - FileAssert.Exists (output); - AssertContainsClass (output, "MyView", contains: false); - } - } - - void AssertContainsClass (string assemblyFile, string className, bool contains) - { - using (var assembly = AssemblyDefinition.ReadAssembly(assemblyFile)) { - bool result = assembly.MainModule.Types.Select (t => t.FullName).Contains (className); - if (contains) { - Assert.IsTrue (result, $"{assemblyFile} should contain {className}!"); - } else { - Assert.IsFalse (result, $"{assemblyFile} should *not* contain {className}!"); - } - } - } - } -} diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/PackagingTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/PackagingTest.cs index cd353e5001d..2d2be7136da 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/PackagingTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/PackagingTest.cs @@ -468,45 +468,6 @@ int GetVersionCodeFromIntermediateManifest (string manifestFilePath) } } - [Test] - [Category ("DotNetIgnore")] // Xamarin.Forms version is too old, uses net45 MSBuild tasks - [NonParallelizable] // Commonly fails NuGet restore - public void CheckAapt2WarningsDoNotGenerateErrors () - { - //https://github.com/xamarin/xamarin-android/issues/3083 - var proj = new XamarinAndroidApplicationProject () { - IsRelease = true, - TargetFrameworkVersion = Xamarin.ProjectTools.Versions.Oreo_27, - UseLatestPlatformSdk = false, - }; - proj.PackageReferences.Add (KnownPackages.XamarinForms_2_3_4_231); - proj.PackageReferences.Add (KnownPackages.AndroidSupportV4_27_0_2_1); - proj.PackageReferences.Add (KnownPackages.SupportCompat_27_0_2_1); - proj.PackageReferences.Add (KnownPackages.SupportCoreUI_27_0_2_1); - proj.PackageReferences.Add (KnownPackages.SupportCoreUtils_27_0_2_1); - proj.PackageReferences.Add (KnownPackages.SupportDesign_27_0_2_1); - proj.PackageReferences.Add (KnownPackages.SupportFragment_27_0_2_1); - proj.PackageReferences.Add (KnownPackages.SupportMediaCompat_27_0_2_1); - proj.PackageReferences.Add (KnownPackages.SupportV7AppCompat_27_0_2_1); - proj.PackageReferences.Add (KnownPackages.SupportV7CardView_27_0_2_1); - proj.PackageReferences.Add (KnownPackages.SupportV7MediaRouter_27_0_2_1); - proj.SetProperty (proj.ReleaseProperties, KnownProperties.AndroidCreatePackagePerAbi, true); - proj.SetAndroidSupportedAbis ("armeabi-v7a", "x86"); - using (var b = CreateApkBuilder (Path.Combine ("temp", TestName))) { - if (!b.TargetFrameworkExists (proj.TargetFrameworkVersion)) - Assert.Ignore ($"Skipped as {proj.TargetFrameworkVersion} not available."); - Assert.IsTrue (b.Build (proj), "first build should have succeeded."); - string intermediateDir = TestEnvironment.IsWindows - ? Path.Combine (proj.IntermediateOutputPath, proj.TargetFrameworkAbbreviated) : proj.IntermediateOutputPath; - var packagedResource = Path.Combine (b.Root, b.ProjectDirectory, intermediateDir, "android", "bin", "packaged_resources"); - FileAssert.Exists (packagedResource, $"{packagedResource} should have been created."); - var packagedResourcearm = packagedResource + "-armeabi-v7a"; - FileAssert.Exists (packagedResourcearm, $"{packagedResourcearm} should have been created."); - var packagedResourcex86 = packagedResource + "-x86"; - FileAssert.Exists (packagedResourcex86, $"{packagedResourcex86} should have been created."); - } - } - [Test] public void CheckAppBundle ([Values (true, false)] bool isRelease) { @@ -535,291 +496,6 @@ public void CheckAppBundle ([Values (true, false)] bool isRelease) } } - [Test] - [Category ("DotNetIgnore")] // Xamarin.Forms version is too old, uses net45 MSBuild tasks - public void NetStandardReferenceTest () - { - var netStandardProject = new DotNetStandard () { - ProjectName = "XamFormsSample", - ProjectGuid = Guid.NewGuid ().ToString (), - Sdk = "Microsoft.NET.Sdk", - TargetFramework = "netstandard1.4", - IsRelease = true, - PackageTargetFallback = "portable-net45+win8+wpa81+wp8", - PackageReferences = { - KnownPackages.XamarinForms_2_3_4_231, - new Package () { - Id = "System.IO.Packaging", - Version = "4.4.0", - }, - new Package () { - Id = "Newtonsoft.Json", - Version = "13.0.1" - }, - }, - OtherBuildItems = { - new BuildItem ("None") { - Remove = () => "**\\*.xaml", - }, - new BuildItem ("Compile") { - Update = () => "**\\*.xaml.cs", - DependentUpon = () => "%(Filename)" - }, - new BuildItem ("EmbeddedResource") { - Include = () => "**\\*.xaml", - SubType = () => "Designer", - Generator = () => "MSBuild:UpdateDesignTimeXaml", - }, - }, - Sources = { - new BuildItem.Source ("App.xaml.cs") { - TextContent = () => @"using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Newtonsoft.Json; -using System.IO.Packaging; - -using Xamarin.Forms; - -namespace XamFormsSample -{ - public partial class App : Application - { - Package package; - - public App() - { - try { - JsonConvert.DeserializeObject(""test""); - package = Package.Open (""""); - } catch { - } - InitializeComponent(); - - MainPage = new ContentPage (); - } - - protected override void OnStart() - { - // Handle when your app starts - } - - protected override void OnSleep() - { - // Handle when your app sleeps - } - - protected override void OnResume() - { - // Handle when your app resumes - } - } -}", - }, - new BuildItem.Source ("App.xaml") { - TextContent = () => @" - - - - -", - }, - }, - }; - - var app = new XamarinAndroidApplicationProject () { - ProjectName = "App1", - IsRelease = true, - UseLatestPlatformSdk = true, - References = { - new BuildItem.Reference ("Mono.Android.Export"), - new BuildItem.ProjectReference ($"..\\{netStandardProject.ProjectName}\\{netStandardProject.ProjectName}.csproj", - netStandardProject.ProjectName, netStandardProject.ProjectGuid), - }, - PackageReferences = { - KnownPackages.SupportDesign_27_0_2_1, - KnownPackages.SupportV7CardView_27_0_2_1, - KnownPackages.AndroidSupportV4_27_0_2_1, - KnownPackages.SupportCoreUtils_27_0_2_1, - KnownPackages.SupportMediaCompat_27_0_2_1, - KnownPackages.SupportFragment_27_0_2_1, - KnownPackages.SupportCoreUI_27_0_2_1, - KnownPackages.SupportCompat_27_0_2_1, - KnownPackages.SupportV7AppCompat_27_0_2_1, - KnownPackages.SupportV7MediaRouter_27_0_2_1, - KnownPackages.XamarinForms_2_3_4_231, - new Package () { - Id = "System.Runtime.Loader", - Version = "4.3.0", - }, - } - }; - app.SetProperty ("AndroidUseAssemblyStore", "False"); - app.MainActivity = @"using System; -using Android.App; -using Android.Content; -using Android.Runtime; -using Android.Views; -using Android.Widget; -using Android.OS; -using XamFormsSample; - -namespace App1 -{ - [Activity (Label = ""App1"", MainLauncher = true, Icon = ""@drawable/icon"")] - public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity { - protected override void OnCreate (Bundle bundle) - { - base.OnCreate (bundle); - - global::Xamarin.Forms.Forms.Init (this, bundle); - - LoadApplication (new App ()); - } - } - }"; - app.SetAndroidSupportedAbis ("x86", "armeabi-v7a"); - var expectedFiles = new string [] { - "Java.Interop.dll", - "Mono.Android.dll", - "mscorlib.dll", - "System.Core.dll", - "System.Data.dll", - "System.dll", - "System.Runtime.Serialization.dll", - "System.IO.Packaging.dll", - "System.IO.Compression.dll", - "Mono.Android.Export.dll", - "App1.dll", - "FormsViewGroup.dll", - "Xamarin.Android.Arch.Lifecycle.Common.dll", - "Xamarin.Android.Support.Compat.dll", - "Xamarin.Android.Support.Core.UI.dll", - "Xamarin.Android.Support.Core.Utils.dll", - "Xamarin.Android.Support.Design.dll", - "Xamarin.Android.Support.Fragment.dll", - "Xamarin.Android.Support.v7.AppCompat.dll", - "Xamarin.Android.Support.v7.CardView.dll", - "Xamarin.Forms.Core.dll", - "Xamarin.Forms.Platform.Android.dll", - "Xamarin.Forms.Platform.dll", - "Xamarin.Forms.Xaml.dll", - "XamFormsSample.dll", - "Mono.Security.dll", - "System.Xml.dll", - "System.Net.Http.dll", - "System.ServiceModel.Internals.dll", - "Newtonsoft.Json.dll", - "System.Numerics.dll", - "System.Xml.Linq.dll", - }; - var path = Path.Combine ("temp", TestContext.CurrentContext.Test.Name); - using (var builder = CreateDllBuilder (Path.Combine (path, netStandardProject.ProjectName), cleanupOnDispose: false)) { - using (var ab = CreateApkBuilder (Path.Combine (path, app.ProjectName), cleanupOnDispose: false)) { - Assert.IsTrue (builder.Build (netStandardProject), "XamFormsSample should have built."); - Assert.IsTrue (ab.Build (app), "App should have built."); - var apk = Path.Combine (Root, ab.ProjectDirectory, - app.OutputPath, $"{app.PackageName}-Signed.apk"); - using (var zip = ZipHelper.OpenZip (apk)) { - var existingFiles = zip.Where (a => a.FullName.StartsWith ("assemblies/", StringComparison.InvariantCultureIgnoreCase)); - var missingFiles = expectedFiles.Where (x => !zip.ContainsEntry ("assemblies/" + Path.GetFileName (x))); - Assert.IsFalse (missingFiles.Any (), - string.Format ("The following Expected files are missing. {0}", - string.Join (Environment.NewLine, missingFiles))); - var additionalFiles = existingFiles.Where (x => !expectedFiles.Contains (Path.GetFileName (x.FullName))); - Assert.IsTrue (!additionalFiles.Any (), - string.Format ("Unexpected Files found! {0}", - string.Join (Environment.NewLine, additionalFiles.Select (x => x.FullName)))); - } - } - } - } - - [Test] - [Category ("DotNetIgnore")] // Uses MSBuild.Sdk.Extras - public void CheckTheCorrectRuntimeAssemblyIsUsedFromNuget () - { - string monoandroidFramework = "monoandroid10.0"; - string path = Path.Combine (Root, "temp", TestName); - var ns = new DotNetStandard () { - ProjectName = "Dummy", - Sdk = "MSBuild.Sdk.Extras/2.0.54", - Sources = { - new BuildItem.Source ("Class1.cs") { - TextContent = () => @"public class Class1 { -#if __ANDROID__ - public static string Library => ""Android""; -#else - public static string Library => "".NET Standard""; -#endif -}", - }, - }, - OtherBuildItems = { - new BuildItem.NoActionResource ("$(OutputPath)netstandard2.0\\$(AssemblyName).dll") { - TextContent = null, - BinaryContent = null, - Metadata = { - { "PackagePath", "ref\\netstandard2.0" }, - { "Pack", "True" } - }, - }, - new BuildItem.NoActionResource ($"$(OutputPath){monoandroidFramework}\\$(AssemblyName).dll") { - TextContent = null, - BinaryContent = null, - Metadata = { - { "PackagePath", $"lib\\{monoandroidFramework}" }, - { "Pack", "True" } - }, - }, - }, - }; - ns.SetProperty ("TargetFrameworks", $"netstandard2.0;{monoandroidFramework}"); - ns.SetProperty ("PackageId", "dummy.package.foo"); - ns.SetProperty ("PackageVersion", "1.0.0"); - ns.SetProperty ("GeneratePackageOnBuild", "True"); - ns.SetProperty ("IncludeBuildOutput", "False"); - ns.SetProperty ("Summary", "Test"); - ns.SetProperty ("Description", "Test"); - ns.SetProperty ("PackageOutputPath", path); - - - var xa = new XamarinAndroidApplicationProject () { - ProjectName = "App", - PackageReferences = { - new Package () { - Id = "dummy.package.foo", - Version = "1.0.0", - }, - }, - OtherBuildItems = { - new BuildItem.NoActionResource ("NuGet.config") { - }, - }, - }; - xa.SetProperty ("RestoreNoCache", "true"); - xa.SetProperty ("RestorePackagesPath", "$(MSBuildThisFileDirectory)packages"); - using (var nsb = CreateDllBuilder (Path.Combine (path, ns.ProjectName), cleanupAfterSuccessfulBuild: false, cleanupOnDispose: false)) - using (var xab = CreateApkBuilder (Path.Combine (path, xa.ProjectName), cleanupAfterSuccessfulBuild: false, cleanupOnDispose: false)) { - nsb.ThrowOnBuildFailure = xab.ThrowOnBuildFailure = false; - Assert.IsTrue (nsb.Build (ns), "Build of NetStandard Library should have succeeded."); - Assert.IsFalse (xab.Build (xa, doNotCleanupOnUpdate: true), "Build of App Library should have failed."); - File.WriteAllText (Path.Combine (Root, xab.ProjectDirectory, "NuGet.config"), @" - - - - - -"); - Assert.IsTrue (xab.Build (xa, doNotCleanupOnUpdate: true), "Build of App Library should have succeeded."); - string expected = Path.Combine ("dummy.package.foo", "1.0.0", "lib", monoandroidFramework, "Dummy.dll"); - Assert.IsTrue (xab.LastBuildOutput.ContainsText (expected), $"Build should be using {expected}"); - } - } - [Test] public void MissingSatelliteAssemblyInLibrary () { diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/KnownPackages.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/KnownPackages.cs index c4dca5c2b42..5caf109940b 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/KnownPackages.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/KnownPackages.cs @@ -525,16 +525,7 @@ public static class KnownPackages }; public static Package Acr_UserDialogs = new Package { Id = "Acr.UserDialogs", - Version = "6.5.1", - TargetFramework = "MonoAndroid10", - References = { - new BuildItem.Reference ("Acr.UserDialogs") { - MetadataValues = "HintPath=..\\packages\\Acr.UserDialogs.6.5.1\\lib\\MonoAndroid10\\Acr.UserDialogs.dll" - }, - new BuildItem.Reference ("Acr.UserDialogs.Interfaces") { - MetadataValues = "HintPath=..\\packages\\Acr.UserDialogs.6.5.1\\lib\\MonoAndroid10\\Acr.UserDialogs.Interfaces.dll" - } - }, + Version = "8.0.1", }; public static Package CircleImageView = new Package { Id = "Refractored.Controls.CircleImageView", diff --git a/tests/MSBuildDeviceIntegration/Tests/DeleteBinObjTest.cs b/tests/MSBuildDeviceIntegration/Tests/DeleteBinObjTest.cs deleted file mode 100644 index 532b5abb21e..00000000000 --- a/tests/MSBuildDeviceIntegration/Tests/DeleteBinObjTest.cs +++ /dev/null @@ -1,98 +0,0 @@ -using NUnit.Framework; -using System.Collections.Generic; -using System.IO; -using Xamarin.ProjectTools; - -namespace Xamarin.Android.Build.Tests -{ - [TestFixture] - [Category ("DotNetIgnore")] // .csproj files are legacy projects that won't build under dotnet - public class DeleteBinObjTest : DeviceTest - { - const string BaseUrl = "https://github.com/dellis1972/xamarin-android-unittest-files/blob/main/"; - readonly DownloadedCache Cache = new DownloadedCache (); - - string HostOS => IsWindows ? "Windows" : "Darwin"; - void RunTest (string name, string sln, string csproj, string version, string revision, string packageName, string javaPackageName, bool isRelease) - { - var configuration = isRelease ? "Release" : "Debug"; - var zipPath = Cache.GetAsFile ($"{BaseUrl}{name}-{version}-{HostOS}-{revision}.7z?raw=true"); - using (var builder = CreateApkBuilder (Path.Combine ("temp", TestName))) - using (var zip = SevenZipHelper.Open (zipPath, FileMode.Open)) { - builder.AutomaticNuGetRestore = false; - - if (!builder.TargetFrameworkExists ("v9.0")) { - Assert.Ignore ("TargetFrameworkVersion=v9.0 required for this test."); - return; - } - - var projectDir = Path.Combine (Root, builder.ProjectDirectory); - if (Directory.Exists (projectDir)) - Directory.Delete (projectDir, recursive: true); - zip.ExtractAll (projectDir); - - var solution = new ExistingProject { - IsRelease = isRelease, - ProjectFilePath = Path.Combine (projectDir, sln), - }; - // RestoreNoCache will bypass a global cache on CI machines - Assert.IsTrue (builder.Restore (solution, doNotCleanupOnUpdate: true, parameters: new [] { "RestoreNoCache=True" }), "Restore should have succeeded."); - - var project = new ExistingProject { - IsRelease = isRelease, - ProjectFilePath = Path.Combine (projectDir, csproj), - }; - var parameters = new List { - "Configuration=" + configuration, - // Move the $(IntermediateOutputPath) directory to match zips - "IntermediateOutputPath=" + Path.Combine ("obj", isRelease ? "Release" : "Debug", "90") + Path.DirectorySeparatorChar - }; - if (isRelease || !CommercialBuildAvailable) { - parameters.Add (KnownProperties.AndroidSupportedAbis + "=\"armeabi-v7a;x86;x86_64\""); - } else { - parameters.Add (KnownProperties.AndroidSupportedAbis + "=\"armeabi-v7a;arm64-v8a;x86;x86_64\""); - } - if (IsDeviceAttached ()) { - Assert.IsTrue (builder.Install (project, doNotCleanupOnUpdate: true, parameters: parameters.ToArray (), saveProject: false), - "Install should have succeeded."); - ClearAdbLogcat (); - if (CommercialBuildAvailable) - Assert.True (builder.RunTarget (project, "_Run", doNotCleanupOnUpdate: true, parameters: parameters.ToArray ()), "Project should have run."); - else - AdbStartActivity ($"{packageName}/{javaPackageName}.MainActivity"); - Assert.True (WaitForActivityToStart (packageName, "MainActivity", - Path.Combine (Root, builder.ProjectDirectory, "logcat.log"), 30), "Activity should have started."); - } else { - Assert.IsTrue (builder.Build (project, doNotCleanupOnUpdate: true, parameters: parameters.ToArray (), saveProject: false), - "Build should have succeeded."); - } - } - } - - [Test, Category ("UsesDevice")] - public void HelloForms15_9 ([Values (false, true)] bool isRelease) - { - RunTest ("HelloForms", - "HelloForms.sln", - Path.Combine ("HelloForms.Android", "HelloForms.Android.csproj"), - "15.9", - "ecb13a9", - "com.companyname", - "crc6450e568c951913723", - isRelease); - } - - [Test, Category ("UsesDevice")] - public void HelloForms16_4 ([Values (false, true)] bool isRelease) - { - RunTest ("HelloForms", - "HelloForms.sln", - Path.Combine ("HelloForms.Android", "HelloForms.Android.csproj"), - "16.4", - "dea8b8d", - "com.companyname", - "crc6450e568c951913723", - isRelease); - } - } -} diff --git a/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs b/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs index e6331a607d1..2286d0fed22 100644 --- a/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs +++ b/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs @@ -301,59 +301,6 @@ public string GetData() { } } - public static string [] ProfilerOptions () => new string [] { - "log:heapshot", // Heapshot - "log:sample", // Sample - "log:nodefaults,exception,monitor,counter,sample", // Sample5_8 - "log:nodefaults,exception,monitor,counter,sample-real", // SampleReal - "log:alloc", // Allocations - "log:nodefaults,gc,gcalloc,gcroot,gcmove,counter", // Allocations5_8 - "log:nodefaults,gc,nogcalloc,gcroot,gcmove,counter", // LightAllocations - "log:calls,alloc,heapshot", // All - }; - - [Test] - [Category ("DotNetIgnore")] // TODO: libmono-profiler-log.so is missing in .NET 6 - public void ProfilerLogOptions_ShouldCreateMlpdFiles ([ValueSource (nameof (ProfilerOptions))] string profilerOption) - { - AssertCommercialBuild (); - - proj = new XamarinAndroidApplicationProject () { - }; - builder = CreateApkBuilder (); - Assert.IsTrue (builder.Install (proj), "Install should have succeeded."); - string mlpdDestination = Path.Combine (Root, builder.ProjectDirectory, "profile.mlpd"); - if (File.Exists (mlpdDestination)) - File.Delete (mlpdDestination); - - RunAdbCommand ($"shell setprop debug.mono.profile {profilerOption}"); - RunProjectAndAssert (proj, builder); - Assert.True (WaitForActivityToStart (proj.PackageName, "MainActivity", - Path.Combine (Root, builder.ProjectDirectory, "logcat.log"), 30), "Activity should have started."); - - // Wait for seven seconds after the activity is displayed to get profiler results - WaitFor (7000); - string profilerFileDir = null; - foreach (var dir in GetOverrideDirectoryPaths (proj.PackageName)) { - var listing = RunAdbCommand ($"shell run-as {proj.PackageName} ls {dir}"); - if (listing.Contains ("profile.mlpd")) { - profilerFileDir = dir; - break; - } - } - - Assert.IsTrue (!string.IsNullOrEmpty (profilerFileDir), $"Unable to locate 'profile.mlpd' in any override directories."); - var profilerContent = RunAdbCommand ($"shell run-as {proj.PackageName} cat {profilerFileDir}/profile.mlpd"); - File.WriteAllText (mlpdDestination, profilerContent); - RunAdbCommand ($"shell run-as {proj.PackageName} rm {profilerFileDir}/profile.mlpd"); - RunAdbCommand ($"shell am force-stop {proj.PackageName}"); - RunAdbCommand ("shell setprop debug.mono.profile \"\""); - Assert.IsTrue (new FileInfo (mlpdDestination).Length > 5000, - $"profile.mlpd file created with option '{profilerOption}' was not larger than 5 kb. The application may have crashed."); - Assert.IsTrue (profilerContent.Contains ("String") && profilerContent.Contains ("Java"), - $"profile.mlpd file created with option '{profilerOption}' did not contain expected data."); - } - [Test] public void CustomLinkDescriptionPreserve ([Values (AndroidLinkMode.SdkOnly, AndroidLinkMode.Full)] AndroidLinkMode linkMode) { From 7bf4eddb8f02ec9ab9cef08c7bcfabbba9148dce Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 20 Jul 2023 08:40:03 -0500 Subject: [PATCH 2/2] Bump to dotnet/installer/main@ca467d68c8 8.0.100-preview.7.23364.32 (#8176) Changes: https://github.com/dotnet/installer/compare/28d4a6b4be...ca467d68c8 Changes: https://github.com/dotnet/runtime/compare/3e87528325...ae99bb2e7a Changes: https://github.com/dotnet/emsdk/compare/60a73f97a0...afbff08914 Changes: https://github.com/dotnet/cecil/compare/3e46711f5a...1a6a83a8f5 Updates: * Microsoft.Dotnet.Sdk.Internal: from 8.0.100-preview.7.23330.16 to 8.0.100-preview.7.23364.32 * Microsoft.NETCore.App.Ref: from 8.0.0-preview.7.23329.8 to 8.0.0-preview.7.23364.3 * Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport: from 8.0.0-preview.7.23326.1 to 8.0.0-preview.7.23361.2 * Microsoft.NET.ILLink.Tasks: from 8.0.0-preview.7.23329.8 to 8.0.0-preview.7.23364.3 * Microsoft.DotNet.Cecil: from 0.11.4-alpha.23327.1 to 0.11.4-alpha.23360.2 ~~ Other changes ~~ * Update `.apkdesc` files for app size changes * Ignore several tests around an LLVM build issue on Windows: https://github.com/dotnet/runtime/issues/88625 * Workarounds for behavior changes around `$DOTNET_ROOT`: This appears to be the way to get `` to pick the right `dotnet`: https://github.com/dotnet/roslyn/pull/68918/files#diff-ec99cd9453fe657dd1ea08e93e94b0bb51c51484b8ad25882d312564e5fe8e26R61 * [tests] disable failing Java.Interop tests under LLVM https://github.com/dotnet/runtime/issues/89190 * Bump to xamarin/java.interop/main@62efc0980 Changes: https://github.com/xamarin/java.interop/compare/151b03ee...62efc098 Co-authored-by: Jonathan Peppers --- .../yaml-templates/run-dotnet-preview.yaml | 6 +- build-tools/scripts/msbuild.mk | 5 +- eng/Version.Details.xml | 20 ++-- eng/Versions.props | 10 +- external/Java.Interop | 2 +- .../Xamarin.Android.Build.Tests/AotTests.cs | 9 ++ .../Xamarin.Android.Build.Tests/BuildTest.cs | 3 + .../Xamarin.ProjectTools/Common/Builder.cs | 1 + .../Xamarin.ProjectTools/Common/DotNetCLI.cs | 1 + .../BuildReleaseArm64SimpleDotNet.apkdesc | 32 +++--- .../BuildReleaseArm64XFormsDotNet.apkdesc | 103 +++++++++--------- .../Mono.Android.NET-Tests.csproj | 2 + 12 files changed, 108 insertions(+), 86 deletions(-) diff --git a/build-tools/automation/yaml-templates/run-dotnet-preview.yaml b/build-tools/automation/yaml-templates/run-dotnet-preview.yaml index f0b62b4eb1d..0f66892f3f9 100644 --- a/build-tools/automation/yaml-templates/run-dotnet-preview.yaml +++ b/build-tools/automation/yaml-templates/run-dotnet-preview.yaml @@ -13,9 +13,11 @@ parameters: steps: - powershell: | if ([Environment]::OSVersion.Platform -eq "Unix") { - $dotnetPath = "${{ parameters.xaSourcePath }}/bin/${{ parameters.configuration }}/dotnet/dotnet" + $env:DOTNET_ROOT = "${{ parameters.xaSourcePath }}/bin/${{ parameters.configuration }}/dotnet" + $dotnetPath = "$env:DOTNET_ROOT/dotnet" } else { - $dotnetPath = "${{ parameters.xaSourcePath }}\bin\${{ parameters.configuration }}\dotnet\dotnet.exe" + $env:DOTNET_ROOT = "${{ parameters.xaSourcePath }}\bin\${{ parameters.configuration }}\dotnet" + $dotnetPath = "$env:DOTNET_ROOT\dotnet.exe" } & $dotnetPath ${{ parameters.command }} ${{ parameters.project }} ${{ parameters.arguments }} if ([System.Convert]::ToBoolean("${{ parameters.useExitCodeForErrors }}") -and $LASTEXITCODE -ne 0) { diff --git a/build-tools/scripts/msbuild.mk b/build-tools/scripts/msbuild.mk index 3416f3b7c30..ce587b3f06f 100644 --- a/build-tools/scripts/msbuild.mk +++ b/build-tools/scripts/msbuild.mk @@ -23,7 +23,8 @@ # $(MSBUILD_FLAGS): Additional MSBuild flags; contains $(CONFIGURATION), $(V), $(MSBUILD_ARGS). MSBUILD = msbuild -DOTNET_TOOL = $(topdir)/bin/$(CONFIGURATION)/dotnet/dotnet +DOTNET_ROOT = $(topdir)/bin/$(CONFIGURATION)/dotnet/ +DOTNET_TOOL = $(DOTNET_ROOT)dotnet DOTNET_VERB = build MSBUILD_FLAGS = /p:Configuration=$(CONFIGURATION) $(MSBUILD_ARGS) @@ -51,7 +52,7 @@ endef # $(call DOTNET_BINLOG,name,build=$(DOTNET_VERB),dotnet=$(DOTNET_TOOL)) define DOTNET_BINLOG - $(if $(3),$(3),$(DOTNET_TOOL)) $(if $(2),$(2),$(DOTNET_VERB)) -c $(CONFIGURATION) -v:n $(MSBUILD_ARGS) \ + $(if $(3),,DOTNET_ROOT='$(DOTNET_ROOT)') $(if $(3),$(3),$(DOTNET_TOOL)) $(if $(2),$(2),$(DOTNET_VERB)) -c $(CONFIGURATION) -v:n $(MSBUILD_ARGS) \ -bl:"$(dir $(realpath $(firstword $(MAKEFILE_LIST))))/bin/Build$(CONFIGURATION)/msbuild-`date +%Y%m%dT%H%M%S`-$(1).binlog" endef diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index cf060270d0a..322c4f479a3 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,24 +1,24 @@ - + https://github.com/dotnet/installer - 28d4a6b4bed1515bdbe491c9e0c8ef7aa3a24497 + ca467d68c8f678a671984a46996d3fc37fe7f3de - + https://github.com/dotnet/runtime - 3e87528325b09f884b0a09a8c4ef79393abfd0db + ae99bb2e7a0a5db7c2bff129322965fd3c6e820d - + https://github.com/dotnet/runtime - 3e87528325b09f884b0a09a8c4ef79393abfd0db + ae99bb2e7a0a5db7c2bff129322965fd3c6e820d - + https://github.com/dotnet/emsdk - 60a73f97a0ec16c25ce4d36b1bcff1fedb831716 + afbff08914374ed6790324635b9346d1256680fc - + https://github.com/dotnet/cecil - 3e46711f5a933551557286d211970faa08b07b7e + 1a6a83a8f50e1119f1007b1e3c211d3289ba6901 diff --git a/eng/Versions.props b/eng/Versions.props index c060c201fb3..fddefd8c31e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -1,15 +1,15 @@ - 8.0.100-preview.7.23330.16 - 8.0.0-preview.7.23329.8 - 8.0.0-preview.7.23329.8 + 8.0.100-preview.7.23364.32 + 8.0.0-preview.7.23364.3 + 8.0.0-preview.7.23364.3 7.0.0-beta.22103.1 7.0.0-beta.22103.1 - 8.0.0-preview.7.23326.1 + 8.0.0-preview.7.23361.2 $(MicrosoftNETWorkloadEmscriptenCurrentManifest80100TransportVersion) 7.0.100-rc.1.22410.7 - 0.11.4-alpha.23327.1 + 0.11.4-alpha.23360.2 $(MicrosoftNETCoreAppRefPackageVersion) diff --git a/external/Java.Interop b/external/Java.Interop index 151b03ee1ee..62efc09806d 160000 --- a/external/Java.Interop +++ b/external/Java.Interop @@ -1 +1 @@ -Subproject commit 151b03ee1eefa62e3d29b034b2aaf05ea73d99ed +Subproject commit 62efc09806d6d2ed1cac34611acb070856d53f02 diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AotTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AotTests.cs index db875ef9278..37f0fcfcf8b 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AotTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AotTests.cs @@ -137,6 +137,9 @@ public void BuildBasicApplicationReleaseProfiledAotWithoutDefaultProfile () [TestCaseSource (nameof (AotChecks))] public void BuildAotApplicationWithNdkAndBundleAndÜmläüts (string supportedAbis, bool enableLLVM, bool usesAssemblyBlobs) { + if (IsWindows) + Assert.Ignore ("https://github.com/dotnet/runtime/issues/88625"); + var abisSanitized = supportedAbis.Replace (";", "").Replace ("-", "").Replace ("_", ""); var path = Path.Combine ("temp", string.Format ("BuildAotNdk AndÜmläüts_{0}_{1}_{2}", abisSanitized, enableLLVM, usesAssemblyBlobs)); var proj = new XamarinAndroidApplicationProject () { @@ -213,6 +216,9 @@ public void BuildAotApplicationWithNdkAndBundleAndÜmläüts (string supportedAb [TestCaseSource (nameof (AotChecks))] public void BuildAotApplicationAndÜmläüts (string supportedAbis, bool enableLLVM, bool usesAssemblyBlobs) { + if (IsWindows) + Assert.Ignore ("https://github.com/dotnet/runtime/issues/88625"); + var abisSanitized = supportedAbis.Replace (";", "").Replace ("-", "").Replace ("_", ""); var path = Path.Combine ("temp", string.Format ("BuildAot AndÜmläüts_{0}_{1}_{2}", abisSanitized, enableLLVM, usesAssemblyBlobs)); var proj = new XamarinAndroidApplicationProject () { @@ -411,6 +417,9 @@ public static void Foo () { [Category ("LLVM")] public void NoSymbolsArgShouldReduceAppSize ([Values ("", "Hybrid")] string androidAotMode, [Values (false, true)] bool skipDebugSymbols) { + if (IsWindows) + Assert.Ignore ("https://github.com/dotnet/runtime/issues/88625"); + AssertAotModeSupported (androidAotMode); var proj = new XamarinAndroidApplicationProject () { 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 57a188a4741..149caaf74be 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 @@ -85,6 +85,9 @@ public void CheckMonoComponentsMask (bool enableProfiler, bool useInterpreter, b [Test] public void CheckWhetherLibcAndLibmAreReferencedInAOTLibraries () { + if (IsWindows) + Assert.Ignore ("https://github.com/dotnet/runtime/issues/88625"); + var proj = new XamarinAndroidApplicationProject { IsRelease = true, EmbedAssembliesIntoApk = true, diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/Builder.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/Builder.cs index 334aa28ddfb..134fff471ef 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/Builder.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/Builder.cs @@ -279,6 +279,7 @@ protected bool BuildInternal (string projectOrSolution, string target, string [] } if (Builder.UseDotNet) { psi.SetEnvironmentVariable ("DOTNET_MULTILEVEL_LOOKUP", "0"); + psi.SetEnvironmentVariable ("DOTNET_ROOT", TestEnvironment.DotNetPreviewDirectory); } psi.Arguments = args.ToString (); diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/DotNetCLI.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/DotNetCLI.cs index 7c0477ceb8c..d3da05577a1 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/DotNetCLI.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/DotNetCLI.cs @@ -47,6 +47,7 @@ protected bool Execute (params string [] args) p.StartInfo.RedirectStandardOutput = true; p.StartInfo.RedirectStandardError = true; p.StartInfo.SetEnvironmentVariable ("DOTNET_MULTILEVEL_LOOKUP", "0"); + p.StartInfo.SetEnvironmentVariable ("DOTNET_ROOT", TestEnvironment.DotNetPreviewDirectory); if (TestEnvironment.UseLocalBuildOutput) { p.StartInfo.SetEnvironmentVariable ("DOTNETSDK_WORKLOAD_MANIFEST_ROOTS", TestEnvironment.WorkloadManifestOverridePath); p.StartInfo.SetEnvironmentVariable ("DOTNETSDK_WORKLOAD_PACK_ROOTS", TestEnvironment.WorkloadPackOverridePath); diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.apkdesc b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.apkdesc index 4c814f7c391..e5d2975877c 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.apkdesc +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.apkdesc @@ -8,58 +8,58 @@ "Size": 1024 }, "assemblies/Java.Interop.dll": { - "Size": 58990 + "Size": 58895 }, "assemblies/Mono.Android.dll": { - "Size": 88074 + "Size": 88112 }, "assemblies/Mono.Android.Runtime.dll": { - "Size": 5819 + "Size": 5575 }, "assemblies/rc.bin": { - "Size": 1235 + "Size": 1302 }, "assemblies/System.Console.dll": { - "Size": 6448 + "Size": 6418 }, "assemblies/System.Linq.dll": { - "Size": 9135 + "Size": 9212 }, "assemblies/System.Private.CoreLib.dll": { - "Size": 537441 + "Size": 548643 }, "assemblies/System.Runtime.dll": { - "Size": 2629 + "Size": 2633 }, "assemblies/System.Runtime.InteropServices.dll": { - "Size": 3768 + "Size": 3733 }, "assemblies/UnnamedProject.dll": { - "Size": 3222 + "Size": 2931 }, "classes.dex": { "Size": 377064 }, "lib/arm64-v8a/libmono-component-marshal-ilgen.so": { - "Size": 97392 + "Size": 97096 }, "lib/arm64-v8a/libmonodroid.so": { - "Size": 380704 + "Size": 381088 }, "lib/arm64-v8a/libmonosgen-2.0.so": { - "Size": 3177168 + "Size": 3184096 }, "lib/arm64-v8a/libSystem.IO.Compression.Native.so": { "Size": 723560 }, "lib/arm64-v8a/libSystem.Native.so": { - "Size": 94424 + "Size": 93856 }, "lib/arm64-v8a/libSystem.Security.Cryptography.Native.Android.so": { "Size": 154904 }, "lib/arm64-v8a/libxamarin-app.so": { - "Size": 11080 + "Size": 11608 }, "META-INF/BNDLTOOL.RSA": { "Size": 1213 @@ -95,5 +95,5 @@ "Size": 1904 } }, - "PackageSize": 2771274 + "PackageSize": 2787658 } \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64XFormsDotNet.apkdesc b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64XFormsDotNet.apkdesc index 69c4b5976c5..7c32c7305d2 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64XFormsDotNet.apkdesc +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64XFormsDotNet.apkdesc @@ -11,130 +11,133 @@ "Size": 7112 }, "assemblies/Java.Interop.dll": { - "Size": 66908 + "Size": 66808 }, "assemblies/Mono.Android.dll": { - "Size": 469884 + "Size": 469914 }, "assemblies/Mono.Android.Runtime.dll": { - "Size": 5819 + "Size": 5575 }, "assemblies/mscorlib.dll": { - "Size": 3865 + "Size": 3870 }, "assemblies/netstandard.dll": { - "Size": 5581 + "Size": 5585 }, "assemblies/rc.bin": { - "Size": 1235 + "Size": 1302 }, "assemblies/System.Collections.Concurrent.dll": { - "Size": 11557 + "Size": 11524 }, "assemblies/System.Collections.dll": { - "Size": 15444 + "Size": 15415 }, "assemblies/System.Collections.NonGeneric.dll": { - "Size": 7501 + "Size": 7461 }, "assemblies/System.ComponentModel.dll": { - "Size": 1976 + "Size": 1946 }, "assemblies/System.ComponentModel.Primitives.dll": { - "Size": 2598 + "Size": 2560 }, "assemblies/System.ComponentModel.TypeConverter.dll": { - "Size": 6085 + "Size": 6044 }, "assemblies/System.Console.dll": { - "Size": 6614 + "Size": 6588 }, "assemblies/System.Core.dll": { - "Size": 1991 + "Size": 1996 + }, + "assemblies/System.Diagnostics.DiagnosticSource.dll": { + "Size": 12529 }, "assemblies/System.Diagnostics.TraceSource.dll": { - "Size": 6590 + "Size": 6562 }, "assemblies/System.dll": { - "Size": 2348 + "Size": 2350 }, "assemblies/System.Drawing.dll": { - "Size": 1940 + "Size": 1944 }, "assemblies/System.Drawing.Primitives.dll": { - "Size": 12010 + "Size": 11987 }, "assemblies/System.IO.Compression.Brotli.dll": { - "Size": 11223 + "Size": 11196 }, "assemblies/System.IO.Compression.dll": { - "Size": 15904 + "Size": 15877 }, "assemblies/System.IO.IsolatedStorage.dll": { - "Size": 9912 + "Size": 9887 }, "assemblies/System.Linq.dll": { - "Size": 19495 + "Size": 19570 }, "assemblies/System.Linq.Expressions.dll": { - "Size": 164340 + "Size": 164694 }, "assemblies/System.Net.Http.dll": { - "Size": 65673 + "Size": 69096 }, "assemblies/System.Net.Primitives.dll": { - "Size": 22474 + "Size": 22443 }, "assemblies/System.Net.Requests.dll": { - "Size": 3632 + "Size": 3609 }, "assemblies/System.ObjectModel.dll": { - "Size": 8157 + "Size": 8124 }, "assemblies/System.Private.CoreLib.dll": { - "Size": 834482 + "Size": 843541 }, "assemblies/System.Private.DataContractSerialization.dll": { - "Size": 192929 + "Size": 192912 }, "assemblies/System.Private.Uri.dll": { - "Size": 43458 + "Size": 43487 }, "assemblies/System.Private.Xml.dll": { - "Size": 215826 + "Size": 215780 }, "assemblies/System.Private.Xml.Linq.dll": { - "Size": 16684 + "Size": 16647 }, "assemblies/System.Runtime.dll": { - "Size": 2776 + "Size": 2759 }, "assemblies/System.Runtime.InteropServices.dll": { - "Size": 3768 + "Size": 3733 }, "assemblies/System.Runtime.Serialization.dll": { - "Size": 1868 + "Size": 1872 }, "assemblies/System.Runtime.Serialization.Formatters.dll": { - "Size": 2520 + "Size": 2490 }, "assemblies/System.Runtime.Serialization.Primitives.dll": { - "Size": 3805 + "Size": 3769 }, "assemblies/System.Security.Cryptography.dll": { - "Size": 8133 + "Size": 8111 }, "assemblies/System.Text.RegularExpressions.dll": { - "Size": 159004 + "Size": 158602 }, "assemblies/System.Xml.dll": { - "Size": 1761 + "Size": 1765 }, "assemblies/System.Xml.Linq.dll": { - "Size": 1778 + "Size": 1782 }, "assemblies/UnnamedProject.dll": { - "Size": 5300 + "Size": 4987 }, "assemblies/Xamarin.AndroidX.Activity.dll": { "Size": 5942 @@ -206,25 +209,25 @@ "Size": 3514720 }, "lib/arm64-v8a/libmono-component-marshal-ilgen.so": { - "Size": 97392 + "Size": 97096 }, "lib/arm64-v8a/libmonodroid.so": { - "Size": 380704 + "Size": 381088 }, "lib/arm64-v8a/libmonosgen-2.0.so": { - "Size": 3177168 + "Size": 3184096 }, "lib/arm64-v8a/libSystem.IO.Compression.Native.so": { "Size": 723560 }, "lib/arm64-v8a/libSystem.Native.so": { - "Size": 94424 + "Size": 93856 }, "lib/arm64-v8a/libSystem.Security.Cryptography.Native.Android.so": { "Size": 154904 }, "lib/arm64-v8a/libxamarin-app.so": { - "Size": 102136 + "Size": 102800 }, "META-INF/android.support.design_material.version": { "Size": 12 @@ -338,13 +341,13 @@ "Size": 1213 }, "META-INF/BNDLTOOL.SF": { - "Size": 76902 + "Size": 77024 }, "META-INF/com.google.android.material_material.version": { "Size": 10 }, "META-INF/MANIFEST.MF": { - "Size": 76775 + "Size": 76897 }, "META-INF/proguard/androidx-annotations.pro": { "Size": 339 @@ -1913,5 +1916,5 @@ "Size": 325240 } }, - "PackageSize": 7953326 + "PackageSize": 7982094 } \ No newline at end of file diff --git a/tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj b/tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj index 40c61020b59..f21c94de80f 100644 --- a/tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj +++ b/tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj @@ -29,6 +29,8 @@ NetworkInterfaces excluded: https://github.com/dotnet/runtime/issues/75155 --> DotNetIgnore + + $(ExcludeCategories):LLVMIgnore $(ExcludeCategories):InetAccess:NetworkInterfaces