blob: ba971124622d0760f94c7c505340166933512c1f [file] [log] [blame]
Wei Wang6b7561d2021-06-03 17:33:14 -07001// Copyright (C) 2021 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: ["Android-Apache-2.0"],
17}
18
19filegroup {
Chun Zhang90f40a22021-11-03 13:56:13 -070020 name: "framework-nearby-java-sources",
Wei Wang6b7561d2021-06-03 17:33:14 -070021 srcs: [
22 "java/**/*.java",
23 "java/**/*.aidl",
24 ],
25 path: "java",
26 visibility: ["//visibility:private"],
27}
28
Chun Zhang90f40a22021-11-03 13:56:13 -070029filegroup {
30 name: "framework-nearby-sources",
31 srcs: [
32 ":framework-nearby-java-sources",
33 ],
34 visibility: ["//frameworks/base"],
35}
36
Wei Wang6b7561d2021-06-03 17:33:14 -070037// Defaults shared between `framework-nearby` & `framework-nearby-pre-jarjar`
38java_defaults {
39 name: "framework-nearby-defaults",
40 defaults: ["nearby-module-sdk-version-defaults"],
41 srcs: [
Chun Zhang90f40a22021-11-03 13:56:13 -070042 ":framework-nearby-java-sources",
Wei Wang6b7561d2021-06-03 17:33:14 -070043 ],
Wei Wangd4878b82021-07-11 21:23:29 -070044 static_libs: [
45 "modules-utils-preconditions",
46 ],
Wei Wang6b7561d2021-06-03 17:33:14 -070047}
48
49// Defaults for SDK versions.
50java_defaults {
51 name: "nearby-module-sdk-version-defaults",
52 min_sdk_version: "current",
53 target_sdk_version: "current",
54}
55
Wei Wang6b7561d2021-06-03 17:33:14 -070056// Nearby-service needs pre-jarjared version of framework-nearby so it can reference copied utility
57// classes before they are renamed.
58java_library {
59 name: "framework-nearby-pre-jarjar",
60 defaults: ["framework-nearby-defaults"],
61 sdk_version: "module_current",
62 libs: ["framework-annotations-lib"],
63 // java_api_finder must accompany `srcs` (`srcs` defined in `framework-nearby-defaults`)
64 plugins: ["java_api_finder"],
65 installable: false,
66 visibility: [
67 "//packages/modules/Nearby/service",
Wei Wangd4878b82021-07-11 21:23:29 -070068 "//packages/modules/Nearby/tests",
Wei Wang6b7561d2021-06-03 17:33:14 -070069 ],
70}
71
72// SDK library for nearby module API.
73java_sdk_library {
74 name: "framework-nearby",
75 defaults: [
76 "framework-module-defaults", // the SDK needs to be usable in all processes
77 "framework-nearby-defaults",
78 ],
79
Wei Wangd4878b82021-07-11 21:23:29 -070080 jarjar_rules: ":nearby-jarjar-rules",
Wei Wang6b7561d2021-06-03 17:33:14 -070081 apex_available: [
82 "com.android.nearby",
83 ],
84 installable: true,
85 optimize: {
86 enabled: false
87 },
88
89 // Restrict access to implementation library.
90 impl_library_visibility: [
91 "//packages/modules/Nearby/service:__subpackages__",
92 ],
93 permitted_packages: [
94 "android.nearby",
Wei Wangd4878b82021-07-11 21:23:29 -070095 "com.android.nearby",
Wei Wang6b7561d2021-06-03 17:33:14 -070096 ],
Wei Wang6b7561d2021-06-03 17:33:14 -070097}