blob: a3cf52ba3b0ac343c0678f8e5a994403afb17c73 [file] [log] [blame]
# Copyright 2021 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
load("@com_google_protobuf//:protobuf.bzl", "py_proto_library")
load("@rules_proto//proto:defs.bzl", "proto_library")
load(
"//pw_build:pigweed.bzl",
"pw_cc_library",
"pw_cc_test",
)
load("//pw_protobuf_compiler:proto.bzl", "pw_proto_library")
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
proto_library(
name = "tuf_proto",
srcs = [
"tuf.proto",
],
deps = [
"@com_google_protobuf//:timestamp_proto",
],
)
proto_library(
name = "update_bundle_proto",
srcs = [
"update_bundle.proto",
],
deps = [
":tuf_proto",
],
)
pw_proto_library(
name = "update_bundle_proto_cc",
deps = [":update_bundle_proto"],
)
proto_library(
name = "bundled_update_proto",
srcs = [
"bundled_update.proto",
],
deps = [
"//pw_protobuf:common_proto",
"//pw_tokenizer:tokenizer_proto",
"@com_google_protobuf//:any_proto",
],
)
# TODO(b/241456982): Not expected to build yet.
py_proto_library(
name = "bundled_update_py_pb2",
srcs = ["bundled_update.proto"],
)
pw_proto_library(
name = "bundled_update_proto_cc",
deps = [":bundled_update_proto"],
)
pw_cc_library(
name = "openable_reader",
hdrs = [
"public/pw_software_update/openable_reader.h",
],
deps = [
"//pw_stream",
],
)
pw_cc_library(
name = "blob_store_openable_reader",
hdrs = [
"public/pw_software_update/blob_store_openable_reader.h",
],
deps = [
":openable_reader",
],
)
pw_cc_library(
name = "update_bundle",
srcs = [
"manifest_accessor.cc",
"update_bundle_accessor.cc",
],
hdrs = [
"public/pw_software_update/bundled_update_backend.h",
"public/pw_software_update/config.h",
"public/pw_software_update/manifest_accessor.h",
"public/pw_software_update/update_bundle_accessor.h",
],
includes = ["public"],
deps = [
":blob_store_openable_reader",
":openable_reader",
":update_bundle_proto_cc.pwpb",
"//pw_blob_store",
"//pw_kvs",
"//pw_log",
"//pw_protobuf",
"//pw_status",
"//pw_stream",
"//pw_string",
],
)
pw_cc_library(
name = "bundled_update_service",
srcs = ["bundled_update_service.cc"],
hdrs = ["public/pw_software_update/bundled_update_service.h"],
includes = ["public"],
deps = [
":bundled_update_proto_cc.nanopb_rpc",
":bundled_update_proto_cc.pwpb",
":update_bundle",
":update_bundle_proto_cc.nanopb_rpc",
":update_bundle_proto_cc.pwpb",
"//pw_log",
"//pw_result",
"//pw_status",
"//pw_sync:borrow",
"//pw_sync:lock_annotations",
"//pw_sync:mutex",
"//pw_tokenizer",
"//pw_work_queue",
],
)
pw_cc_library(
name = "bundled_update_service_pwpb",
srcs = ["bundled_update_service_pwpb.cc"],
hdrs = ["public/pw_software_update/bundled_update_service_pwpb.h"],
includes = ["public"],
deps = [
":bundled_update_proto_cc.pwpb",
":bundled_update_proto_cc.pwpb_rpc",
":update_bundle",
":update_bundle_proto_cc.pwpb",
":update_bundle_proto_cc.pwpb_rpc",
"//pw_log",
"//pw_result",
"//pw_status",
"//pw_string:util",
"//pw_sync:borrow",
"//pw_sync:lock_annotations",
"//pw_sync:mutex",
"//pw_tokenizer",
"//pw_work_queue",
],
)
pw_cc_test(
name = "update_bundle_test",
srcs = ["update_bundle_test.cc"],
deps = [
":update_bundle",
"//pw_kvs:fake_flash_test_key_value_store",
"//pw_unit_test",
],
)
pw_cc_test(
name = "bundled_update_service_test",
srcs = ["bundled_update_service_test.cc"],
deps = [
":bundled_update_service",
"//pw_unit_test",
],
)
pw_cc_test(
name = "bundled_update_service_pwpb_test",
srcs = ["bundled_update_service_pwpb_test.cc"],
deps = [
":bundled_update_service_pwpb",
"//pw_unit_test",
],
)