Andrew Scull | 98837ec | 2017-09-14 14:18:35 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2017 The Android Open Source Project |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | // |
| 16 | |
| 17 | genrule { |
| 18 | name: "nos_generator_test_service_genc++", |
| 19 | out: ["Hello.client.cpp"], |
Andrew Scull | af221e3 | 2017-10-12 13:00:53 +0100 | [diff] [blame] | 20 | srcs: ["nos/generator/test/test.proto"], |
Andrew Scull | 98837ec | 2017-09-14 14:18:35 +0100 | [diff] [blame] | 21 | tools: ["aprotoc", "protoc-gen-nos-client-cpp"], |
Andrew Scull | 304ad12 | 2017-11-10 17:01:41 +0000 | [diff] [blame] | 22 | cmd: GEN_SERVICE_SOURCE + "-Iexternal/nos/host/generic/libnos/generator/test", |
Andrew Scull | 98837ec | 2017-09-14 14:18:35 +0100 | [diff] [blame] | 23 | } |
| 24 | |
| 25 | genrule { |
| 26 | name: "nos_generator_test_service_genc++_headers", |
| 27 | out: ["Hello.client.h"], |
Andrew Scull | af221e3 | 2017-10-12 13:00:53 +0100 | [diff] [blame] | 28 | srcs: ["nos/generator/test/test.proto"], |
Andrew Scull | 98837ec | 2017-09-14 14:18:35 +0100 | [diff] [blame] | 29 | tools: ["aprotoc", "protoc-gen-nos-client-cpp"], |
Andrew Scull | 304ad12 | 2017-11-10 17:01:41 +0000 | [diff] [blame] | 30 | cmd: GEN_SERVICE_HEADER + "-Iexternal/nos/host/generic/libnos/generator/test", |
Andrew Scull | 98837ec | 2017-09-14 14:18:35 +0100 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | genrule { |
| 34 | name: "nos_generator_test_service_genc++_mock", |
| 35 | out: ["MockHello.client.h"], |
Andrew Scull | af221e3 | 2017-10-12 13:00:53 +0100 | [diff] [blame] | 36 | srcs: ["nos/generator/test/test.proto"], |
Andrew Scull | 98837ec | 2017-09-14 14:18:35 +0100 | [diff] [blame] | 37 | tools: ["aprotoc", "protoc-gen-nos-client-cpp"], |
Andrew Scull | 304ad12 | 2017-11-10 17:01:41 +0000 | [diff] [blame] | 38 | cmd: GEN_SERVICE_MOCK + "-Iexternal/nos/host/generic/libnos/generator/test", |
Andrew Scull | 98837ec | 2017-09-14 14:18:35 +0100 | [diff] [blame] | 39 | } |
| 40 | |
| 41 | cc_test_host { |
| 42 | name: "protoc-gen-nos-client-cpp_test", |
| 43 | generated_sources: ["nos_generator_test_service_genc++"], |
| 44 | generated_headers: [ |
| 45 | "nos_generator_test_service_genc++_headers", |
| 46 | "nos_generator_test_service_genc++_mock", |
| 47 | ], |
| 48 | srcs: [ |
| 49 | "test.cpp", |
Andrew Scull | af221e3 | 2017-10-12 13:00:53 +0100 | [diff] [blame] | 50 | "nos/generator/test/test.proto", |
Andrew Scull | 98837ec | 2017-09-14 14:18:35 +0100 | [diff] [blame] | 51 | ], |
Andrew Scull | 7e1c8d9 | 2018-02-27 19:55:08 +0000 | [diff] [blame^] | 52 | defaults: ["nos_proto_defaults"], |
Andrew Scull | 98837ec | 2017-09-14 14:18:35 +0100 | [diff] [blame] | 53 | proto: { |
| 54 | type: "full", |
Andrew Scull | 7e1c8d9 | 2018-02-27 19:55:08 +0000 | [diff] [blame^] | 55 | canonical_path_from_root: false, |
Andrew Scull | 98837ec | 2017-09-14 14:18:35 +0100 | [diff] [blame] | 56 | include_dirs: [ |
| 57 | "external/protobuf/src", |
Andrew Scull | 304ad12 | 2017-11-10 17:01:41 +0000 | [diff] [blame] | 58 | "external/nos/host/generic/nugget/proto", |
Andrew Scull | 98837ec | 2017-09-14 14:18:35 +0100 | [diff] [blame] | 59 | ], |
| 60 | }, |
| 61 | header_libs: ["nos_headers"], |
| 62 | static_libs: [ |
| 63 | "libgmock", |
Andrew Scull | 98837ec | 2017-09-14 14:18:35 +0100 | [diff] [blame] | 64 | "libnos_mock", |
Andrew Scull | af221e3 | 2017-10-12 13:00:53 +0100 | [diff] [blame] | 65 | "libnosprotos", |
Andrew Scull | 98837ec | 2017-09-14 14:18:35 +0100 | [diff] [blame] | 66 | ], |
| 67 | } |