blob: 5339551b5a2c2611546acce0b2d46098327dafea [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 ],
36}
37
38// Defaults for SDK versions.
39java_defaults {
40 name: "nearby-module-sdk-version-defaults",
41 min_sdk_version: "current",
42 target_sdk_version: "current",
43}
44
45
46// Nearby-service needs pre-jarjared version of framework-nearby so it can reference copied utility
47// classes before they are renamed.
48java_library {
49 name: "framework-nearby-pre-jarjar",
50 defaults: ["framework-nearby-defaults"],
51 sdk_version: "module_current",
52 libs: ["framework-annotations-lib"],
53 // java_api_finder must accompany `srcs` (`srcs` defined in `framework-nearby-defaults`)
54 plugins: ["java_api_finder"],
55 installable: false,
56 visibility: [
57 "//packages/modules/Nearby/service",
58 ],
59}
60
61// SDK library for nearby module API.
62java_sdk_library {
63 name: "framework-nearby",
64 defaults: [
65 "framework-module-defaults", // the SDK needs to be usable in all processes
66 "framework-nearby-defaults",
67 ],
68
69 apex_available: [
70 "com.android.nearby",
71 ],
72 installable: true,
73 optimize: {
74 enabled: false
75 },
76
77 // Restrict access to implementation library.
78 impl_library_visibility: [
79 "//packages/modules/Nearby/service:__subpackages__",
80 ],
81 permitted_packages: [
82 "android.nearby",
83 ],
Wei Wang6b7561d2021-06-03 17:33:14 -070084}