Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Xamarin.Android.Build.Tasks/Tasks/BuildAppBundle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 9 additions & 0 deletions tests/MSBuildDeviceIntegration/Tests/BundleToolTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ public class BundleToolTests : DeviceTest

// Disable split by language
const string BuildConfig = @"{
""compression"": {
""uncompressedGlob"": [
""assets/*.data""
]
},
""optimizations"": {
""splits_config"": {
""split_dimension"": [
Expand Down Expand Up @@ -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,
});
Expand Down Expand Up @@ -324,6 +332,7 @@ public void ApkSet ()
var uncompressed = new List<string> {
".bar",
".wav",
".data",
};

if (usesAssemblyBlobs) {
Expand Down
43 changes: 41 additions & 2 deletions tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,29 +136,45 @@ 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

[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 ();
Expand All @@ -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;
Expand Down Expand Up @@ -281,50 +298,71 @@ 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

[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 ();
Expand Down Expand Up @@ -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");
Expand Down