Skip to content

Commit

Permalink
Bug 1825649 - Fix A-C nightly builds after adding shared settings.gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
csadilek authored and rvandermeulen committed Apr 4, 2023
1 parent 3600f06 commit 47b51a8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
11 changes: 0 additions & 11 deletions android-components/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,6 @@ buildCache {
}
}

gradle.projectsLoaded { ->
if (gradle.rootProject.hasProperty("nightlyVersion")) {
version = gradle.rootProject.nightlyVersion
} else if (gradle.rootProject.hasProperty("local")) {
// To support local auto-publication workflow, we use a version prefix we wouldn't normally encounter.
version = "0.0.1"
} else if (gradle.hasProperty("localProperties.branchBuild.android-components.version")) {
version = gradle.getProperty("localProperties.branchBuild.android-components.version")
}
}

def runCmd(cmd, workingDir, successMessage) {
def proc = cmd.execute(null, new File(workingDir))
proc.consumeProcessOutput(System.out, System.err)
Expand Down
12 changes: 11 additions & 1 deletion shared-settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,22 @@ buildconfig.projects.each { project ->
gradle.projectsLoaded { ->
def componentsVersion = new File(rootDir, '../version.txt').text.stripTrailing()
def configData = yaml.load(new File(rootDir, '../android-components/.config.yml').newInputStream())
String version = componentsVersion

if (gradle.rootProject.hasProperty("nightlyVersion")) {
version = gradle.rootProject.nightlyVersion
} else if (gradle.rootProject.hasProperty("local")) {
// To support local auto-publication workflow, we use a version prefix we wouldn't normally encounter.
version = "0.0.1"
} else if (gradle.hasProperty("localProperties.branchBuild.android-components.version")) {
version = gradle.getProperty("localProperties.branchBuild.android-components.version")
}

// Wait until root project is "loaded" before we set "config"
// Note that since this is set on "rootProject.ext", it will be "in scope" during the evaluation of all projects'
// gradle files. This means that they can just access "config.<value>", and it'll function properly
gradle.rootProject.ext.config = new Config(
componentsVersion,
version,
configData.componentsGroupId,
configData.compileSdkVersion,
configData.minSdkVersion,
Expand Down

0 comments on commit 47b51a8

Please sign in to comment.