Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Mozilla Android gradle-plugin

The gradle plugin, hosted on, is used to share build code across Mozilla's Android projects like Firefox for Fire TV.

Using the plugin

To use the plugin, you must first apply it and then configure specific tasks you want to run. To apply the plugin, use the legacy plugin application method.

In <project-root>/build.gradle:

buildscript {
  repositories {
    maven {
      url ""
  dependencies {
    classpath ""

In the module to use the plugin, e.g. <project-root>/app/build.gradle:

apply plugin: ""

Applying the plugin via the modern plugins DSL syntax is currently broken (#37).


The following tasks can be imported from (click the links for more details):

Repository injection

Application of this plugin to a project will inject shared Mozilla repositories. Currently injected repositories are:

  • appservices:

Adding a task to your project

After applying the plugin, you can apply a task, like ValidateAndroidAppReleaseConfiguration, by:


task taskName(type: ValidateAndroidAppReleaseConfiguration) {
    // Configure the task...

Developing the gradle-plugin

To work on the gradle-plugin, start by importing the android-automation-tools repository into Android Studio.

Developing the plugin against local repositories

Like the android components suggest, it's preferable to avoid depending on apps outside of the repository. Instead:

  • Write unit tests
  • Work against the sample app (TODO: add sample app :)

If you wish to develop against local repositories anyway, see below.

Set a version number

Append -SNAPSHOT to the end of the version number in this project's build.gradle.kts. If you don't, your imports may conflict with those from remote repositories and you can end up polluting your local maven cache.

Publish to your local maven repository

To publish the gradle plugin:

./gradlew gradle-plugin:publishToMavenLocal

Import your local plugin changes into the local repository

In the top level gradle file, you have to add the dependencies (using your own version number):

buildscript {
    repositories {

    dependencies {
        classpath ""

apply plugin:

And again in buildSrc/build.gradle:

repositories {

dependencies {

If your project applies the plugin from a remote maven repository, be sure to remove that application.

Publishing to

To publish the plugin to the gradle plugin portal, first create credentials. After making your changes and bumping the version, run the following from the root directory:

./gradlew gradle-plugin:publishPlugins
You can’t perform that action at this time.