| Bob Evans | bffba0e | 2020-12-04 22:15:42 +0000 | [diff] [blame] | 1 | # 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 | |
| 5 | import("//build/rust/rustc_library.gni") |
| 6 | import("//build/rust/rustc_test.gni") |
| 7 | import("//build/testing/test_spec.gni") |
| 8 | |
| 9 | if (is_host) { |
| 10 | rustc_library("lib") { |
| 11 | name = "analytics" |
| 12 | version = "0.1.0" |
| Sarah Chan | 64bf58d | 2025-12-06 16:25:07 -0800 | [diff] [blame] | 13 | edition = "2024" |
| Bob Evans | bffba0e | 2020-12-04 22:15:42 +0000 | [diff] [blame] | 14 | with_unit_tests = true |
| 15 | |
| 16 | deps = [ |
| David 'Digit' Turner | 93755d7 | 2025-08-11 13:16:48 -0700 | [diff] [blame] | 17 | "//src/lib/fuchsia-hyper", |
| Bob Evans | bffba0e | 2020-12-04 22:15:42 +0000 | [diff] [blame] | 18 | "//third_party/rust_crates:anyhow", |
| Rundong Du | 0bd51e0 | 2025-10-07 00:38:39 -0700 | [diff] [blame] | 19 | "//third_party/rust_crates:cfg-if", |
| Bob Evans | bffba0e | 2020-12-04 22:15:42 +0000 | [diff] [blame] | 20 | "//third_party/rust_crates:futures", |
| 21 | "//third_party/rust_crates:home", |
| 22 | "//third_party/rust_crates:hyper", |
| Miguel Flores Ruiz de Eguino | 275c671 | 2025-01-06 10:26:45 -0800 | [diff] [blame] | 23 | "//third_party/rust_crates:log", |
| Bob Evans | 240aaac | 2024-07-22 19:18:43 +0000 | [diff] [blame] | 24 | "//third_party/rust_crates:nix", |
| Bob Evans | c2773f7 | 2024-06-27 20:15:07 +0000 | [diff] [blame] | 25 | "//third_party/rust_crates:regex", |
| Bob Evans | c7a0a1e | 2023-07-13 07:27:14 +0000 | [diff] [blame] | 26 | "//third_party/rust_crates:serde", |
| 27 | "//third_party/rust_crates:serde_json", |
| Bob Evans | bffba0e | 2020-12-04 22:15:42 +0000 | [diff] [blame] | 28 | "//third_party/rust_crates:uuid", |
| 29 | ] |
| 30 | |
| Rundong Du | 0bd51e0 | 2025-10-07 00:38:39 -0700 | [diff] [blame] | 31 | test_deps = [ |
| 32 | "//src/lib/fuchsia-async", |
| Adam Perry | 204ffea | 2025-12-04 15:12:13 -0800 | [diff] [blame] | 33 | "//src/lib/fuchsia-sync", |
| Rundong Du | 0bd51e0 | 2025-10-07 00:38:39 -0700 | [diff] [blame] | 34 | "//third_party/rust_crates:tempfile", |
| 35 | "//third_party/rust_crates:url", |
| 36 | ] |
| Tamir Duberstein | d02bfc8 | 2022-07-20 06:50:46 +0000 | [diff] [blame] | 37 | |
| Bob Evans | bffba0e | 2020-12-04 22:15:42 +0000 | [diff] [blame] | 38 | sources = [ |
| Rundong Du | 0bd51e0 | 2025-10-07 00:38:39 -0700 | [diff] [blame] | 39 | "src/analytics_client.rs", |
| Bob Evans | bffba0e | 2020-12-04 22:15:42 +0000 | [diff] [blame] | 40 | "src/env_info.rs", |
| Bob Evans | db9a4b7 | 2023-07-12 22:07:52 +0000 | [diff] [blame] | 41 | "src/ga4_event.rs", |
| Bob Evans | c7a0a1e | 2023-07-13 07:27:14 +0000 | [diff] [blame] | 42 | "src/ga4_metrics_service.rs", |
| Bob Evans | bffba0e | 2020-12-04 22:15:42 +0000 | [diff] [blame] | 43 | "src/lib.rs", |
| Bob Evans | f771d72 | 2021-03-05 23:09:40 +0000 | [diff] [blame] | 44 | "src/metrics_state.rs", |
| Rundong Du | 0bd51e0 | 2025-10-07 00:38:39 -0700 | [diff] [blame] | 45 | "src/mock_https_client.rs", |
| Bob Evans | bffba0e | 2020-12-04 22:15:42 +0000 | [diff] [blame] | 46 | "src/notice.rs", |
| Bob Evans | bffba0e | 2020-12-04 22:15:42 +0000 | [diff] [blame] | 47 | ] |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | group("analytics") { |
| 52 | public_deps = [ ":lib($host_toolchain)" ] |
| 53 | } |
| 54 | |
| 55 | group("tests") { |
| 56 | testonly = true |
| 57 | deps = [ |
| 58 | ":lib($host_toolchain)", |
| 59 | ":lib_test($host_toolchain)", |
| 60 | ] |
| 61 | } |