• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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        "framework-statsd.stubs.module_lib",
36    ],
37    sdk_version: "system_server_current",
38    min_sdk_version: "Tiramisu",
39    apex_available: ["com.android.appsearch"],
40}
41
42java_defaults {
43    name: "service-appsearch-defaults",
44    srcs: ["java/**/*.java"],
45    sdk_version: "system_server_current",
46    min_sdk_version: "Tiramisu",
47    static_libs: [
48        "icing-java-proto-lite",
49        "libicing-java",
50        "statslog-appsearch-lib",
51        // Entries below this line are outside of the appsearch package tree and must be kept in
52        // sync with jarjar.txt
53        "modules-utils-preconditions",
54    ],
55    libs: [
56        "framework-appsearch.impl",
57        "framework-statsd.stubs.module_lib",
58    ],
59    optimize: {
60      enabled: true,
61      optimize: true,
62      shrink: true,
63      proguard_flags_files: ["proguard.flags"],
64    },
65    defaults: ["framework-system-server-module-defaults"],
66    permitted_packages: [
67        "com.android.server.appsearch",
68        "com.google.android.icing",
69    ],
70    jarjar_rules: "jarjar-rules.txt",
71    visibility: [
72        // These are required until appsearch is properly unbundled.
73        "//frameworks/base/services/tests/mockingservicestests",
74        "//frameworks/base/services/tests/servicestests",
75    ],
76    apex_available: ["com.android.appsearch"],
77}
78
79// A special library created strictly for use by the tests as they need the implementation library
80// but that is not available when building from prebuilts. Using a library with a different name to
81// what is used by the prebuilts ensures that this will never depend on the prebuilt.
82// Switching service-appsearch to a java_sdk_library would also have worked as that has built in
83// support for managing this but that is too big a change at this point.
84java_library {
85    name: "service-appsearch-for-tests",
86    defaults: ["service-appsearch-defaults"],
87}
88
89java_library {
90    name: "service-appsearch",
91    defaults: ["service-appsearch-defaults"],
92    installable: true,
93}
94