1# Copyright 2020 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 15package(default_visibility = ["//visibility:public"]) 16 17load("@npm//@bazel/typescript:index.bzl", "ts_library") 18load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test") 19load("//pw_web_ui:web_bundle.bzl", "web_bundle") 20load("@npm//@bazel/karma:index.bzl", "karma_web_test") 21 22ts_library( 23 name = "device_transport_lib", 24 srcs = [ 25 "device_transport.ts", 26 ], 27 deps = [ 28 "@npm//rxjs", 29 ], 30) 31 32ts_library( 33 name = "serial_mock_lib", 34 srcs = [ 35 "serial_mock.ts", 36 ], 37 deps = [ 38 "//pw_web_ui/types:serial_lib", 39 "@npm//jasmine", 40 "@npm//@types/jasmine", 41 "@npm//rxjs", 42 ], 43) 44 45ts_library( 46 name = "web_serial_transport_lib", 47 srcs = [ 48 "web_serial_transport.ts", 49 ], 50 deps = [ 51 ":device_transport_lib", 52 "//pw_web_ui/types:serial_lib", 53 "@npm//rxjs", 54 ], 55) 56 57ts_library( 58 name = "web_serial_transport_lib_test", 59 srcs = [ 60 "web_serial_transport_test.ts", 61 ], 62 deps = [ 63 ":serial_mock_lib", 64 ":web_serial_transport_lib", 65 "@npm//jasmine", 66 "@npm//@types/jasmine", 67 "@npm//rxjs", 68 ], 69) 70 71web_bundle( 72 name = "web_serial_transport_lib_test_bundle", 73 deps = [ 74 ":web_serial_transport_lib_test", 75 ], 76 entry_point = "web_serial_transport_test.ts", 77) 78 79 80karma_web_test( 81 name = "web_test", 82 srcs = [ 83 ":web_serial_transport_lib_test_bundle" 84 ], 85) 86