Index: README.md |
=================================================================== |
--- a/README.md |
+++ b/README.md |
@@ -1,130 +1,53 @@ |
-Adblock Browser |
-=============== |
+# Adblock Browser |
The Adblock Plus browser, based on Firefox for Android. |
-Building |
--------- |
+## Simple build |
-First ensure that all dependencies are up to date by calling: |
+To generate a simple single-locale build, first ensure that all dependencies are up to date by calling: |
- ./ensure_dependencies.py |
+``` |
+./ensure_dependencies.py |
+``` |
-Then just follow Mozilla's [Firefox for Android build instructions][1]. |
+Then just follow Mozilla's [Simple Firefox for Android build][1]. |
+## Multi-locale build |
-Creating a multilocale build |
----------------------------- |
+While the manual process can be followed in Mozilla's [Instructions for multi-locale builds][2], the easiest way to create multi-locale builds is to follow the following Instructions: |
-### Automation ### |
+### Configuration |
-While the manual process is still documented below, the easiest way to create a |
-multi-locale build is to use [adblockbrowser-build][2]. |
+All the configuration resources required to generate multi-locale builds are located inside the `abb-build` folder. For most cases, you only will need to edit one file. |
-### Preparations ### |
+1. Make a copy of `config.py.sample` and rename it to `config.py` |
-1. Create a folder outside of the Adblock Browser repo, e.g `abb-multi` |
-2. Change into `abb-multi` and clone mozharness via: |
+2. Inside the `config.py` file, edit `ANDROID_SDK_PATH` to point to your Android SDK path |
- hg clone ssh://hg@bitbucket.org/adblockplus/mozharness -r adblockbrowser |
+3. Edit `ANDROID_NDK_PATH` to point to your Android NDK path |
-3. Symlink the adblockbrowser repo into `abb-multi`, e.g.: |
+4. If you intend to sign the .apk, edit `ANDROID_KEYSTORE_PATH` to point to your keystore path |
- ln -s ../adblockbrowser adblockbrowser |
+5. Also if you intend to sign the .apk, edit `ANDROID_KEY_NAME` to reflect your keystore name / alias |
-4. Copy your `mozconfig` from `adblockbrowser` to `abb-multi`, e.g.: |
+6. Edit `ARCHITECTURE` for the desired architecture. Currently available options are `arm` and `x86` |
- cp adblockbrowser/mozconfig ./mozconfig |
+7. Edit `DISTRIBUTION_MODE` for the desired distribution mode. Currently available options are `standalone` and `store` |
-5. Create a copy of the build configuration, e.g.: |
+8. Edit `BUILD_MODE` for the desired build mode. Currently available options are `devbuild` and `release` |
- cp mozharness/configs/multi_locale/standalone_mozilla-central.py abb-multi-cfg.py |
+9. Optionally, edit the `mozconfig-custom` file if you want to add any custom build configuration |
-### Configuration ### |
+### Building and signing |
-Apply the following changes to `abb-multi-cfg.py`: |
+There are 3 ways of running the `build.py` script: |
-* Change `BUILD_DIR = "mozilla-central"` to `BUILD_DIR = "adblockbrowser"` |
-* Make sure `OBJDIR = "objdir-droid"` matches your build output |
- folder |
-* Change `L10N_REPO_PATH` to point to `releases/l10n/mozilla-release` |
-* If your `mozconfig` is not called `mozconfig`, change `MOZCONFIG` |
-* **Remove the repository pulling part** from `config`. |
- The code to remove looks like this: |
+1. Run `./build.py build` To generate an unsigned .apk. |
- "repos": [{ |
- "repo": "https://hg.mozilla.org/%s" % REPO_PATH, |
- "tag": "default", |
- "dest": BUILD_DIR, |
- }], |
+2. Run `./build.py sign /path/to/apk` to sign an existing .apk |
-* Change `"hg_l10n_tag"` in `config` from `default` to `FENNEC_45_0_2_RELEASE` |
-* Add `en-ZA` to `ignore_locales` since it isn't currently supported |
-* [Issue #3047][3] introduced a custom build step named `abb-transform-locales` |
- for manipulating search engine availability and order. This must be inserted |
- into `default_actions` right before `package-multi` |
-* You might want to remove the `"backup-objdir"` build step if you do |
- not want your objdir to be backed up. Keep in mind that you then need to |
- clobber for a single-locale build. |
- |
-An example configuration could look like this: |
- |
- import os |
- # The name of the directory we'll pull our source into. |
- BUILD_DIR = "adblockbrowser" |
- # This is everything that comes after https://hg.mozilla.org/ |
- # e.g. "releases/mozilla-aurora" |
- REPO_PATH = "mozilla-central" |
- # This is where the l10n repos are (everything after https://hg.mozilla.org/) |
- # for mozilla-central, that's "l10n-central". |
- # For mozilla-aurora, that's "releases/l10n/mozilla-aurora" |
- L10N_REPO_PATH = "releases/l10n/mozilla-release" |
- # Currently this is assumed to be a subdirectory of your build dir |
- OBJDIR = "obj-android" |
- # Set this to mobile/xul for XUL Fennec |
- ANDROID_DIR = "mobile/android" |
- # Absolute path to your mozconfig. |
- # By default it looks at "./mozconfig" |
- MOZCONFIG = os.path.join(os.getcwd(), "mozconfig") |
- |
- config = { |
- "work_dir": ".", |
- "log_name": "multilocale", |
- "objdir": OBJDIR, |
- "locales_file": "%s/%s/locales/maemo-locales" % (BUILD_DIR, ANDROID_DIR), |
- "locales_dir": "%s/locales" % ANDROID_DIR, |
- "ignore_locales": ["en-US", "en-ZA", "multi"], |
- "l10n_repos": [{ |
- "repo": "https://hg.mozilla.org/build/compare-locales", |
- "tag": "RELEASE_AUTOMATION" |
- }], |
- "hg_l10n_base": "https://hg.mozilla.org/%s" % L10N_REPO_PATH, |
- "hg_l10n_tag": "FENNEC_45_0_2_RELEASE", |
- "l10n_dir": "l10n", |
- "merge_locales": True, |
- "mozilla_dir": BUILD_DIR, |
- "mozconfig": MOZCONFIG, |
- "default_actions": [ |
- "pull-locale-source", |
- "build", |
- "package-en-US", |
- "restore-objdir", |
- "add-locales", |
- "abb-transform-locales", |
- "package-multi", |
- "summary", |
- ], |
- } |
- |
-### Building ### |
- |
-For performing the multilocale build, invoke |
- |
- ./mozharness/scripts/multil10n.py --cfg abb-multi-cfg.py |
- |
-from inside `abb-multi`. The resulting build is located in |
-`BUILD_DIR/OBJ_DIR/dist/` |
+3. Run `./build.py build-and-sign` to generate a signed .apk |
[1]: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_for_Android_build |
-[2]: https://hg.adblockplus.org/adblockbrowser-build/ |
-[3]: https://issues.adblockplus.org/ticket/3047 |
+ |
+[2]: https://searchfox.org/mozilla-central/source/build/docs/locales.rst |