1// Copyright (C) 2019 The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://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, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15package { 16 default_applicable_licenses: ["external_icing_license"], 17} 18 19// Added automatically by a large-scale-change 20// See: http://go/android-license-faq 21license { 22 name: "external_icing_license", 23 visibility: [":__subpackages__"], 24 license_kinds: [ 25 "SPDX-license-identifier-Apache-2.0", 26 ], 27 license_text: [ 28 "LICENSE", 29 ], 30} 31 32cc_defaults { 33 name: "libicing_defaults", 34 35 // For debug / treemap purposes. 36 //strip: { 37 // keep_symbols: true, 38 //}, 39 40 cflags: [ 41 "-Wall", 42 "-Werror", 43 "-Wextra", 44 "-Wno-deprecated-declarations", 45 "-Wno-ignored-qualifiers", 46 "-Wno-missing-field-initializers", 47 "-Wno-sign-compare", 48 "-Wno-tautological-constant-out-of-range-compare", 49 "-Wno-undefined-var-template", 50 "-Wno-unused-function", 51 "-Wno-unused-parameter", 52 "-Wno-unused-private-field", 53 "-Wno-extern-c-compat", 54 55 "-funsigned-char", 56 "-fvisibility=hidden", 57 58 "-Bsymbolic", 59 ], 60 apex_available: ["com.android.appsearch"], 61} 62 63// TODO(b/193244409): Use the filegroup libicing_test_common along with 64// libicing_defaults to build libicing. 65cc_library_shared { 66 name: "libicing", 67 defaults: ["libicing_defaults"], 68 srcs: [ 69 "icing/**/*.cc", 70 ], 71 exclude_srcs: [ 72 "icing/**/*-test-*", 73 "icing/**/*-test.*", 74 "icing/**/*_test.cc", 75 "icing/**/*_benchmark.cc", 76 "icing/testing/**/*", 77 "icing/tokenization/reverse_jni/**/*", 78 "icing/tokenization/simple/**/*", 79 "icing/tools/**/*", 80 "icing/transform/map/**/*", 81 "icing/transform/simple/**/*", 82 ], 83 header_libs: ["jni_headers"], 84 static_libs: [ 85 "icing-c-proto", 86 "libutf", 87 ], 88 shared_libs: [ 89 "libicu", 90 "liblog", 91 "libprotobuf-cpp-lite", 92 "libz", 93 ], 94 version_script: "icing/jni.lds", 95 min_sdk_version: "Tiramisu", 96} 97 98filegroup { 99 name: "libicing_test_common", 100 // TODO(b/193244409): Utilize globs once all build errors are fixed. 101 srcs: [ 102 "icing/absl_ports/*.cc", 103 "icing/file/**/*.cc", 104 "icing/index/**/*.cc", 105 "icing/legacy/**/*.cc", 106 "icing/portable/*.cc", 107 "icing/query/**/*.cc", 108 "icing/schema/*.cc", 109 "icing/scoring/**/*.cc", 110 "icing/store/*.cc", 111 "icing/testing/*.cc", 112 "icing/text_classifier/lib3/utils/base/*.cc", 113 "icing/text_classifier/lib3/utils/hash/*.cc", 114 "icing/tokenization/*.cc", 115 "icing/util/*.cc", 116 ], 117 // TODO(b/193244409): Remove after all the excluded tests are passing. 118 exclude_srcs: [ 119 "icing/**/*_benchmark.cc", 120 "icing/**/*-jni-layer.cc", 121 "icing/index/**/*_test.cc", 122 "icing/legacy/**/*_test.cc", 123 "icing/query/**/*_test.cc", 124 "icing/scoring/**/*_test.cc", 125 "icing/store/*_test.cc", 126 "icing/testing/*test.cc", 127 "icing/testing/*test-data.cc", 128 "icing/tokenization/*_test.cc", 129 "icing/util/*_test.cc", 130 ], 131} 132 133cc_test { 134 name: "libicing_tests", 135 defaults: ["libicing_defaults"], 136 test_suites: ["device_tests"], 137 // TODO(b/193244409): Implement globs for additional tests. 138 srcs: [ 139 ":libicing_test_common", 140 ], 141 static_libs: [ 142 "icing-c-proto", 143 "libgmock", 144 "libgoogle-benchmark", 145 "libgtest", 146 ], 147 shared_libs: [ 148 "libicu", 149 "libicu_cts_stub", 150 "liblog", 151 "libprotobuf-cpp-lite", 152 "libz", 153 ], 154} 155 156// TODO(cassiewang): Add build rules and a TEST_MAPPING for cc_tests 157