1// 2// Copyright (C) 2015 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// ========================================================== 18// Build the host executable: protoc-gen-javastream 19// ========================================================== 20 21package { 22 // See: http://go/android-license-faq 23 // A large-scale-change added 'default_applicable_licenses' to import 24 // all of the 'license_kinds' from "frameworks_base_license" 25 // to get the below license kinds: 26 // SPDX-license-identifier-Apache-2.0 27 default_applicable_licenses: ["frameworks_base_license"], 28} 29 30cc_defaults { 31 name: "protoc-gen-stream-defaults", 32 srcs: [ 33 "Errors.cpp", 34 "stream_proto_utils.cpp", 35 "string_utils.cpp", 36 ], 37 cflags: [ 38 "-Wall", 39 "-Werror", 40 ], 41 42 static_libs: ["libprotoc"], 43} 44 45// ========================================================== 46// Build the host static library: java_streaming_proto_lib 47// ========================================================== 48 49cc_library_host_static { 50 name: "java_streaming_proto_lib", 51 defaults: ["protoc-gen-stream-defaults"], 52 target: { 53 darwin: { 54 cflags: ["-D_DARWIN_UNLIMITED_STREAMS"], 55 }, 56 }, 57 cflags: [ 58 "-Wno-format-y2k", 59 "-DSTATIC_ANDROIDFW_FOR_TOOLS", 60 ], 61 62 srcs: [ 63 "java/java_proto_stream_code_generator.cpp", 64 ], 65} 66 67// ========================================================== 68// Build the host executable: protoc-gen-javastream 69// ========================================================== 70 71cc_binary_host { 72 name: "protoc-gen-javastream", 73 srcs: [ 74 "java/main.cpp", 75 ], 76 77 defaults: ["protoc-gen-stream-defaults"], 78 static_libs: ["java_streaming_proto_lib"], 79} 80 81// ========================================================== 82// Build the host executable: protoc-gen-cppstream 83// ========================================================== 84 85cc_binary_host { 86 name: "protoc-gen-cppstream", 87 srcs: [ 88 "cpp/main.cpp", 89 ], 90 91 defaults: ["protoc-gen-stream-defaults"], 92} 93 94// ========================================================== 95// Build the host tests: StreamingProtoTest 96// ========================================================== 97 98cc_test_host { 99 name: "StreamingProtoTest", 100 defaults: ["protoc-gen-stream-defaults"], 101 srcs: [ 102 "test/unit/**/*.cpp", 103 ], 104 static_libs: [ 105 "java_streaming_proto_lib", 106 "libgmock", 107 "libgtest", 108 ], 109} 110 111// ========================================================== 112// Build the java test 113// ========================================================== 114 115java_library { 116 name: "StreamingProtoJavaIntegrationTest", 117 srcs: [ 118 "test/integration/**/*.java", 119 "test/integration/**/*.proto", 120 ], 121 proto: { 122 type: "stream", 123 }, 124} 125