• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2021 The Pigweed Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4# use this file except in compliance with the License. You may obtain a copy of
5# the License at
6#
7#     https://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations under
13# the License.
14
15load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
16load("@npm//@bazel/typescript:index.bzl", "ts_library", "ts_project")
17load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
18load("//pw_protobuf_compiler/ts:ts_proto_collection.bzl", "ts_proto_collection")
19
20package(default_visibility = ["//visibility:public"])
21
22ts_proto_collection(
23    name = "transfer_proto_collection",
24    js_proto_library = "@//pw_transfer:transfer_proto_tspb",
25    proto_library = "@//pw_transfer:transfer_proto",
26)
27
28ts_project(
29    name = "lib",
30    srcs = [
31        "client.ts",
32        "transfer.ts",
33    ],
34    declaration = True,
35    source_map = True,
36    deps = [
37        "//pw_rpc/ts:pw_rpc",
38        "//pw_status/ts:pw_status",
39        "//pw_transfer:transfer_proto_tspb",
40        "@npm//:node_modules",  # can't use fine-grained deps
41    ],
42)
43
44js_library(
45    name = "pw_transfer",
46    package_name = "@pigweed/pw_transfer",
47    srcs = ["package.json"],
48    deps = [
49        ":lib",
50    ],
51)
52
53ts_library(
54    name = "test_lib",
55    srcs = [
56        "transfer_test.ts",
57    ],
58    deps = [
59        ":lib",
60        ":transfer_proto_collection",
61        "//pw_rpc/ts:lib",
62        "//pw_rpc/ts:packet_proto_tspb",
63        "//pw_status/ts:pw_status",
64        "//pw_transfer:transfer_proto_tspb",
65        "@npm//@types/jasmine",
66    ],
67)
68
69jasmine_node_test(
70    name = "test",
71    srcs = [
72        ":test_lib",
73    ],
74)
75