blob: 8a09620135596e913695218f129a0e1476a0926d [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 {
20 name: "nearby-java-sources",
21 srcs: [
22 "java/**/*.java",
23 "java/**/*.aidl",
24 ],
25 path: "java",
26 visibility: ["//visibility:private"],
27}
28
29// Defaults shared between `framework-nearby` & `framework-nearby-pre-jarjar`
30java_defaults {
31 name: "framework-nearby-defaults",
32 defaults: ["nearby-module-sdk-version-defaults"],
33 srcs: [
34 ":nearby-java-sources",
35 ],
Wei Wangd4878b82021-07-11 21:23:29 -070036 static_libs: [
37 "modules-utils-preconditions",
38 ],
Wei Wang6b7561d2021-06-03 17:33:14 -070039}
40
41// Defaults for SDK versions.
42java_defaults {
43 name: "nearby-module-sdk-version-defaults",
44 min_sdk_version: "current",
45 target_sdk_version: "current",
46}
47
Wei Wang6b7561d2021-06-03 17:33:14 -070048// Nearby-service needs pre-jarjared version of framework-nearby so it can reference copied utility
49// classes before they are renamed.
50java_library {
51 name: "framework-nearby-pre-jarjar",
52 defaults: ["framework-nearby-defaults"],
53 sdk_version: "module_current",
54 libs: ["framework-annotations-lib"],
55 // java_api_finder must accompany `srcs` (`srcs` defined in `framework-nearby-defaults`)
56 plugins: ["java_api_finder"],
57 installable: false,
58 visibility: [
59 "//packages/modules/Nearby/service",
Wei Wangd4878b82021-07-11 21:23:29 -070060 "//packages/modules/Nearby/tests",
Wei Wang6b7561d2021-06-03 17:33:14 -070061 ],
62}
63
64// SDK library for nearby module API.
65java_sdk_library {
66 name: "framework-nearby",
67 defaults: [
68 "framework-module-defaults", // the SDK needs to be usable in all processes
69 "framework-nearby-defaults",
70 ],
71
Wei Wangd4878b82021-07-11 21:23:29 -070072 jarjar_rules: ":nearby-jarjar-rules",
Wei Wang6b7561d2021-06-03 17:33:14 -070073 apex_available: [
74 "com.android.nearby",
75 ],
76 installable: true,
77 optimize: {
78 enabled: false
79 },
80
81 // Restrict access to implementation library.
82 impl_library_visibility: [
83 "//packages/modules/Nearby/service:__subpackages__",
84 ],
85 permitted_packages: [
86 "android.nearby",
Wei Wangd4878b82021-07-11 21:23:29 -070087 "com.android.nearby",
Wei Wang6b7561d2021-06-03 17:33:14 -070088 ],
Wei Wang6b7561d2021-06-03 17:33:14 -070089}