Replacing the Glean Gradle plugin in mozilla-central
Note: If you only need to replace the
glean_parserPython parts used in the build see Substitutingglean_parser. The approached documented in this chapter is only necessary if you changedGleanGradlePlugin.groovy.
If you need to replace the Glean Gradle Plugin used by any component in mozilla-central, follow these steps:
-
In your Glean repository increment the version number in
.buildconfig.ymlto something unused:libraryVersion: 99.0.0 -
Build the Glean Gradle plugin and publish the plugin locally:
./gradlew glean-gradle-plugin:publishToMavenLocal -
In your
mozilla-centralcheckout, give the plugin its own version ingradle/libs.versions.toml. Keep thegleanversion unchanged, so the Glean library and theverifyGleanVersioncheck are unaffected:mozilla-glean-gradle-plugin = { module = "org.mozilla.telemetry:glean-gradle-plugin", version = "99.0.0" } -
Create a Gradle init script, for example
mavenlocal.gradleoutside the checkout, that addsmavenLocal()to the repositories every build script loads its plugins from:allprojects { buildscript { repositories { mavenLocal() } } } -
Build Fenix with the init script:
./mach gradle --init-script /path/to/mavenlocal.gradle buildEnvironment fenix:assembleDebugThe
buildEnvironmentoutput lists the plugin version in use.
Building Fenix will now use your locally published Glean Gradle Plugin.