Skip to content

Commit 8af1b3a

Browse files
author
Tarik Eshaq
committed
Adds experiments to simple app
1 parent f074469 commit 8af1b3a

File tree

17 files changed

+101
-31
lines changed

17 files changed

+101
-31
lines changed

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import static org.gradle.api.tasks.testing.TestResult.ResultType
66

77
buildscript {
88
repositories {
9+
mavenLocal()
910
if (project.hasProperty("googleRepo")) {
1011
maven {
1112
name "Google"
@@ -48,6 +49,7 @@ plugins {
4849

4950
allprojects {
5051
repositories {
52+
mavenLocal()
5153
if (project.hasProperty("googleRepo")) {
5254
maven {
5355
name "Google"

buildSrc/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ plugins {
77
}
88

99
repositories {
10+
mavenLocal()
1011
jcenter()
1112
}
1213

buildSrc/src/main/java/Dependencies.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ object Versions {
2929

3030
const val mozilla_appservices = "61.0.7"
3131

32-
const val mozilla_glean = "31.2.3"
32+
const val mozilla_glean = "31.4.0-TESTING26"
3333

3434
const val material = "1.1.0"
3535
const val nearby = "17.0.0"

components/browser/engine-gecko-beta/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
buildscript {
66
repositories {
7+
mavenLocal()
78
maven {
89
url "https://maven.mozilla.org/maven2"
910
}

components/browser/engine-gecko-nightly/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
buildscript {
66
repositories {
7+
mavenLocal()
78
maven {
89
url "https://maven.mozilla.org/maven2"
910
}

components/browser/engine-gecko/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
buildscript {
66
repositories {
7+
mavenLocal()
78
maven {
89
url "https://maven.mozilla.org/maven2"
910
}

components/lib/crash/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
buildscript {
66
repositories {
7+
mavenLocal()
78
maven {
89
url "https://maven.mozilla.org/maven2"
910
}

components/service/glean/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ dependencies {
4646
implementation Dependencies.kotlin_stdlib
4747
implementation Dependencies.kotlin_coroutines
4848
implementation Dependencies.androidx_work_runtime
49-
50-
api GLEAN_LIBRARY
49+
api (GLEAN_LIBRARY) {
50+
exclude group: 'org.mozilla.components', module: 'concept-fetch'
51+
}
5152

5253
// So consumers can set a HTTP client.
5354
api project(':concept-fetch')
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package mozilla.components.service.glean
2+
3+
import kotlinx.coroutines.*
4+
import mozilla.telemetry.glean.Experiments as ExperimentsCore
5+
6+
object Experiments {
7+
private var inner: ExperimentsCore = ExperimentsCore
8+
private val job = SupervisorJob()
9+
private val scope = CoroutineScope(Dispatchers.IO) + job
10+
fun initialize(baseUrl: String, collectionName: String, bucketName: String, dbPath: String) {
11+
inner.initialize(baseUrl, collectionName, bucketName, dbPath)
12+
}
13+
fun getBranch(experimentName: String): String {
14+
return inner.getBranch(experimentName)
15+
}
16+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package mozilla.components.service.glean
2+
3+
4+
import mozilla.components.concept.fetch.Client
5+
import mozilla.telemetry.glean.RustHttpConfig as HttpConfig
6+
7+
/**
8+
* An object allowing configuring the HTTP client used by Rust code.
9+
*/
10+
object RustHttpConfig {
11+
12+
/**
13+
* Set the HTTP client to be used by all Rust code.
14+
*
15+
* The `Lazy`'s value is not read until the first request is made.
16+
*
17+
* This must be called
18+
* - after initializing a megazord for users using a custom megazord build.
19+
* - before any other calls into application-services rust code which make HTTP requests.
20+
*/
21+
fun setClient(c: Lazy<Client>) {
22+
HttpConfig.setClient(c)
23+
}
24+
}

0 commit comments

Comments
 (0)