Wyatt Hepler | 1e63673 | 2021-06-14 18:30:13 -0700 | [diff] [blame] | 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 | |
| 15 | import("//build_overrides/pigweed.gni") |
| 16 | |
| 17 | import("$dir_pw_docgen/docs.gni") |
| 18 | import("$dir_pw_protobuf_compiler/proto.gni") |
| 19 | import("$dir_pw_unit_test/test.gni") |
| 20 | |
Wyatt Hepler | 610f062 | 2021-06-15 14:47:33 -0700 | [diff] [blame] | 21 | config("public_include_path") { |
| 22 | include_dirs = [ "public" ] |
| 23 | visibility = [ ":*" ] |
| 24 | } |
| 25 | |
| 26 | pw_source_set("pw_transfer") { |
Wyatt Hepler | 610f062 | 2021-06-15 14:47:33 -0700 | [diff] [blame] | 27 | public_configs = [ ":public_include_path" ] |
| 28 | public_deps = [ |
Alexei Frolov | f93cb26 | 2021-07-14 16:05:15 -0700 | [diff] [blame] | 29 | ":proto.raw_rpc", |
Wyatt Hepler | 610f062 | 2021-06-15 14:47:33 -0700 | [diff] [blame] | 30 | "$dir_pw_containers:intrusive_list", |
| 31 | dir_pw_assert, |
Alexei Frolov | f93cb26 | 2021-07-14 16:05:15 -0700 | [diff] [blame] | 32 | dir_pw_bytes, |
| 33 | dir_pw_result, |
Wyatt Hepler | 610f062 | 2021-06-15 14:47:33 -0700 | [diff] [blame] | 34 | dir_pw_status, |
| 35 | dir_pw_stream, |
| 36 | ] |
Alexei Frolov | f93cb26 | 2021-07-14 16:05:15 -0700 | [diff] [blame] | 37 | deps = [ |
| 38 | ":proto.pwpb", |
| 39 | dir_pw_log, |
Alexei Frolov | 563946f | 2021-08-05 18:58:48 -0700 | [diff] [blame] | 40 | dir_pw_varint, |
Alexei Frolov | f93cb26 | 2021-07-14 16:05:15 -0700 | [diff] [blame] | 41 | ] |
| 42 | public = [ |
| 43 | "public/pw_transfer/handler.h", |
| 44 | "public/pw_transfer/transfer.h", |
| 45 | ] |
| 46 | sources = [ |
| 47 | "chunk.cc", |
Alexei Frolov | 563946f | 2021-08-05 18:58:48 -0700 | [diff] [blame] | 48 | "context.cc", |
| 49 | "public/pw_transfer/internal/context.h", |
Alexei Frolov | f93cb26 | 2021-07-14 16:05:15 -0700 | [diff] [blame] | 50 | "pw_transfer_private/chunk.h", |
| 51 | "transfer.cc", |
| 52 | ] |
| 53 | friend = [ ":*" ] |
Wyatt Hepler | 610f062 | 2021-06-15 14:47:33 -0700 | [diff] [blame] | 54 | } |
| 55 | |
Wyatt Hepler | 1e63673 | 2021-06-14 18:30:13 -0700 | [diff] [blame] | 56 | pw_proto_library("proto") { |
| 57 | sources = [ "transfer.proto" ] |
Alexei Frolov | 0c94fc2 | 2021-07-08 16:05:24 -0700 | [diff] [blame] | 58 | python_package = "py" |
| 59 | prefix = "pw_transfer" |
Wyatt Hepler | 1e63673 | 2021-06-14 18:30:13 -0700 | [diff] [blame] | 60 | } |
| 61 | |
| 62 | pw_test_group("tests") { |
Alexei Frolov | f93cb26 | 2021-07-14 16:05:15 -0700 | [diff] [blame] | 63 | tests = [ |
| 64 | ":handler_test", |
| 65 | ":transfer_test", |
| 66 | ] |
Wyatt Hepler | 610f062 | 2021-06-15 14:47:33 -0700 | [diff] [blame] | 67 | } |
| 68 | |
| 69 | pw_test("handler_test") { |
| 70 | sources = [ "handler_test.cc" ] |
| 71 | deps = [ ":pw_transfer" ] |
Wyatt Hepler | 1e63673 | 2021-06-14 18:30:13 -0700 | [diff] [blame] | 72 | } |
| 73 | |
Alexei Frolov | f93cb26 | 2021-07-14 16:05:15 -0700 | [diff] [blame] | 74 | pw_test("transfer_test") { |
| 75 | sources = [ "transfer_test.cc" ] |
| 76 | deps = [ |
| 77 | ":proto.pwpb", |
| 78 | ":pw_transfer", |
| 79 | "$dir_pw_rpc/raw:test_method_context", |
| 80 | ] |
| 81 | } |
| 82 | |
Wyatt Hepler | 1e63673 | 2021-06-14 18:30:13 -0700 | [diff] [blame] | 83 | pw_doc_group("docs") { |
| 84 | sources = [ "docs.rst" ] |
| 85 | inputs = [ "transfer.proto" ] |
| 86 | } |
Wyatt Hepler | 2253040 | 2021-07-30 23:40:40 -0700 | [diff] [blame] | 87 | |
| 88 | pw_executable("test_rpc_server") { |
| 89 | sources = [ "test_rpc_server.cc" ] |
| 90 | deps = [ |
| 91 | ":pw_transfer", |
| 92 | "$dir_pw_rpc/system_server", |
| 93 | "$dir_pw_rpc/system_server:socket", |
| 94 | dir_pw_log, |
| 95 | ] |
| 96 | } |