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.
15package {
16    // See: http://go/android-license-faq
17    // A large-scale-change added 'default_applicable_licenses' to import
18    // all of the 'license_kinds' from "frameworks_base_license"
19    // to get the below license kinds:
20    //   SPDX-license-identifier-Apache-2.0
21    default_applicable_licenses: ["frameworks_base_license"],
22}
23
24cc_defaults {
25    name: "libprotoutil_defaults",
26
27    cflags: [
28        "-Wall",
29        "-Werror",
30        "-Wno-missing-field-initializers",
31        "-Wno-unused-variable",
32        "-Wunused-parameter",
33    ],
34
35    srcs: [
36        "src/EncodedBuffer.cpp",
37        "src/ProtoFileReader.cpp",
38        "src/ProtoOutputStream.cpp",
39        "src/ProtoReader.cpp",
40        "src/protobuf.cpp",
41    ],
42
43    shared_libs: [
44        "libbase",
45        "libutils",
46        "libcutils",
47        "liblog",
48    ],
49}
50
51cc_library {
52    name: "libprotoutil",
53
54    defaults: ["libprotoutil_defaults"],
55
56    export_include_dirs: ["include"],
57
58    min_sdk_version: "30",
59    apex_available: [
60        "//apex_available:platform",
61        "com.android.os.statsd",
62        "test_com.android.os.statsd",
63    ],
64}
65
66cc_test {
67    name: "libprotoutil_test",
68
69    defaults: ["libprotoutil_defaults"],
70
71    local_include_dirs: ["include"],
72
73    srcs: ["tests/*"],
74
75    shared_libs: [
76        "libprotobuf-cpp-full",
77    ],
78
79    static_libs: [
80        "libgmock",
81    ],
82
83    test_suites: [
84        "general-tests",
85    ],
86
87    proto: {
88        type: "full",
89    },
90}
91