HTTPS SSH

Adblock Browser

The Adblock Plus browser, based on Firefox for Android.

Building

First ensure that all dependencies are up to date by calling:

./ensure_dependencies.py

Then just follow Mozilla's Building Fennec guide.

Important note

You must add the following line to your mozconfig:

ac_add_options --disable-crashreporter

to disable the CrashReporter.

(Follow-up issue: https://issues.adblockplus.org/ticket/2490)

Creating a multilocale build

Automation

While the manual process is still documented below, the easiest way to create a multi-locale build is to use: https://bitbucket.org/adblockplus/adblockbrowser-build.

Preparations

  1. Create a folder outside of the Adblock Browser repo, e.g abb-multi
  2. Change into abb-multi and clone mozharness via:

    hg clone ssh://hg@bitbucket.org/adblockplus/mozharness -r adblockbrowser
    
  3. Symlink the adblockbrowser repo into abb-multi, e.g.:

    ln -s ../adblockbrowser adblockbrowser
    
  4. Copy your mozconfig from adblockbrowser to abb-multi, e.g.:

    cp adblockbrowser/mozconfig ./mozconfig
    
  5. Create a copy of the build configuration, e.g.:

    cp mozharness/configs/multi_locale/standalone_mozilla-central.py abb-multi-cfg.py
    

Configuration

Apply the following changes to abb-multi-cfg.py:

  • 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:

    "repos": [{
        "repo": "https://hg.mozilla.org/%s" % REPO_PATH,
        "tag": "default",
        "dest": BUILD_DIR,
    }],
    
  • Change "hg_l10n_tag" in config from default to FENNEC_40_0_RELEASE

  • Issue #3047 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", "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_40_0_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/