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 // See: http://go/android-license-faq 17 // A large-scale-change added 'default_applicable_licenses' to import 18 // all of the 'license_kinds' from "packages_modules_appsearch_license" 19 // to get the below license kinds: 20 // SPDX-license-identifier-Apache-2.0 21 default_applicable_licenses: ["packages_modules_appsearch_license"], 22} 23 24genrule { 25 name: "statslog-appsearch-java-gen", 26 tools: ["stats-log-api-gen"], 27 cmd: "$(location stats-log-api-gen) --java $(out) --module appsearch --javaPackage com.android.server.appsearch.stats --javaClass AppSearchStatsLog", 28 out: ["com/android/server/appsearch/stats/AppSearchStatsLog.java"], 29} 30 31java_library { 32 name: "statslog-appsearch-lib", 33 srcs: [":statslog-appsearch-java-gen"], 34 libs: [ 35 // needed for restricted atoms. 36 "androidx.annotation_annotation", 37 // add StatsLog as a dependency of the generated file. 38 "framework-statsd.stubs.module_lib", 39 ], 40 sdk_version: "system_server_current", 41 min_sdk_version: "Tiramisu", 42 apex_available: ["com.android.appsearch"], 43} 44 45java_defaults { 46 name: "service-appsearch-defaults", 47 srcs: [ 48 "java/**/*.java", 49 ], 50 sdk_version: "system_server_current", 51 min_sdk_version: "Tiramisu", 52 static_libs: [ 53 "icing-java-proto-lite", 54 "libicing-java", 55 "statslog-appsearch-lib", 56 // Entries below this line are outside of the appsearch package tree and must be kept in 57 // sync with jarjar.txt 58 "modules-utils-preconditions", 59 ], 60 libs: [ 61 "framework-appsearch.impl", 62 "framework-configinfrastructure", 63 "framework-permission-s", 64 "framework-statsd.stubs.module_lib", 65 ], 66 optimize: { 67 proguard_flags_files: ["proguard.flags"], 68 }, 69 defaults: [ 70 "framework-system-server-module-defaults", 71 "framework-system-server-module-optimize-defaults", 72 ], 73 permitted_packages: [ 74 "com.android.server.appsearch", 75 "com.google.android.icing", 76 ], 77 jarjar_rules: "jarjar-rules.txt", 78 visibility: [ 79 // These are required until appsearch is properly unbundled. 80 "//frameworks/base/services/tests/mockingservicestests", 81 "//frameworks/base/services/tests/servicestests", 82 ], 83 apex_available: ["com.android.appsearch"], 84} 85 86// A special library created strictly for use by the tests as they need the implementation library 87// but that is not available when building from prebuilts. Using a library with a different name to 88// what is used by the prebuilts ensures that this will never depend on the prebuilt. 89// Switching service-appsearch to a java_sdk_library would also have worked as that has built in 90// support for managing this but that is too big a change at this point. 91java_library { 92 name: "service-appsearch-for-tests", 93 defaults: ["service-appsearch-defaults"], 94} 95 96java_library { 97 name: "service-appsearch", 98 defaults: ["service-appsearch-defaults"], 99 installable: true, 100} 101