-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add appServicesRootDir attribute gradle should generally use instead … #6530
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,13 @@ | |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
import org.yaml.snakeyaml.Yaml | ||
|
||
includeBuild('tools/nimbus-gradle-plugin') { | ||
// We prefer `appServicesRootDir` over `rootDir` to help us on the path to the monorepo. | ||
// (They are the same in app-services but different in moz-central) | ||
def maybeAppServicesRootDir = new File(rootDir, "services/app-services") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some of this probably highlights my poor groovy/gradle skills, but I couldn't work out a sane way to share this variable both out and inside |
||
def appServicesRootDir = maybeAppServicesRootDir.isDirectory() ? maybeAppServicesRootDir : rootDir; | ||
|
||
|
||
includeBuild("$appServicesRootDir/tools/nimbus-gradle-plugin") { | ||
dependencySubstitution { | ||
substitute module("org.mozilla.appservices:tooling-nimbus-gradle") using(project(':')) | ||
} | ||
|
@@ -20,7 +26,7 @@ buildscript { | |
|
||
rootProject.name = "appservices" | ||
|
||
def setupProject(name, projectProps) { | ||
def setupProject(name, projectProps, appServicesRootDir) { | ||
def path = projectProps.path | ||
def description = projectProps.description | ||
def artifactId = projectProps.artifactId | ||
|
@@ -32,7 +38,7 @@ def setupProject(name, projectProps) { | |
|
||
settings.include(":$name") | ||
|
||
project(":$name").projectDir = new File(rootDir, path) | ||
project(":$name").projectDir = new File(appServicesRootDir, path) | ||
|
||
// project(...) gives us a skeleton project that we can't set ext.* on | ||
gradle.beforeProject { project -> | ||
|
@@ -43,14 +49,15 @@ def setupProject(name, projectProps) { | |
project.ext.artifactId = artifactId | ||
// Expose the rest of the project properties, mostly for validation reasons. | ||
project.ext.configProps = projectProps | ||
project.ext.appServicesRootDir = appServicesRootDir | ||
} | ||
} | ||
} | ||
|
||
def yaml = new Yaml() | ||
def buildconfig = yaml.load(new File(rootDir, '.buildconfig-android.yml').newInputStream()) | ||
def buildconfig = yaml.load(new File(appServicesRootDir, '.buildconfig-android.yml').newInputStream()) | ||
buildconfig.projects.each { project -> | ||
setupProject(project.key, project.value) | ||
setupProject(project.key, project.value, appServicesRootDir) | ||
} | ||
|
||
Properties localProperties = new Properties(); | ||
|
@@ -66,14 +73,20 @@ if (file('local.properties').canRead()) { | |
|
||
def calcVersion(buildconfig) { | ||
def local = gradle.rootProject.findProperty("local") | ||
def version = new File(rootDir, 'version.txt').getText().trim() | ||
|
||
if (gradle.rootProject.hasProperty("nightlyVersion")) { | ||
if (gradle.hasProperty("mozconfig")) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Get something sane from a build in m-c - not clear how (or even if) we need a dedicated version string once landed. |
||
// We are in m-c - XXX - not clear what we want for version info once in m-c, but this seems sane for now? | ||
def buildid = file("${gradle.mozconfig.topobjdir}/buildid.h").getText('utf-8').split()[2] | ||
return "${gradle.mozconfig.substs.MOZ_APP_VERSION}-${buildid}" | ||
} else if (gradle.rootProject.hasProperty("nightlyVersion")) { | ||
// We are in app-services but building a "nightly" version to be consumed by Fenix. | ||
return gradle.rootProject.nightlyVersion | ||
} else if(local) { | ||
// We are doing a local publish | ||
return '0.0.1-SNAPSHOT' | ||
} else { | ||
return version | ||
// A normal build from app-services. | ||
return new File(rootDir, 'version.txt').getText().trim() | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
places no longer needs protobuf.