Auto-publish & substitute local Glean package

Careful with this: If anything inside Glean Core changes this will still
require a local substitute for the Gecko build.
This commit is contained in:
Jan-Erik Rediger 2022-04-21 12:26:27 +02:00 committed by mergify[bot]
parent 89a1e6367f
commit 7bbee763a6
2 changed files with 21 additions and 0 deletions

View File

@ -804,6 +804,11 @@ if (gradle.hasProperty('localProperties.autoPublish.application-services.dir'))
apply from: "../${appServicesSrcDir}/build-scripts/substitute-local-appservices.gradle"
}
if (gradle.hasProperty('localProperties.autoPublish.glean.dir')) {
ext.gleanSrcDir = gradle."localProperties.autoPublish.glean.dir"
apply from: "../${gleanSrcDir}/build-scripts/substitute-local-glean.gradle"
}
// Define a reusable task for updating the versions of our built-in web extensions. We automate this
// to make sure we never forget to update the version, either in local development or for releases.
// In both cases, we want to make sure the latest version of all extensions (including their latest

View File

@ -27,6 +27,7 @@ def runCmd(cmd, workingDir, successMessage, captureStdout=true) {
Properties localProperties = null
String settingAppServicesPath = "autoPublish.application-services.dir"
String settingAndroidComponentsPath = "autoPublish.android-components.dir"
String settingGleanPath = "autoPublish.glean.dir"
if (file('local.properties').canRead()) {
localProperties = new Properties()
@ -71,4 +72,19 @@ if (localProperties != null) {
} else {
log("Disabled auto-publication of android-components. Enable it by settings '$settingAndroidComponentsPath' in local.properties")
}
String gleanLocalPath = localProperties.getProperty(settingGleanPath)
if (gleanLocalPath != null) {
log("Enabling automatic publication of Glean from: $gleanLocalPath")
// As above, hacks to execute .py files on Windows.
def publishGleanCmd = [];
if (System.properties['os.name'].toLowerCase().contains('windows')) {
publishGleanCmd << "py";
}
publishGleanCmd << "./build-scripts/publish_to_maven_local_if_modified.py";
runCmd(publishGleanCmd, gleanLocalPath, "Published Glean for local development.", false)
} else {
log("Disabled auto-publication of Glean. Enable it by settings '$settingGleanPath' in local.properties")
}
}