// Copyright (C) 2018 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: "android.car.cluster.navigation-src", srcs: ["src/android/car/navigation/navigation_state.proto"], visibility: [ "//packages/services/Car/car-lib", "//packages/services/Car/service", ], } // Public protos for CarTelemetryManager clients. filegroup { name: "cartelemetryservice-proto-srcs", srcs: [ "src/android/car/telemetry/telemetry.proto" ], } java_library { name: "android.car.cluster.navigation", proto: { type: "lite", }, sdk_version: "module_current", min_sdk_version: "31", apex_available: [ "//apex_available:platform", "com.android.car.framework", ], static_libs: ["libprotobuf-java-lite"], srcs: ["src/android/car/navigation/navigation_state.proto"] } filegroup { name: "android.car-full-src", srcs: [ "src/**/*.java", "src/**/*.aidl", ], visibility: [ "//packages/services/Car/car-lib", "//packages/services/Car/car-lib-module", ], } java_library { name: "android.car", srcs: [ ":android.car-full-src", ], aidl: { include_dirs: [ "packages/modules/Bluetooth/framework/aidl-export", ], }, libs: [ "android.car.builtin", "framework-annotations-lib", "modules-utils-preconditions", "framework-wifi", "framework-bluetooth", ], product_variables: { pdk: { enabled: false, }, }, installable: true, min_sdk_version: "33", sdk_version: "module_current", } // TODO(b/248635421): these annotations are part of android.car, but // they're still need on ATS java_library_static { name: "android.car.annotations.compile-only", srcs: [ "src/android/car/annotation/*", "src/android/car/ApiVersion.java", "src/android/car/CarVersion.java", "src/android/car/PlatformVersion.java", ], } stubs_defaults { name: "android.car-docs-default", srcs: [ "src/**/*.java", ], libs: [ "android.car", ], product_variables: { pdk: { enabled: false, }, }, } genrule { name: "android-car-last-released-api", srcs: [ "api/released/*.txt", ], cmd: "cp -f $$(echo $(in) | tr \" \" \"\\n\" | sort -n | tail -1) $(genDir)/last-released-api.txt", out: [ "last-released-api.txt", ], } genrule { name: "android-car-last-released-system-api", srcs: [ "api/system-released/*.txt", ], cmd: "cp -f $$(echo $(in) | tr \" \" \"\\n\" | sort -n | tail -1) $(genDir)/last-released-system-api.txt", out: [ "last-released-system-api.txt", ], } droidstubs { name: "android.car-stubs-docs", defaults: ["android.car-docs-default"], args: "--hide UnavailableSymbol --stub-packages android.car* " + "--hide-package com.android.internal --hide-package com.android.car.internal ", installable: false, check_api: { last_released: { api_file: ":android-car-last-released-api", removed_api_file: "api/removed.txt", args: " -hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 -hide 25 -hide 26 -hide 27 " + " -warning 7 -warning 8 -warning 9 -warning 10 -warning 11 -warning 12 " + " -warning 13 -warning 14 -warning 15 -warning 16 -warning 17 -warning 18 -hide 113 ", }, current: { api_file: "api/current.txt", removed_api_file: "api/removed.txt", args: " -error 2 -error 3 -error 4 -error 5 -error 6 -error 7 -error 8 -error 9 -error 10 -error 11 " + " -error 12 -error 13 -error 14 -error 15 -error 16 -error 17 -error 18 -error 19 -error 20 " + " -error 21 -error 23 -error 24 -error 25 -hide 113 ", }, api_lint: { enabled: true, baseline_file: "api/lint-baseline.txt", } }, } droidstubs { name: "android.car-system-stubs-docs", defaults: ["android.car-docs-default"], // TODO(b/174572385): Remove CallbackInterface once this b/174572385 is fixed args: "--hide CallbackInterface --hide UnavailableSymbol --hide HiddenSuperclass " + "--stub-packages android.car* " + "--show-annotation android.annotation.SystemApi --hide-package com.android.internal " + "--hide-package com.android.car.internal ", installable: false, check_api: { last_released: { api_file: ":android-car-last-released-system-api", removed_api_file: "api/system-removed.txt", args: " -hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 -hide 25 -hide 26 -hide 27 " + " -warning 7 -warning 8 -warning 9 -warning 10 -warning 11 -warning 12 " + " -warning 13 -warning 14 -warning 15 -warning 16 -warning 17 -warning 18 -hide 113 ", }, current: { api_file: "api/system-current.txt", removed_api_file: "api/system-removed.txt", args: " -error 2 -error 3 -error 4 -error 5 -error 6 -error 7 -error 8 -error 9 -error 10 -error 11 " + " -error 12 -error 13 -error 14 -error 15 -error 16 -error 17 -error 18 -error 19 -error 20 " + " -error 21 -error 23 -error 24 -error 25 -hide 113 ", }, api_lint: { enabled: true, baseline_file: "api/system-lint-baseline.txt", } }, } droidstubs { name: "android.car-test-stubs-docs", defaults: ["android.car-docs-default"], args: "--hide HiddenSuperclass --hide UnavailableSymbol --stub-packages android.car* " + "--show-annotation android.annotation.TestApi " + "--show-annotation android.annotation.SystemApi", installable: false, check_api: { current: { api_file: "api/test-current.txt", removed_api_file: "api/test-removed.txt", args: " -error 2 -error 3 -error 4 -error 5 -error 6 -error 7 -error 8 -error 9 -error 10 -error 11 " + " -error 12 -error 13 -error 14 -error 15 -error 16 -error 17 -error 18 -error 19 -error 20 " + " -error 21 -error 23 -error 24 -error 25 -hide 113 ", }, }, } droidstubs { name: "android.car-stub-docs", srcs: [ "src/**/*.java", ], libs: [ "android.car", ], api_filename: "api.txt", args: "--hide HiddenSuperclass --hide UnavailableSymbol --stub-packages android.car* ", installable: false, product_variables: { pdk: { enabled: false, }, }, } // Generates stubs for API documentation. droidstubs { name: "car-doc-stubs", srcs: [ "src/**/*.java", ], create_doc_stubs: true, annotations_enabled: true, api_levels_annotations_enabled: true, api_levels_jar_filename: "android.car.jar", api_levels_annotations_dirs: [ "sdk-dir", "api-versions-jars-dir", ], previous_api: ":android-car-last-released-api", merge_annotations_dirs: [ "metalava-manual", ], arg_files: [ "AndroidManifest.xml", ], // Add --verbose to print metalava details. args: "--manifest $(location AndroidManifest.xml) " + "--error UnhiddenSystemApi " + "--hide RequiresPermission " + "--hide CallbackInterface " + "--hide MissingPermission " + "--hide HiddenSuperclass --hide DeprecationMismatch --hide UnavailableSymbol " + "--hide SdkConstant --hide HiddenTypeParameter " + "--hide Todo --hide Typo ", write_sdk_values: true, } // Generates API docs for go/devsite. // // How API docs are generated: // source files -> (droidstubs/metalava) -> stub source files -> (droiddoc/doclava) -> docs // // The metalava conversion is done by droidstub module "car-doc-stubs". // // TODO(b/162958231): Remove "ds-car-docs" from build/soong/java/legacy_core_platform_api_usage.go. droiddoc { name: "ds-car-docs", srcs: [ ":car-doc-stubs", ], libs: [ "stub-annotations", "unsupportedappusage", ], custom_template: "droiddoc-templates-sdk", // These variables that are used in doclava templates. hdf: [ "dac true", "sdk.preview 0", // Not a preview version. "sdk.version 31", "android.whichdoc online", "android.hasSamples false", ], arg_files: [ "AndroidManifest.xml", ], proofread_file: "ds-sdk-docs-proofrerad.txt", // See doclava docs in https://github.com/tinks/doclava. // See error numbers in external/doclava/src/com/google/doclava/Errors.java. // TODO(b/163831343): Add -werror -lerror to catch bad javadocs args: "-android -manifest $(location AndroidManifest.xml) -toroot / -devsite -yamlV2 -metalavaApiSince " + "-hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 " + "-stubpackages android.car -dac_libraryroot android/car ", } java_defaults { name: "android.car-stubs.jar_defaults", java_version: "1.8", installable: false, product_variables: { pdk: { enabled: false, }, }, } java_defaults { name: "android.car-stubs-dex.jar_defaults", compile_dex: true, product_variables: { pdk: { enabled: false, }, }, } java_library { name: "android.car-stubs", defaults: ["android.car-stubs.jar_defaults"], srcs: [ ":android.car-stub-docs", ], sdk_version: "current", dist: { targets: ["dist_files"], }, } java_library { name: "android.car-stubs-dex", defaults: ["android.car-stubs-dex.jar_defaults"], static_libs: ["android.car-stubs"], sdk_version: "current", } java_library { name: "android.car-system-stubs", defaults: ["android.car-stubs.jar_defaults"], srcs: [ ":android.car-system-stubs-docs", ], sdk_version: "system_current", dist: { targets: ["dist_files"], }, } java_library { name: "android.car-system-stubs-dex", defaults: ["android.car-stubs-dex.jar_defaults"], static_libs: ["android.car-system-stubs"], sdk_version: "system_current", } java_library { name: "android.car-test-stubs", defaults: ["android.car-stubs.jar_defaults"], srcs: [ ":android.car-test-stubs-docs", ], sdk_version: "test_current", } java_library { name: "android.car-test-stubs-dex", defaults: ["android.car-stubs-dex.jar_defaults"], static_libs: ["android.car-test-stubs"], sdk_version: "test_current", dist: { targets: ["dist_files"], } } // Export the api/system-current.txt file. filegroup { name: "car-api-system-current.txt", visibility: [ "//cts/tests/signature/api", ], srcs: [ "api/system-current.txt", ], } // Export the api/system-removed.txt file. filegroup { name: "car-api-system-removed.txt", visibility: [ "//cts/tests/signature/api", ], srcs: [ "api/system-removed.txt", ], }