Skip to content

Commit

Permalink
Auto-publish & substitute local Glean package
Browse files Browse the repository at this point in the history
Careful with this: If anything inside Glean Core changes this will still
require a local substitute for the Gecko build.
  • Loading branch information
badboy authored and mergify[bot] committed May 5, 2022
1 parent 89a1e63 commit 7bbee76
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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")
}
}

0 comments on commit 7bbee76

Please sign in to comment.