blob: 388401e292e32912cd8479dd6fe804f71bcc071d [file] [log] [blame]
Bob Evansbffba0e2020-12-04 22:15:42 +00001# Copyright 2020 The Fuchsia Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//build/rust/rustc_library.gni")
6import("//build/rust/rustc_test.gni")
7import("//build/testing/test_spec.gni")
8
9if (is_host) {
10 rustc_library("lib") {
11 name = "analytics"
12 version = "0.1.0"
Sarah Chan64bf58d2025-12-06 16:25:07 -080013 edition = "2024"
Bob Evansbffba0e2020-12-04 22:15:42 +000014 with_unit_tests = true
15
16 deps = [
David 'Digit' Turner93755d72025-08-11 13:16:48 -070017 "//src/lib/fuchsia-hyper",
Bob Evansbffba0e2020-12-04 22:15:42 +000018 "//third_party/rust_crates:anyhow",
Rundong Du0bd51e02025-10-07 00:38:39 -070019 "//third_party/rust_crates:cfg-if",
Bob Evansbffba0e2020-12-04 22:15:42 +000020 "//third_party/rust_crates:futures",
21 "//third_party/rust_crates:home",
22 "//third_party/rust_crates:hyper",
Miguel Flores Ruiz de Eguino275c6712025-01-06 10:26:45 -080023 "//third_party/rust_crates:log",
Bob Evans240aaac2024-07-22 19:18:43 +000024 "//third_party/rust_crates:nix",
Bob Evansc2773f72024-06-27 20:15:07 +000025 "//third_party/rust_crates:regex",
Bob Evansc7a0a1e2023-07-13 07:27:14 +000026 "//third_party/rust_crates:serde",
27 "//third_party/rust_crates:serde_json",
Bob Evansbffba0e2020-12-04 22:15:42 +000028 "//third_party/rust_crates:uuid",
29 ]
30
Rundong Du0bd51e02025-10-07 00:38:39 -070031 test_deps = [
32 "//src/lib/fuchsia-async",
Adam Perry204ffea2025-12-04 15:12:13 -080033 "//src/lib/fuchsia-sync",
Rundong Du0bd51e02025-10-07 00:38:39 -070034 "//third_party/rust_crates:tempfile",
35 "//third_party/rust_crates:url",
36 ]
Tamir Dubersteind02bfc82022-07-20 06:50:46 +000037
Bob Evansbffba0e2020-12-04 22:15:42 +000038 sources = [
Rundong Du0bd51e02025-10-07 00:38:39 -070039 "src/analytics_client.rs",
Bob Evansbffba0e2020-12-04 22:15:42 +000040 "src/env_info.rs",
Bob Evansdb9a4b72023-07-12 22:07:52 +000041 "src/ga4_event.rs",
Bob Evansc7a0a1e2023-07-13 07:27:14 +000042 "src/ga4_metrics_service.rs",
Bob Evansbffba0e2020-12-04 22:15:42 +000043 "src/lib.rs",
Bob Evansf771d722021-03-05 23:09:40 +000044 "src/metrics_state.rs",
Rundong Du0bd51e02025-10-07 00:38:39 -070045 "src/mock_https_client.rs",
Bob Evansbffba0e2020-12-04 22:15:42 +000046 "src/notice.rs",
Bob Evansbffba0e2020-12-04 22:15:42 +000047 ]
48 }
49}
50
51group("analytics") {
52 public_deps = [ ":lib($host_toolchain)" ]
53}
54
55group("tests") {
56 testonly = true
57 deps = [
58 ":lib($host_toolchain)",
59 ":lib_test($host_toolchain)",
60 ]
61}