blob: 8a09620135596e913695218f129a0e1476a0926d [file] [log] [blame]
// Copyright (C) 2021 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package {
default_applicable_licenses: ["Android-Apache-2.0"],
}
filegroup {
name: "nearby-java-sources",
srcs: [
"java/**/*.java",
"java/**/*.aidl",
],
path: "java",
visibility: ["//visibility:private"],
}
// Defaults shared between `framework-nearby` & `framework-nearby-pre-jarjar`
java_defaults {
name: "framework-nearby-defaults",
defaults: ["nearby-module-sdk-version-defaults"],
srcs: [
":nearby-java-sources",
],
static_libs: [
"modules-utils-preconditions",
],
}
// Defaults for SDK versions.
java_defaults {
name: "nearby-module-sdk-version-defaults",
min_sdk_version: "current",
target_sdk_version: "current",
}
// Nearby-service needs pre-jarjared version of framework-nearby so it can reference copied utility
// classes before they are renamed.
java_library {
name: "framework-nearby-pre-jarjar",
defaults: ["framework-nearby-defaults"],
sdk_version: "module_current",
libs: ["framework-annotations-lib"],
// java_api_finder must accompany `srcs` (`srcs` defined in `framework-nearby-defaults`)
plugins: ["java_api_finder"],
installable: false,
visibility: [
"//packages/modules/Nearby/service",
"//packages/modules/Nearby/tests",
],
}
// SDK library for nearby module API.
java_sdk_library {
name: "framework-nearby",
defaults: [
"framework-module-defaults", // the SDK needs to be usable in all processes
"framework-nearby-defaults",
],
jarjar_rules: ":nearby-jarjar-rules",
apex_available: [
"com.android.nearby",
],
installable: true,
optimize: {
enabled: false
},
// Restrict access to implementation library.
impl_library_visibility: [
"//packages/modules/Nearby/service:__subpackages__",
],
permitted_packages: [
"android.nearby",
"com.android.nearby",
],
}