diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/BuildAppBundle.cs b/src/Xamarin.Android.Build.Tasks/Tasks/BuildAppBundle.cs index 213e09272d2..016654829dc 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/BuildAppBundle.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/BuildAppBundle.cs @@ -102,7 +102,7 @@ public override bool RunTask () }); var mergeSettings = new JsonMergeSettings () { - MergeArrayHandling = MergeArrayHandling.Replace, + MergeArrayHandling = MergeArrayHandling.Union, MergeNullValueHandling = MergeNullValueHandling.Ignore }; json.Merge (jsonAddition, mergeSettings); diff --git a/tests/MSBuildDeviceIntegration/Tests/BundleToolTests.cs b/tests/MSBuildDeviceIntegration/Tests/BundleToolTests.cs index c6976df1e2e..78538e50734 100644 --- a/tests/MSBuildDeviceIntegration/Tests/BundleToolTests.cs +++ b/tests/MSBuildDeviceIntegration/Tests/BundleToolTests.cs @@ -29,6 +29,11 @@ public class BundleToolTests : DeviceTest // Disable split by language const string BuildConfig = @"{ + ""compression"": { + ""uncompressedGlob"": [ + ""assets/*.data"" + ] + }, ""optimizations"": { ""splits_config"": { ""split_dimension"": [ @@ -77,6 +82,9 @@ public void OneTimeSetUp () app.OtherBuildItems.Add (new AndroidItem.AndroidAsset ("foo.wav") { BinaryContent = () => bytes, }); + app.OtherBuildItems.Add (new AndroidItem.AndroidAsset ("foo.data") { + BinaryContent = () => bytes, + }); app.OtherBuildItems.Add (new BuildItem ("None", "buildConfig.json") { TextContent = () => BuildConfig, }); @@ -324,6 +332,7 @@ public void ApkSet () var uncompressed = new List { ".bar", ".wav", + ".data", }; if (usesAssemblyBlobs) { diff --git a/tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs b/tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs index cffcf4e3279..712bd184795 100755 --- a/tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs +++ b/tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs @@ -136,21 +136,37 @@ public void ClassLibraryMainLauncherRuns ([Values (true, false)] bool preloadAss /* embedAssemblies */ true, /* fastDevType */ "Assemblies", /* activityStarts */ true, + /* packageFormat */ "apk", }, new object[] { /* embedAssemblies */ false, /* fastDevType */ "Assemblies", /* activityStarts */ true, + /* packageFormat */ "apk", }, new object[] { /* embedAssemblies */ true, /* fastDevType */ "Assemblies:Dexes", /* activityStarts */ true, + /* packageFormat */ "apk", }, new object[] { /* embedAssemblies */ false, /* fastDevType */ "Assemblies:Dexes", /* activityStarts */ false, + /* packageFormat */ "apk", + }, + new object[] { + /* embedAssemblies */ true, + /* fastDevType */ "Assemblies", + /* activityStarts */ true, + /* packageFormat */ "aab", + }, + new object[] { + /* embedAssemblies */ true, + /* fastDevType */ "Assemblies:Dexes", + /* activityStarts */ true, + /* packageFormat */ "aab", }, }; #pragma warning restore 414 @@ -158,7 +174,7 @@ public void ClassLibraryMainLauncherRuns ([Values (true, false)] bool preloadAss [Test, Category ("Debugger")] [TestCaseSource (nameof (DebuggerCustomAppTestCases))] [Retry(5)] - public void CustomApplicationRunsWithDebuggerAndBreaks (bool embedAssemblies, string fastDevType, bool activityStarts) + public void CustomApplicationRunsWithDebuggerAndBreaks (bool embedAssemblies, string fastDevType, bool activityStarts, string packageFormat) { AssertCommercialBuild (); SwitchUser (); @@ -175,6 +191,7 @@ public void CustomApplicationRunsWithDebuggerAndBreaks (bool embedAssemblies, st }; proj.SetAndroidSupportedAbis ("armeabi-v7a", "x86", "x86_64"); proj.SetProperty ("EmbedAssembliesIntoApk", embedAssemblies.ToString ()); + proj.SetProperty ("AndroidPackageFormat", packageFormat); proj.SetDefaultTargetDevice (); proj.Sources.Add (new BuildItem.Source ("MyApplication.cs") { TextContent = () => proj.ProcessSourceTemplate (@"using System; @@ -281,42 +298,63 @@ public override void OnCreate () /* fastDevType */ "Assemblies", /* allowDeltaInstall */ false, /* user */ null, + /* packageFormat */ "apk", }, new object[] { /* embedAssemblies */ false, /* fastDevType */ "Assemblies", /* allowDeltaInstall */ false, /* user */ null, + /* packageFormat */ "apk", }, new object[] { /* embedAssemblies */ false, /* fastDevType */ "Assemblies", /* allowDeltaInstall */ true, /* user */ null, + /* packageFormat */ "apk", }, new object[] { /* embedAssemblies */ false, /* fastDevType */ "Assemblies:Dexes", /* allowDeltaInstall */ false, /* user */ null, + /* packageFormat */ "apk", }, new object[] { /* embedAssemblies */ false, /* fastDevType */ "Assemblies:Dexes", /* allowDeltaInstall */ true, /* user */ null, + /* packageFormat */ "apk", }, new object[] { /* embedAssemblies */ true, /* fastDevType */ "Assemblies", /* allowDeltaInstall */ false, /* user */ DeviceTest.GuestUserName, + /* packageFormat */ "apk", }, new object[] { /* embedAssemblies */ false, /* fastDevType */ "Assemblies", /* allowDeltaInstall */ false, /* user */ DeviceTest.GuestUserName, + /* packageFormat */ "apk", + }, + new object[] { + /* embedAssemblies */ true, + /* fastDevType */ "Assemblies", + /* allowDeltaInstall */ false, + /* user */ null, + /* packageFormat */ "aab", + }, + new object[] { + /* embedAssemblies */ true, + /* fastDevType */ "Assemblies", + /* allowDeltaInstall */ false, + /* user */ DeviceTest.GuestUserName, + /* packageFormat */ "aab", }, }; #pragma warning restore 414 @@ -324,7 +362,7 @@ public override void OnCreate () [Test, Category ("Debugger")] [TestCaseSource (nameof(DebuggerTestCases))] [Retry (5)] - public void ApplicationRunsWithDebuggerAndBreaks (bool embedAssemblies, string fastDevType, bool allowDeltaInstall, string username) + public void ApplicationRunsWithDebuggerAndBreaks (bool embedAssemblies, string fastDevType, bool allowDeltaInstall, string username, string packageFormat) { AssertCommercialBuild (); SwitchUser (); @@ -367,6 +405,7 @@ public Foo () EmbedAssembliesIntoApk = embedAssemblies, AndroidFastDeploymentType = fastDevType }; + app.SetProperty ("AndroidPackageFormat", packageFormat); app.MainPage = app.MainPage.Replace ("InitializeComponent ();", "InitializeComponent (); new Foo ();"); app.AddReference (lib); app.SetAndroidSupportedAbis ("armeabi-v7a", "x86", "x86_64");