Skip to content

Commit b343bf7

Browse files
authored
monorepo tweaks (#7107)
1 parent 565276f commit b343bf7

File tree

15 files changed

+46
-61
lines changed

15 files changed

+46
-61
lines changed

automation/tests.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,7 @@ def calc_steps(args):
445445
if args.mode == "changes":
446446
# changes mode is complicated enough that it's split off into its own
447447
# function
448-
for step in calc_steps_change_mode(args):
449-
yield step
448+
yield from calc_steps_change_mode(args)
450449
elif args.mode == "rust-tests":
451450
print_rust_environment()
452451
yield Step("cargo clean", cargo_clean)

build-scripts/component-common.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,17 @@ ext.configureUniFFIBindgen = { crateName ->
117117
// in moz-central we can use an `Exec` task because we can assume the bindgen tool has already been built.
118118
generateUniffiBindings = tasks.register("generateUniffiBindings", Exec) {
119119
def libraryPath = "${gradle.mozconfig.topobjdir}/dist/bin/libmegazord.so"
120-
def megazordNative = "${gradle.mozconfig.topobjdir}/dist/host/bin/embedded-uniffi-bindgen"
120+
def bindgen = gradle.ext.mozconfig.substs.EMBEDDED_UNIFFI_BINDGEN
121121

122122
workingDir project.rootDir
123-
commandLine "${gradle.mozconfig.topobjdir}/dist/host/bin/embedded-uniffi-bindgen"
123+
commandLine bindgen
124124
args 'generate', '--library', libraryPath, "--crate", crateName, '--language', 'kotlin', '--out-dir', uniffiOutDir.get(), '--no-format'
125125

126126
outputs.dir uniffiOutDir
127127
// Re-generate when the native megazord library is rebuilt
128-
inputs.files megazordNative
128+
inputs.files libraryPath
129129
// Re-generate if our uniffi-bindgen tooling changes.
130-
inputs.dir "${project.appServicesRootDir}/tools/embedded-uniffi-bindgen/"
130+
inputs.files bindgen
131131
}
132132
} else {
133133
// In app-services we can't use `Exec` because the megazord target isn't built yet, which we force via `doFirst`

components/ads-client/metrics.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,4 @@ ads_client:
124124
125125
126126
127-
expires: never
127+
expires: never

components/ads-client/src/http_cache/clock.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4+
15
pub trait Clock: Send + Sync + 'static {
26
fn now_epoch_seconds(&self) -> i64;
37
#[cfg(test)]

components/merino/uniffi.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ package_name = "mozilla.appservices.merino"
44
[bindings.swift]
55
ffi_module_name = "MozillaRustComponents"
66
ffi_module_filename = "merinoFFI"
7-
generate_codable_conformance = true
7+
generate_codable_conformance = true

components/support/nimbus-fml/moz.build

Lines changed: 0 additions & 19 deletions
This file was deleted.

components/viaduct/src/ohttp_client.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4+
15
use crate::ViaductError;
26
use parking_lot::Mutex;
37
use std::collections::HashMap;

examples/nimbus/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ error-support = { path = "../../components/support/error", features = ["testing"
1010
viaduct-hyper = { path = "../../components/support/viaduct-hyper" }
1111
clap = { version = "4.2", default-features = false, features = ["std", "derive"] }
1212
remote_settings = { path = "../../components/remote_settings" }
13-

settings.gradle

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,13 @@ def setupProject(name, projectProps, appServicesRootDir) {
6161

6262
def projectDir = new File(appServicesRootDir, path)
6363
// tooling-nimbus-gradle gets special treatment, it doesn't exist in the monorepo
64-
if (!projectDir.exists() && name != "tooling-nimbus-gradle") {
65-
throw new GradleException("Project directory does not exist: $projectDir (for project $name)")
64+
// (and should be removed entirely!)
65+
if (!projectDir.exists()) {
66+
if (name != "tooling-nimbus-gradle") {
67+
throw new GradleException("Project directory does not exist: $projectDir (for project $name)")
68+
}
69+
// gradle 9 gets upset if the dir doesn't exist, even if it's not actually used, like this isn't.
70+
projectDir = appServicesRootDir
6671
}
6772
project(":$name").projectDir = projectDir
6873

tools/embedded-uniffi-bindgen/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ authors = ["The Firefox Sync Developers <[email protected]>"]
55
edition = "2021"
66
license = "MPL-2.0"
77

8-
# A bin target needed when used in m-c.
98
[[bin]]
109
name = "embedded-uniffi-bindgen"
1110

0 commit comments

Comments
 (0)