Skip to content

Commit

Permalink
[Xamarin.Android.Build.Tasks] Add Ability to include additional Modul…
Browse files Browse the repository at this point in the history
…es (#3917)

AppBundles can support multiple modules. This PR adds
the ability to specify additional modules to the
`bundle-tool`. These options might be used in the
future to help support Dynamic features.

Added a new `@(AndroidAppBundleModules)` item group.
  • Loading branch information
dellis1972 authored and jonathanpeppers committed Dec 5, 2019
1 parent 853b367 commit dd49af3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Xamarin.Android.Build.Tasks/Tasks/BuildAppBundle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace Xamarin.Android.Tasks
{
Expand Down Expand Up @@ -61,6 +62,8 @@ public class BuildAppBundle : BundleTool
public string BaseZip { get; set; }

public string CustomBuildConfigFile { get; set; }

public string [] Modules { get; set; }

[Required]
public string Output { get; set; }
Expand Down Expand Up @@ -119,7 +122,11 @@ protected override CommandLineBuilder GetCommandLineBuilder ()
{
var cmd = base.GetCommandLineBuilder ();
cmd.AppendSwitch ("build-bundle");
cmd.AppendSwitchIfNotNull ("--modules ", BaseZip);
var modules = new List<string> ();
modules.Add (BaseZip);
if (Modules != null && Modules.Any ())
modules.AddRange (Modules);
cmd.AppendSwitchIfNotNull ("--modules ", string.Join (",", modules));
cmd.AppendSwitchIfNotNull ("--output ", Output);
cmd.AppendSwitchIfNotNull ("--config ", temp);
return cmd;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2767,6 +2767,7 @@ because xbuild doesn't support framework reference assemblies.
JavaOptions="$(JavaOptions)"
JarPath="$(AndroidBundleToolJarPath)"
BaseZip="$(_BaseZipIntermediate)"
Modules="@(AndroidAppBundleModules)"
Output="$(_AppBundleIntermediate)"
UncompressedFileExtensions="$(AndroidStoreUncompressedFileExtensions)"
CustomBuildConfigFile="$(AndroidBundleConfigurationFile)"
Expand Down

0 comments on commit dd49af3

Please sign in to comment.