Skip to content

Commit db5d851

Browse files
authored
[Android] Add missing exported deps (#623)
* Add missing exported deps * Checking if pom test runs on linux_test.yaml * Export okhttp at replay and update pom_checker with expected libs * format
1 parent 7dce730 commit db5d851

File tree

3 files changed

+23
-17
lines changed

3 files changed

+23
-17
lines changed

platform/jvm/capture/BUILD.bazel

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ bitdrift_kt_android_library(
4545
artifact("androidx.core:core"),
4646
artifact("com.google.guava:listenablefuture"),
4747
artifact("com.google.flatbuffers:flatbuffers-java"),
48-
artifact("com.squareup.okhttp3:okhttp"),
4948
],
5049
deps = [
5150
":gen_sources",
@@ -57,7 +56,6 @@ bitdrift_kt_android_library(
5756
artifact("androidx.startup:startup-runtime"),
5857
artifact("androidx.core:core"),
5958
artifact("com.google.guava:listenablefuture"),
60-
artifact("com.squareup.okhttp3:okhttp"),
6159
artifact("com.google.code.findbugs:jsr305"),
6260
artifact("com.google.code.gson:gson"),
6361
artifact("com.google.flatbuffers:flatbuffers-java"),

platform/jvm/replay/BUILD.bazel

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ bitdrift_kt_android_library(
1313
plugins = ["//:jetpack_compose_compiler_plugin"],
1414
require_javadocs = True,
1515
visibility = ["//visibility:public"],
16+
exports = [
17+
artifact("androidx.appcompat:appcompat"),
18+
artifact("org.jetbrains.kotlin:kotlin-stdlib"),
19+
artifact("com.squareup.okhttp3:okhttp"),
20+
],
1621
deps = [
1722
"//platform/jvm/common:lib",
1823
artifact("androidx.appcompat:appcompat"),

test/platform/pom_checker/src/lib.rs

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,38 +19,41 @@ mod test {
1919

2020
#[test]
2121
fn check_pom_file() {
22-
let permitted_exports = vec![
23-
"androidx.activity:activity-compose",
22+
let required_deps = vec![
2423
"androidx.appcompat:appcompat",
25-
"androidx.compose.material:material",
26-
"androidx.compose.runtime:runtime",
27-
"androidx.compose.ui:ui-tooling",
28-
"androidx.compose.ui:ui",
2924
"androidx.core:core",
3025
"androidx.lifecycle:lifecycle-common",
3126
"androidx.lifecycle:lifecycle-process",
27+
"androidx.metrics:metrics-performance",
3228
"androidx.startup:startup-runtime",
3329
"com.google.code.gson:gson",
34-
"com.google.guava:listenablefuture",
3530
"com.google.flatbuffers:flatbuffers-java",
31+
"com.google.guava:listenablefuture",
32+
"com.google.protobuf:protobuf-kotlin-lite",
3633
"com.squareup.okhttp3:okhttp",
3734
"org.jetbrains.kotlin:kotlin-stdlib",
38-
"com.google.protobuf:protobuf-kotlin-lite",
39-
"androidx.metrics:metrics-performance",
4035
];
4136

4237
let root = simple_xml::from_file(runfiles_path("capture_aar_pom_xml.xml")).unwrap();
4338

4439
let deps = &root["dependencies"][0]["dependency"];
4540

46-
let permitted_exports = into_parts(&permitted_exports);
47-
for dep in deps {
48-
let group = dep["groupId"][0].content.clone();
49-
let artifact = dep["artifactId"][0].content.clone();
41+
let required_deps = into_parts(&required_deps);
42+
let present_deps: HashSet<(String, String)> = deps
43+
.iter()
44+
.map(|dep| {
45+
let group = dep["groupId"][0].content.clone();
46+
let artifact = dep["artifactId"][0].content.clone();
47+
(group, artifact)
48+
})
49+
.collect();
5050

51+
for required_dep in &required_deps {
5152
assert!(
52-
permitted_exports.contains(&(group.clone(), artifact.clone())),
53-
"unexpected .pom xml export {group}:{artifact}"
53+
present_deps.contains(required_dep),
54+
"missing required dependency {0}:{1}",
55+
required_dep.0,
56+
required_dep.1
5457
);
5558
}
5659
}

0 commit comments

Comments
 (0)