| OLD | NEW |
| 1 Adblock Browser | 1 # Adblock Browser |
| 2 =============== | |
| 3 | 2 |
| 4 The Adblock Plus browser, based on Firefox for Android. | 3 The Adblock Plus browser, based on Firefox for Android. |
| 5 | 4 |
| 6 Building | 5 ## Simple build |
| 7 -------- | |
| 8 | 6 |
| 9 First ensure that all dependencies are up to date by calling: | 7 To generate a simple single-locale build, first ensure that all dependencies are
up to date by calling: |
| 10 | 8 |
| 11 ./ensure_dependencies.py | 9 ``` |
| 10 ./ensure_dependencies.py |
| 11 ``` |
| 12 | 12 |
| 13 Then just follow Mozilla's [Firefox for Android build instructions][1]. | 13 Then just follow Mozilla's [Simple Firefox for Android build][1]. |
| 14 | 14 |
| 15 ## Multi-locale build |
| 15 | 16 |
| 16 Creating a multilocale build | 17 While the manual process can be followed in Mozilla's [Instructions for multi-lo
cale builds][2], the easiest way to create multi-locale builds is to follow the
following Instructions: |
| 17 ---------------------------- | |
| 18 | 18 |
| 19 ### Automation ### | 19 ### Configuration |
| 20 | 20 |
| 21 While the manual process is still documented below, the easiest way to create a | 21 All the configuration resources required to generate multi-locale builds are loc
ated inside the `abb-build` folder. For most cases, you only will need to edit o
ne file. |
| 22 multi-locale build is to use [adblockbrowser-build][2]. | |
| 23 | 22 |
| 24 ### Preparations ### | 23 1. Make a copy of `config.py.sample` and rename it to `config.py` |
| 25 | 24 |
| 26 1. Create a folder outside of the Adblock Browser repo, e.g `abb-multi` | 25 2. Inside the `config.py` file, edit `ANDROID_SDK_PATH` to point to your Android
SDK path |
| 27 2. Change into `abb-multi` and clone mozharness via: | |
| 28 | 26 |
| 29 hg clone ssh://hg@bitbucket.org/adblockplus/mozharness -r adblockbrowser | 27 3. Edit `ANDROID_NDK_PATH` to point to your Android NDK path |
| 30 | 28 |
| 31 3. Symlink the adblockbrowser repo into `abb-multi`, e.g.: | 29 4. If you intend to sign the .apk, edit `ANDROID_KEYSTORE_PATH` to point to your
keystore path |
| 32 | 30 |
| 33 ln -s ../adblockbrowser adblockbrowser | 31 5. Also if you intend to sign the .apk, edit `ANDROID_KEY_NAME` to reflect your
keystore name / alias |
| 34 | 32 |
| 35 4. Copy your `mozconfig` from `adblockbrowser` to `abb-multi`, e.g.: | 33 6. Edit `ARCHITECTURE` for the desired architecture. Currently available options
are `arm` and `x86` |
| 36 | 34 |
| 37 cp adblockbrowser/mozconfig ./mozconfig | 35 7. Edit `DISTRIBUTION_MODE` for the desired distribution mode. Currently availab
le options are `standalone` and `store` |
| 38 | 36 |
| 39 5. Create a copy of the build configuration, e.g.: | 37 8. Edit `BUILD_MODE` for the desired build mode. Currently available options are
`devbuild` and `release` |
| 40 | 38 |
| 41 cp mozharness/configs/multi_locale/standalone_mozilla-central.py abb-mul
ti-cfg.py | 39 9. Optionally, edit the `mozconfig-custom` file if you want to add any custom bu
ild configuration |
| 42 | 40 |
| 43 ### Configuration ### | 41 ### Building and signing |
| 44 | 42 |
| 45 Apply the following changes to `abb-multi-cfg.py`: | 43 There are 3 ways of running the `build.py` script: |
| 46 | 44 |
| 47 * Change `BUILD_DIR = "mozilla-central"` to `BUILD_DIR = "adblockbrowser"` | 45 1. Run `./build.py build` To generate an unsigned .apk. |
| 48 * Make sure `OBJDIR = "objdir-droid"` matches your build output | |
| 49 folder | |
| 50 * Change `L10N_REPO_PATH` to point to `releases/l10n/mozilla-release` | |
| 51 * If your `mozconfig` is not called `mozconfig`, change `MOZCONFIG` | |
| 52 * **Remove the repository pulling part** from `config`. | |
| 53 The code to remove looks like this: | |
| 54 | 46 |
| 55 "repos": [{ | 47 2. Run `./build.py sign /path/to/apk` to sign an existing .apk |
| 56 "repo": "https://hg.mozilla.org/%s" % REPO_PATH, | |
| 57 "tag": "default", | |
| 58 "dest": BUILD_DIR, | |
| 59 }], | |
| 60 | 48 |
| 61 * Change `"hg_l10n_tag"` in `config` from `default` to `FENNEC_45_0_2_RELEASE` | 49 3. Run `./build.py build-and-sign` to generate a signed .apk |
| 62 * Add `en-ZA` to `ignore_locales` since it isn't currently supported | |
| 63 * [Issue #3047][3] introduced a custom build step named `abb-transform-locales` | |
| 64 for manipulating search engine availability and order. This must be inserted | |
| 65 into `default_actions` right before `package-multi` | |
| 66 * You might want to remove the `"backup-objdir"` build step if you do | |
| 67 not want your objdir to be backed up. Keep in mind that you then need to | |
| 68 clobber for a single-locale build. | |
| 69 | |
| 70 An example configuration could look like this: | |
| 71 | |
| 72 import os | |
| 73 # The name of the directory we'll pull our source into. | |
| 74 BUILD_DIR = "adblockbrowser" | |
| 75 # This is everything that comes after https://hg.mozilla.org/ | |
| 76 # e.g. "releases/mozilla-aurora" | |
| 77 REPO_PATH = "mozilla-central" | |
| 78 # This is where the l10n repos are (everything after https://hg.mozilla.org/
) | |
| 79 # for mozilla-central, that's "l10n-central". | |
| 80 # For mozilla-aurora, that's "releases/l10n/mozilla-aurora" | |
| 81 L10N_REPO_PATH = "releases/l10n/mozilla-release" | |
| 82 # Currently this is assumed to be a subdirectory of your build dir | |
| 83 OBJDIR = "obj-android" | |
| 84 # Set this to mobile/xul for XUL Fennec | |
| 85 ANDROID_DIR = "mobile/android" | |
| 86 # Absolute path to your mozconfig. | |
| 87 # By default it looks at "./mozconfig" | |
| 88 MOZCONFIG = os.path.join(os.getcwd(), "mozconfig") | |
| 89 | |
| 90 config = { | |
| 91 "work_dir": ".", | |
| 92 "log_name": "multilocale", | |
| 93 "objdir": OBJDIR, | |
| 94 "locales_file": "%s/%s/locales/maemo-locales" % (BUILD_DIR, ANDROID_DIR)
, | |
| 95 "locales_dir": "%s/locales" % ANDROID_DIR, | |
| 96 "ignore_locales": ["en-US", "en-ZA", "multi"], | |
| 97 "l10n_repos": [{ | |
| 98 "repo": "https://hg.mozilla.org/build/compare-locales", | |
| 99 "tag": "RELEASE_AUTOMATION" | |
| 100 }], | |
| 101 "hg_l10n_base": "https://hg.mozilla.org/%s" % L10N_REPO_PATH, | |
| 102 "hg_l10n_tag": "FENNEC_45_0_2_RELEASE", | |
| 103 "l10n_dir": "l10n", | |
| 104 "merge_locales": True, | |
| 105 "mozilla_dir": BUILD_DIR, | |
| 106 "mozconfig": MOZCONFIG, | |
| 107 "default_actions": [ | |
| 108 "pull-locale-source", | |
| 109 "build", | |
| 110 "package-en-US", | |
| 111 "restore-objdir", | |
| 112 "add-locales", | |
| 113 "abb-transform-locales", | |
| 114 "package-multi", | |
| 115 "summary", | |
| 116 ], | |
| 117 } | |
| 118 | |
| 119 ### Building ### | |
| 120 | |
| 121 For performing the multilocale build, invoke | |
| 122 | |
| 123 ./mozharness/scripts/multil10n.py --cfg abb-multi-cfg.py | |
| 124 | |
| 125 from inside `abb-multi`. The resulting build is located in | |
| 126 `BUILD_DIR/OBJ_DIR/dist/` | |
| 127 | 50 |
| 128 [1]: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Inst
ructions/Simple_Firefox_for_Android_build | 51 [1]: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Inst
ructions/Simple_Firefox_for_Android_build |
| 129 [2]: https://hg.adblockplus.org/adblockbrowser-build/ | 52 |
| 130 [3]: https://issues.adblockplus.org/ticket/3047 | 53 [2]: https://searchfox.org/mozilla-central/source/build/docs/locales.rst |
| OLD | NEW |