Skip to content

Commit

Permalink
[modules] Add readme for how to use dynamic feature modules
Browse files Browse the repository at this point in the history
Bug: 939566
Change-Id: Id6e1de7a0bd0e08765f4f444a7a1d0ec0eb8d665
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1547957
Commit-Queue: Tibor Goldschwendt <tiborg@chromium.org>
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#649524}
  • Loading branch information
Tibor Goldschwendt authored and Commit Bot committed Apr 10, 2019
1 parent ffdcfb9 commit 19364ba
Show file tree
Hide file tree
Showing 3 changed files with 704 additions and 11 deletions.
26 changes: 15 additions & 11 deletions build/android/docs/android_app_bundles.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ An Android app bundle is an alternative application distribution format for
Android applications on the Google Play Store, that allows reducing the size
of binaries sent for installation to individual devices that run on Android L
and beyond. For more information about them, see the official Android
documentation at:

https://developer.android.com/guide/app-bundle/
[documentation](https://developer.android.com/guide/app-bundle/).

For the context of this document, the most important points are:

Expand All @@ -26,18 +24,19 @@ For the context of this document, the most important points are:
- The splitting can be based on various criteria: e.g. language or screen
density for resources, or cpu ABI for native code.

- The bundle also uses the notion of modules to separate several application
features. Each module has its own code, assets and resources, and can be
installed separately from the rest of the application if needed.
- The bundle also uses the notion of dynamic features modules (DFMs) to
separate several application features. Each module has its own code, assets
and resources, and can be installed separately from the rest of the
application if needed.

- The main application itself is stored in the '`base`' module (this name
cannot be changed).


# Declaring app bundles with GN templates

Here's an example that shows how to declare a simple bundle that contains
a single base module, which enables language-based splits:
Here's an example that shows how to declare a simple bundle that contains a
single base module, which enables language-based splits:

```gn
Expand Down Expand Up @@ -83,9 +82,14 @@ the following:
This works like an APK wrapper script (e.g. `foo_apk`). Use `--help`
to see all possible commands supported by the script.

If you need more modules besides the base one, you will need to list all the
extra ones using the extra_modules variable which takes a list of GN scopes,
as in:

# Declaring dynamic feature modules with GN templates

Please see
[Dynamic Feature Modules](../../../docs/android_dynamic_feature_modules.md) for
more details. In short, if you need more modules besides the base one, you
will need to list all the extra ones using the extra_modules variable which
takes a list of GN scopes, as in:

```gn
Expand Down
2 changes: 2 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ used when committed.
What are .build_config files and how they are used.
* [Android App Bundles](../build/android/docs/android_app_bundles.md) -
How to build Android app bundles for Chrome.
* [Dynamic Feature Modules (DFMs)](android_dynamic_feature_modules.md) - How
to create dynamic feature modules.

### Misc iOS-Specific Docs
* [Continuous Build and Test Infrastructure for Chromium for iOS](ios/infra.md)
Expand Down
Loading

0 comments on commit 19364ba

Please sign in to comment.