|  | // Copyright (C) 2007 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. | 
|  |  | 
|  | // | 
|  | // Definitions for building the Android core library and associated tests. | 
|  | // | 
|  |  | 
|  | // The Android core library provides low-level APIs for use by the rest of the | 
|  | // Android software stack. It is made up of various parts, some of which can be | 
|  | // found in libcore/ and other parts that can be found in various external/ | 
|  | // directories. | 
|  | // | 
|  | // libcore has some sub-directories that follow a common structure: | 
|  | // e.g. dalvik, dom, harmony-tests, json, jsr166-tests, luni, libart, ojluni, | 
|  | // support, xml, xmlpull. | 
|  | // | 
|  | // The structure of these is generally: | 
|  | // | 
|  | //   src/ | 
|  | //       main/               # To be shipped on every device. | 
|  | //            java/          # Java source for library code. | 
|  | //            native/        # C/C++ source for library code. | 
|  | //            resources/     # Support files. | 
|  | //       test/               # Built only on demand, for testing. | 
|  | //            java/          # Java source for tests. | 
|  | //            native/        # C/C++ source for tests (rare). | 
|  | //            resources/     # Support files. | 
|  | // | 
|  | // All subdirectories are optional. | 
|  |  | 
|  | build = [ | 
|  | "openjdk_java_files.bp", | 
|  | "non_openjdk_java_files.bp", | 
|  | ] | 
|  |  | 
|  | // The Java files and their associated resources. | 
|  | filegroup { | 
|  | name: "core-luni-resources", | 
|  | visibility: [ | 
|  | "//libcore:__subpackages__", | 
|  | ], | 
|  | path: "luni/src/main/java/", | 
|  | srcs: [ | 
|  | "luni/src/main/java/java/util/logging/logging.properties", | 
|  | "luni/src/main/java/java/security/security.properties", | 
|  | ], | 
|  | } | 
|  |  | 
|  | filegroup { | 
|  | name: "core-ojluni-resources", | 
|  | visibility: [ | 
|  | "//libcore:__subpackages__", | 
|  | ], | 
|  | path: "ojluni/src/main/resources/", | 
|  | srcs: [ | 
|  | "ojluni/src/main/resources/**/*", | 
|  | ], | 
|  | } | 
|  |  | 
|  | core_resources = [ | 
|  | ":core-luni-resources", | 
|  | ":core-ojluni-resources", | 
|  | ] | 
|  |  | 
|  | // The source files that go into core-oj. | 
|  | filegroup { | 
|  | name: "core_oj_java_files", | 
|  | visibility: [ | 
|  | "//libcore:__subpackages__", | 
|  | ], | 
|  | srcs: [":openjdk_java_files"], | 
|  | } | 
|  |  | 
|  | // http://b/129765390, http://b/188966706 | 
|  | // Rewrite links to "platform" or "technotes" folders which are siblings | 
|  | // (and thus outside of) {@docRoot}. | 
|  | // | 
|  | // We have to escape \ as \\ and $ as $$ here because they get resolved by | 
|  | // different layers of the build tooling. The arguments are wrapped in '' so | 
|  | // that the shell doesn't add yet another level of escaping. | 
|  | rewrite_openjdk_doc_links = "sed -E 's" + | 
|  | "!(\\{@docRoot\\}/\\.\\./|[./]+)((platform|technotes).+)\">" + | 
|  | "!https://docs.oracle.com/javase/8/docs/\\2\">!' " + | 
|  | "$(in) " + | 
|  | "| sed -E 's" + // Android doesn't have java.base in the API docs | 
|  | "!(\\{@docRoot\\}/)(java\\.base/)(.+)\">" + | 
|  | "!\\1reference/\\3\">!' " + | 
|  | "| sed -E 's" + | 
|  | "!(\\{@docRoot\\}/\\.\\./)(specs/.+)\">" + | 
|  | "!https://docs.oracle.com/en/java/javase/17/docs/\\2\">!' " + | 
|  | " > $(out) " + | 
|  | "&& ! grep '{@docRoot}/../' $(out)" // exit with 1 if "{@docRoot}/../" still exists. | 
|  |  | 
|  | // OpenJDK source is not annotated with @hide so we need this separate | 
|  | // filegroup for just the parts that contribute to the API. | 
|  | gensrcs { | 
|  | name: "core_oj_api_files", | 
|  | cmd: rewrite_openjdk_doc_links, | 
|  | srcs: [":openjdk_javadoc_files"], | 
|  | output_extension: "java", | 
|  | } | 
|  |  | 
|  | // The source files that go into core-libart.l | 
|  | filegroup { | 
|  | name: "core_libart_java_files", | 
|  | visibility: [ | 
|  | "//libcore:__subpackages__", | 
|  | ], | 
|  | srcs: [ | 
|  | ":non_openjdk_java_files", | 
|  | ], | 
|  | } | 
|  |  | 
|  | // Some parts of libart are not annotated with @hide so we need this separate | 
|  | // filegroup for just the parts that contribute to the API. | 
|  | filegroup { | 
|  | name: "core_libart_api_files", | 
|  | srcs: [ | 
|  | ":non_openjdk_javadoc_files", | 
|  | ], | 
|  | } | 
|  |  | 
|  | // The set of files for the ART module that contribute to one or more API | 
|  | // surfaces. This includes files that are in the public API as well as those | 
|  | // that are not but which have been marked up with @hide plus one or more of | 
|  | // the API defining annotations. | 
|  | // | 
|  | // Some source files in :core_oj_api_files and :openjdk_mmodule_extra_files are | 
|  | // annotated by applying annotations to the .annotated.java stubs files in | 
|  | // ojluni/annotated/mmodules and rather than in the original source. See the comments | 
|  | // in openjdk_java_files.bp for more details. | 
|  | filegroup { | 
|  | name: "art_module_api_files", | 
|  | visibility: [ | 
|  | "//libcore:__subpackages__", | 
|  | ], | 
|  | srcs: [ | 
|  | ":apache-xml_api_files", | 
|  | ":bouncycastle_java_files", | 
|  | ":core_oj_api_files", | 
|  | ":core_libart_api_files", | 
|  | ":okhttp_api_files", | 
|  | ":openjdk_mmodule_extra_files", | 
|  | ], | 
|  | } | 
|  |  | 
|  | java_defaults { | 
|  | name: "libcore_java_defaults", | 
|  | visibility: [ | 
|  | "//libcore:__subpackages__", | 
|  | ], | 
|  | javacflags: [ | 
|  | //"-Xlint:all", | 
|  | //"-Xlint:-serial,-deprecation,-unchecked", | 
|  | ], | 
|  | dxflags: [ | 
|  | "--android-platform-build", | 
|  | "--core-library", | 
|  | ], | 
|  | errorprone: { | 
|  | javacflags: [ | 
|  | "-Xep:MissingOverride:OFF", // Ignore missing @Override. | 
|  | "-Xep:ConstantOverflow:WARN", // Known constant overflow in SplittableRandom | 
|  | "-Xep:UnicodeInCode:WARN", // XML parser uses line feeds in whitespace | 
|  | "-Xep:ReturnValueIgnored:WARN", | 
|  | "-Xep:HashtableContains:WARN", | 
|  | "-Xep:ComparableType:WARN", | 
|  | "-Xep:IdentityBinaryExpression:WARN", | 
|  | "-Xep:BoxedPrimitiveEquality:WARN", | 
|  | "-Xep:EmptyTopLevelDeclaration:WARN", | 
|  | "-Xep:GetClassOnClass:WARN", | 
|  | "-Xep:NullableOnContainingClass:WARN", | 
|  | "-Xep:GetClassOnAnnotation:WARN", | 
|  | ], | 
|  | }, | 
|  | lint: { | 
|  | warning_checks: [ | 
|  | "SuspiciousIndentation", | 
|  | "NewApi", | 
|  | ], | 
|  | }, | 
|  | min_sdk_version: "31", | 
|  | } | 
|  |  | 
|  | // | 
|  | // Build for the target (device). | 
|  | // | 
|  |  | 
|  | // A target used to bootstrap compilation for the core library. | 
|  | // | 
|  | // See core-all-system-modules for more details. | 
|  | java_library { | 
|  | name: "core-all", | 
|  | defaults: ["libcore_java_defaults"], | 
|  |  | 
|  | srcs: [ | 
|  | // Use the source code for the I18N module intra core API as using the | 
|  | // compiled version does not work due to limitations in either soong or the javac | 
|  | // toolchain. See http://b/142056316 for more details. | 
|  | ":i18n.module.intra.core.api{.public.stubs.source}", | 
|  | ":core_oj_java_files", | 
|  | ":core_libart_java_files", | 
|  | // framework-api-annotations contain API annotations, e.g. @SystemApi. | 
|  | ":framework-api-annotations", | 
|  | // framework-metalava-annotations contain annotations output by Metalava | 
|  | // in stubs, e.g. @android.annotation.Nullable. | 
|  | ":framework-metalava-annotations", | 
|  | ":openjdk_lambda_stub_files", | 
|  | ":app-compat-annotations-source", | 
|  |  | 
|  | // Use the okhttp source too to allow libcore code to reference it | 
|  | // directly. | 
|  | ":okhttp_impl_files", | 
|  | ], | 
|  | static_libs: [ | 
|  | "art-aconfig-flags-java-lib-for-core-all-only", | 
|  | "libcore-aconfig-flags-lib-for-core-all-only", | 
|  | ], | 
|  |  | 
|  | sdk_version: "none", | 
|  | system_modules: "none", | 
|  | patch_module: "java.base", | 
|  | openjdk9: { | 
|  | srcs: ["luni/src/module/java/module-info.java"], | 
|  | }, | 
|  |  | 
|  | java_resources: core_resources, | 
|  |  | 
|  | installable: false, | 
|  |  | 
|  | plugins: [ | 
|  | "compat-changeid-annotation-processor", | 
|  | "unsupportedappusage-annotation-processor", | 
|  | ], | 
|  | libs: [ | 
|  | "conscrypt.module.intra.core.api.stubs", | 
|  | ], | 
|  |  | 
|  | java_version: "21", | 
|  | } | 
|  |  | 
|  | platform_compat_config { | 
|  | name: "libcore-platform-compat-config", | 
|  | src: ":core-all", | 
|  | visibility: [ | 
|  | "//art/build/apex", | 
|  | "//art/build/sdk", | 
|  | ], | 
|  | } | 
|  |  | 
|  | // A system modules definition for use by core library targets only. It only | 
|  | // contains the core-all jar, which contains the classes that end up in core-oj, | 
|  | // core-libart as well as the lambda stubs needed to compile Java lambda code. | 
|  | // It does not contain other parts of core library like conscrypt, bouncycastle, | 
|  | // etc. This system_modules definition is used to bootstrap compilation for | 
|  | // other parts of the core library like core-oj, core-libart, conscrypt, | 
|  | // bouncycastle, etc. It is also used to compile Libcore tests, as well as ART | 
|  | // Java tests (run-tests). | 
|  | java_system_modules { | 
|  | name: "core-all-system-modules", | 
|  |  | 
|  | // Visibility is deliberately restricted to a small set of build modules that | 
|  | // the core library team control. | 
|  | visibility: [ | 
|  | "//art/build/flags", | 
|  | "//art/test:__subpackages__", | 
|  | "//build/make/tools/aconfig/aconfig_storage_file", | 
|  | "//build/make/tools/aconfig/aconfig_storage_read_api", | 
|  | "//build/make/tools/aconfig/fake_device_config", | 
|  | "//external/apache-harmony:__subpackages__", | 
|  | "//external/apache-xml", | 
|  | "//external/icu", | 
|  | "//external/conscrypt", | 
|  | "//external/okhttp", | 
|  | "//frameworks/libs/modules-utils/java", | 
|  | "//libcore:__subpackages__", | 
|  | "//tools/platform-compat/java/android/compat/annotation", | 
|  | ], | 
|  |  | 
|  | libs: ["core-all"], | 
|  | } | 
|  |  | 
|  | // Contains the parts of core library associated with OpenJDK. | 
|  | java_library { | 
|  | name: "core-oj", | 
|  | visibility: [ | 
|  | "//art/build/apex", | 
|  | "//art/build/sdk", | 
|  | "//art/tools/ahat", | 
|  | "//art/tools/fuzzer", | 
|  | "//external/wycheproof", | 
|  | "//libcore/benchmarks", | 
|  | "//packages/modules/ArtPrebuilt", | 
|  | ], | 
|  | apex_available: [ | 
|  | "com.android.art", | 
|  | "com.android.art.debug", | 
|  | ], | 
|  | defaults: ["libcore_java_defaults"], | 
|  | installable: true, | 
|  | hostdex: true, | 
|  |  | 
|  | srcs: [":core_oj_java_files"], | 
|  | java_resources: core_resources, | 
|  |  | 
|  | sdk_version: "none", | 
|  | system_modules: "core-all-system-modules", | 
|  | patch_module: "java.base", | 
|  |  | 
|  | jacoco: { | 
|  | exclude_filter: [ | 
|  | "java.lang.Class", | 
|  | "java.lang.Long", | 
|  | "java.lang.Number", | 
|  | "java.lang.Object", | 
|  | "java.lang.String", | 
|  | "java.lang.invoke.MethodHandle", | 
|  | "java.lang.invoke.VarHandle", | 
|  | "java.lang.ref.Reference", | 
|  | "java.lang.reflect.Proxy", | 
|  | "java.util.AbstractMap", | 
|  | "java.util.HashMap", | 
|  | "java.util.HashMap$Node", | 
|  | "java.util.Map", | 
|  | ], | 
|  | }, | 
|  |  | 
|  | hiddenapi_additional_annotations: [ | 
|  | "core-oj-hiddenapi-annotations", | 
|  | ], | 
|  |  | 
|  | errorprone: { | 
|  | javacflags: [ | 
|  | "-Xep:ReturnValueIgnored:WARN", | 
|  | "-Xep:HashtableContains:WARN", | 
|  | "-Xep:ComparableType:WARN", | 
|  | "-Xep:IdentityBinaryExpression:WARN", | 
|  | "-Xep:BoxedPrimitiveEquality:WARN", | 
|  | "-Xep:EmptyTopLevelDeclaration:WARN", | 
|  | "-Xep:GetClassOnClass:WARN", | 
|  | ], | 
|  | }, | 
|  | } | 
|  |  | 
|  | // Contains parts of core library not associated with OpenJDK. Contains not | 
|  | // just java.*, javax.* code but also android.system.* and various internal | 
|  | // libcore.* packages. | 
|  | java_library { | 
|  | name: "core-libart", | 
|  | visibility: [ | 
|  | "//art/build/apex", | 
|  | "//art/build/sdk", | 
|  | "//art/tools/ahat", | 
|  | "//art/tools/fuzzer", | 
|  | "//external/wycheproof", | 
|  | "//libcore/benchmarks", | 
|  | "//packages/modules/ArtPrebuilt", | 
|  | ], | 
|  | apex_available: [ | 
|  | "com.android.art", | 
|  | "com.android.art.debug", | 
|  | ], | 
|  | defaults: ["libcore_java_defaults"], | 
|  | installable: true, | 
|  | hostdex: true, | 
|  |  | 
|  | srcs: [":core_libart_java_files"], | 
|  | static_libs: [ | 
|  | "art-aconfig-flags-java-lib", | 
|  | "libcore-aconfig-flags-lib", | 
|  | ], | 
|  |  | 
|  | sdk_version: "none", | 
|  | system_modules: "core-all-system-modules", | 
|  | patch_module: "java.base", | 
|  |  | 
|  | jacoco: { | 
|  | exclude_filter: [ | 
|  | "java.lang.DexCache", | 
|  | "dalvik.system.ClassExt", | 
|  | ], | 
|  | }, | 
|  |  | 
|  | target: { | 
|  | hostdex: { | 
|  | required: [ | 
|  | // Files used to simulate the /system, runtime APEX and tzdata | 
|  | // APEX dir structure on host. | 
|  | "tzdata_icu_res_files_host_prebuilts", | 
|  | "tzdata_host", | 
|  | "tzdata_host_tzdata_apex", | 
|  | "tzlookup.xml_host_tzdata_apex", | 
|  | "tz_version_host", | 
|  | "tz_version_host_tzdata_apex", | 
|  | ], | 
|  | }, | 
|  | darwin: { | 
|  | enabled: false, | 
|  | }, | 
|  | }, | 
|  |  | 
|  | errorprone: { | 
|  | javacflags: [ | 
|  | "-Xep:EmptyTopLevelDeclaration:WARN", | 
|  | "-Xep:GetClassOnAnnotation:WARN", | 
|  | "-Xep:NullableOnContainingClass:WARN", | 
|  | ], | 
|  | }, | 
|  |  | 
|  | java_version: "21", | 
|  | } | 
|  |  | 
|  | // Java library for use on host, e.g. by robolectric or layoutlib. | 
|  | java_library { | 
|  | name: "core-libart-for-host", | 
|  | visibility: [ | 
|  | "//art/build/sdk", | 
|  | "//external/robolectric", | 
|  | "//external/robolectric-shadows", | 
|  | "//frameworks/base", | 
|  | "//frameworks/layoutlib", | 
|  | ], | 
|  | static_libs: [ | 
|  | "core-libart", | 
|  | ], | 
|  | sdk_version: "none", | 
|  | system_modules: "none", | 
|  | } | 
|  |  | 
|  | // Provided solely to contribute information about which hidden parts of the | 
|  | // core-oj API are used by apps. | 
|  | // | 
|  | // Usually, e.g. for core-libart, the UnsupportedAppUsage annotations are | 
|  | // added to the source that is compiled directly into the bootjar and the build | 
|  | // system extracts the information about UnsupportedAppUsage directly from | 
|  | // there. | 
|  | // | 
|  | // This approach of having separate annotated source and a separate build | 
|  | // target was taken for ojluni to avoid having to maintain local patches in the | 
|  | // ojluni source for UnsupportedAppUsage annotations as that would make it more | 
|  | // difficult to pull down changes from upstream. | 
|  | // | 
|  | java_library { | 
|  | name: "core-oj-hiddenapi-annotations", | 
|  | // Do not allow this to be accessed from outside this directory. | 
|  | visibility: ["//libcore:__subpackages__"], | 
|  | defaults: ["libcore_java_defaults"], | 
|  | compile_dex: true, | 
|  |  | 
|  | srcs: [":openjdk_hiddenapi_javadoc_files"], | 
|  |  | 
|  | sdk_version: "none", | 
|  | system_modules: "core-all-system-modules", | 
|  | patch_module: "java.base", | 
|  | plugins: ["unsupportedappusage-annotation-processor"], | 
|  |  | 
|  | errorprone: { | 
|  | javacflags: [ | 
|  | "-Xep:ComparableType:WARN", | 
|  | ], | 
|  | }, | 
|  | } | 
|  |  | 
|  | java_defaults { | 
|  | name: "core_lambda_stubs_defaults", | 
|  | defaults: ["libcore_java_defaults"], | 
|  | hostdex: true, | 
|  |  | 
|  | sdk_version: "none", | 
|  | system_modules: "core-all-system-modules", | 
|  | patch_module: "java.base", | 
|  |  | 
|  | installable: false, | 
|  | include_srcs: true, | 
|  | } | 
|  |  | 
|  | // Creates a jar that exists to satisfy javac when compiling source code that | 
|  | // contains lambdas. This contains all classes / methods required by javac | 
|  | // when generating invoke-dynamic lambda implementation code, even those that | 
|  | // are also in the public SDK API from API level 26 onwards. | 
|  | java_library { | 
|  | name: "core-lambda-stubs", | 
|  | visibility: [ | 
|  | "//visibility:public", | 
|  | ], | 
|  | defaults: ["core_lambda_stubs_defaults"], | 
|  | srcs: [ | 
|  | ":openjdk_lambda_stub_files", | 
|  | ":openjdk_lambda_duplicate_stub_files", | 
|  | ], | 
|  | // This jar is packaged as part of the SDK, use -target 8 so that it works | 
|  | // with old JDKs. | 
|  | java_version: "1.8", | 
|  | is_stubs_module: true, | 
|  | } | 
|  |  | 
|  | // An alternative to core-lambda-stubs that omits openjdk_lambda_duplicate_stub_files | 
|  | // because those classes are also part of the core library public SDK API | 
|  | // (since API level 26). | 
|  | java_library { | 
|  | name: "core-lambda-stubs-for-system-modules", | 
|  | visibility: [ | 
|  | "//art/build/sdk", | 
|  | "//build/soong/java/core-libraries", | 
|  | "//frameworks/base", | 
|  | "//frameworks/base/api", | 
|  | ], | 
|  | defaults: ["core_lambda_stubs_defaults"], | 
|  | srcs: [ | 
|  | ":openjdk_lambda_stub_files", | 
|  | ], | 
|  | include_srcs: true, | 
|  | // This jar is packaged as part of the SDK, use -target 8 so that it works | 
|  | // with old JDKs. | 
|  | java_version: "1.8", | 
|  | } | 
|  |  | 
|  | // This is an empty jar that exists for backwards compatibility with T (and below). | 
|  | // Historically, it existed to satisfy javac when compiling source code that | 
|  | // contains @Generated annotations. | 
|  | // This is no longer necessary since @Generated was added to ART's Public API | 
|  | // surface in U. | 
|  | java_library { | 
|  | name: "core-generated-annotation-stubs", | 
|  | visibility: [ | 
|  | "//art/build/sdk", | 
|  | "//build/soong/java/core-libraries", | 
|  | "//frameworks/base", | 
|  | "//frameworks/base/api", | 
|  | ], | 
|  | defaults: ["libcore_java_defaults"], | 
|  | srcs: [ | 
|  | ], | 
|  | hostdex: true, | 
|  | sdk_version: "none", | 
|  | system_modules: "core-all-system-modules", | 
|  | patch_module: "java.base", | 
|  | installable: false, | 
|  | include_srcs: true, | 
|  | // This jar is packaged as part of the SDK, use -target 8 so that it works | 
|  | // with old JDKs. | 
|  | java_version: "1.8", | 
|  | } | 
|  |  | 
|  | // Builds libcore test rules | 
|  | java_library_static { | 
|  | name: "core-test-rules", | 
|  | visibility: [ | 
|  | "//art/build/sdk", | 
|  | "//cts/tests/core/runner-axt", | 
|  | "//cts/tests/tests/util", | 
|  | "//external/conscrypt", | 
|  | "//external/conscrypt/apex/tests", | 
|  | "//frameworks/base/location/tests/locationtests", | 
|  | "//frameworks/base/core/tests/coretests", | 
|  | "//frameworks/base/wifi/tests", | 
|  | "//libcore/ojluni/src/test", | 
|  | "//libcore/luni/src/test/java9compatibility", | 
|  | "//packages/modules/Wifi/framework/tests", | 
|  | ], | 
|  | hostdex: true, | 
|  | srcs: [ | 
|  | "dalvik/test-rules/src/main/**/*.java", | 
|  | "test-rules/src/main/**/*.java", | 
|  | ], | 
|  | static_libs: [ | 
|  | "junit", | 
|  | "platform-test-annotations", | 
|  | ], | 
|  |  | 
|  | sdk_version: "none", | 
|  | system_modules: "core-all-system-modules", | 
|  | } | 
|  |  | 
|  | // Builds platform_compat test rules | 
|  | java_library_static { | 
|  | name: "core-compat-test-rules", | 
|  | visibility: [ | 
|  | "//art/build/sdk", | 
|  | "//libcore:__subpackages__", | 
|  | "//frameworks/base/tests/PlatformCompatGating/test-rules", | 
|  | "//libcore:__subpackages__", | 
|  | ], | 
|  | srcs: [ | 
|  | "luni/src/main/java/android/compat/**/*.java", | 
|  | "test-rules/src/platform_compat/**/*.java", | 
|  | "luni/src/main/java/libcore/api/CorePlatformApi.java", | 
|  | "luni/src/main/java/libcore/api/IntraCoreApi.java", | 
|  | ], | 
|  | static_libs: [ | 
|  | "junit", | 
|  | "guava", | 
|  | ], | 
|  | sdk_version: "none", | 
|  | system_modules: "core-all-system-modules", | 
|  | // This builds classes that are in the java.base Java module: | 
|  | patch_module: "java.base", | 
|  | hostdex: true, | 
|  |  | 
|  | errorprone: { | 
|  | javacflags: [ | 
|  | "-Xep:EmptyTopLevelDeclaration:WARN", | 
|  | "-Xep:GetClassOnAnnotation:WARN", | 
|  | ], | 
|  | }, | 
|  | } | 
|  |  | 
|  | // Builds the core-tests-support library used by various tests. | 
|  | java_library_static { | 
|  | name: "core-tests-support", | 
|  | visibility: [ | 
|  | "//art/build/sdk", | 
|  | "//cts/apps/CtsVerifier", | 
|  | "//cts/tests/tests/keystore", | 
|  | "//cts/tests/tests/net", | 
|  | "//cts/hostsidetests/statsdatom/apps/statsdapp", | 
|  | "//cts/tests/tests/net/api23Test", | 
|  | "//external/apache-harmony", | 
|  | "//frameworks/base/core/tests/coretests", | 
|  | "//frameworks/base/apct-tests/perftests/core", | 
|  | "//libcore/benchmarks", | 
|  | "//packages/apps/KeyChain/tests", | 
|  | "//system/timezone/distro/core", | 
|  | "//packages/modules/Connectivity/tests:__subpackages__", | 
|  | ], | 
|  | hostdex: true, | 
|  | srcs: ["support/src/test/java/**/*.java"], | 
|  |  | 
|  | sdk_version: "core_platform", | 
|  | // Make sure that this will be added to the sdk snapshot for S. | 
|  | min_sdk_version: "S", | 
|  | libs: ["junit"], | 
|  | static_libs: [ | 
|  | "bouncycastle-unbundled", | 
|  | "bouncycastle-bcpkix-unbundled", | 
|  | "bouncycastle-ocsp-unbundled", | 
|  | ], | 
|  | errorprone: { | 
|  | javacflags: [ | 
|  | "-Xep:BoxedPrimitiveEquality:WARN", | 
|  | ], | 
|  | }, | 
|  | } | 
|  |  | 
|  | // Used to generate the prebuilt file luni/src/test/resources/prebuilt-dex-from-java.dex. | 
|  | // The reason why we pre-build this dex file is to stabilize the test result from the | 
|  | // dexer / javac / other toolchains change. | 
|  | // Regenerate the prebuilt file with the following command: | 
|  | //   m core-tests-prebuilt-dex-from-java && | 
|  | //   unzip out/soong/.intermediates/libcore/core-tests-prebuilt-dex-from-java/android_common/dex/core-tests-prebuilt-dex-from-java.jar classes.dex \ | 
|  | //   -d libcore/luni/src/test/resources/ && mv libcore/luni/src/test/resources/classes.dex libcore/luni/src/test/resources/prebuilt-dex-from-java.dex | 
|  | java_test { | 
|  | name: "core-tests-prebuilt-dex-from-java", | 
|  | srcs: ["luni/src/test/dex_src/**/*.java"], | 
|  | compile_dex: true, | 
|  | defaults: ["libcore_java_defaults"], | 
|  | sdk_version: "none", | 
|  | system_modules: "core-all-system-modules", | 
|  |  | 
|  | visibility: [ | 
|  | "//libcore:__subpackages__", | 
|  | ], | 
|  | } | 
|  |  | 
|  | // Builds the jsr166-tests library. | 
|  | java_test { | 
|  | name: "jsr166-tests", | 
|  | visibility: [ | 
|  | "//art/build/sdk", | 
|  | "//cts/tests/libcore/jsr166", | 
|  | ], | 
|  | srcs: ["jsr166-tests/src/test/java/**/*.java"], | 
|  | sdk_version: "none", | 
|  | system_modules: "core-all-system-modules", | 
|  | libs: [ | 
|  | "junit", | 
|  | ], | 
|  | errorprone: { | 
|  | javacflags: [ | 
|  | "-Xep:DoNotCall:OFF", | 
|  | "-Xep:ModifyingCollectionWithItself:WARN", | 
|  | "-Xep:ReturnValueIgnored:WARN", | 
|  | "-Xep:HashtableContains:WARN", | 
|  | ], | 
|  | }, | 
|  | } | 
|  |  | 
|  | // A filegroup that provides access to a source file for a toolchain test that | 
|  | // checks Java 9 language features are handled properly by JarJar. | 
|  | filegroup { | 
|  | name: "core-java-9-language-features-source", | 
|  | srcs: ["luni/src/main/java/libcore/internal/Java9LanguageFeatures.java"], | 
|  | visibility: ["//libcore/luni/src/test/java9language"], | 
|  | } | 
|  |  | 
|  | // A filegroup that provides access to a source file for a toolchain test that | 
|  | // checks Java 11 language features are handled properly by JarJar. | 
|  | filegroup { | 
|  | name: "core-java-11-language-features-source", | 
|  | srcs: ["luni/src/main/java/libcore/internal/Java11LanguageFeatures.java"], | 
|  | visibility: ["//libcore/luni/src/test/java11language"], | 
|  | } | 
|  |  | 
|  | // A filegroup that provides access to a source file for a toolchain test that | 
|  | // checks Java 17 language features are handled properly by JarJar. | 
|  | filegroup { | 
|  | name: "core-java-17-language-features-source", | 
|  | srcs: ["luni/src/main/java/libcore/internal/Java17LanguageFeatures.java"], | 
|  | visibility: ["//libcore/luni/src/test/java17language"], | 
|  | } | 
|  |  | 
|  | // A filegroup that provides access to a source file for a toolchain test that | 
|  | // checks Java 21 language features are handled properly by JarJar. | 
|  | filegroup { | 
|  | name: "core-java-21-language-features-source", | 
|  | srcs: ["luni/src/main/java/libcore/internal/Java21LanguageFeatures.java"], | 
|  | visibility: ["//libcore/luni/src/test/java21language"], | 
|  | } | 
|  |  | 
|  | genrule { | 
|  | name: "core-tests-smali-dex", | 
|  | srcs: ["luni/src/test/java/**/*.smali"], | 
|  | cmd: "$(location android-smali) ass --api 28 -o $(out) $(in)", | 
|  | out: ["core-tests-smali.dex"], | 
|  | tools: ["android-smali"], | 
|  | } | 
|  |  | 
|  | filegroup { | 
|  | name: "core-ojtests-javax-resources", | 
|  | // Set path to keep the resources and .class files in the same directory in the jar file. | 
|  | path: "ojluni/src", | 
|  | srcs: ["ojluni/src/test/javax/**/*"], | 
|  | exclude_srcs: ["ojluni/src/test/javax/**/*.java"], | 
|  | } | 
|  |  | 
|  | filegroup { | 
|  | name: "core-ojtests-java-resources", | 
|  | // Set path to keep the resources and .class files in the same directory in the jar file. | 
|  | path: "ojluni/src", | 
|  | srcs: [ | 
|  | "ojluni/src/test/java/util/regex/**/*", | 
|  | "ojluni/src/test/java/util/Base64/**/*", | 
|  | "ojluni/src/test/java/util/Scanner/**/*", | 
|  | "ojluni/src/test/java/util/Properties/**/*", | 
|  | ], | 
|  | exclude_srcs: ["ojluni/src/test/java/**/*.java"], | 
|  | } | 
|  |  | 
|  | // Builds the core-tests library. | 
|  | java_test { | 
|  | name: "core-tests", | 
|  | visibility: [ | 
|  | "//art/build/sdk", | 
|  | "//cts/tests/libcore/luni", | 
|  | ], | 
|  | defaults: ["libcore_java_defaults"], | 
|  | hostdex: true, | 
|  | srcs: [ | 
|  | "dalvik/src/test/java/**/*.java", | 
|  | "dalvik/test-rules/src/test/java/**/*.java", | 
|  | "dom/src/test/java/**/*.java", | 
|  | "harmony-tests/src/test/java/**/*.java", | 
|  | "json/src/test/java/**/*.java", | 
|  | "luni/src/test/java/**/*.java", | 
|  | "test-rules/src/test/java/**/*.java", | 
|  | "xml/src/test/java/**/*.java", | 
|  | ], | 
|  | exclude_srcs: [ | 
|  | "harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/*.java", | 
|  | "luni/src/test/java/libcore/java/util/zip/Zip64Test.java", | 
|  | "luni/src/test/java/libcore/java/util/zip/Zip64FileTest.java", | 
|  | "luni/src/test/java/libcore/javax/crypto/**/*.java", | 
|  | "luni/src/test/java/libcore/javax/net/ssl/**/*.java", | 
|  | "luni/src/test/java/org/apache/harmony/crypto/**/*.java", | 
|  | ], | 
|  |  | 
|  | java_resource_dirs: [ | 
|  | "*/src/test/java", | 
|  | "*/src/test/resources", | 
|  | ], | 
|  | exclude_java_resource_dirs: [ | 
|  | "ojluni/src/test/java", | 
|  | "ojluni/src/test/javax", | 
|  | "ojluni/src/test/resources", | 
|  | ], | 
|  |  | 
|  | java_resources: [ | 
|  | ":annotations-test", | 
|  | ":filesystemstest", | 
|  | ":parameter-metadata-test", | 
|  | ":core-tests-smali-dex", | 
|  | ], | 
|  |  | 
|  | sdk_version: "none", | 
|  | system_modules: "core-all-system-modules", | 
|  | libs: [ | 
|  | "okhttp", | 
|  | "bouncycastle", | 
|  | ], | 
|  |  | 
|  | static_libs: [ | 
|  | "apache-xml-tests", | 
|  | "core-compat-test-rules", | 
|  | "core-java-9-compatibility-tests", | 
|  | "core-java-9-language-tests", | 
|  | "core-java-11-language-tests", | 
|  | "core-java-17-language-tests", | 
|  | "core-java-21-language-tests", | 
|  | "core-test-rules", | 
|  | "core-tests-support", | 
|  | "junit-params", | 
|  | "libcore-crypto-tests", | 
|  | "mockftpserver", | 
|  | "mockito-target", | 
|  | "mockwebserver", | 
|  | "nist-pkix-tests", | 
|  | "slf4j-jdk14", | 
|  | "sqlite-jdbc", | 
|  | ], | 
|  |  | 
|  | errorprone: { | 
|  | javacflags: [ | 
|  | "-Xep:TryFailThrowable:ERROR", | 
|  | "-Xep:ComparisonOutOfRange:ERROR", | 
|  | "-Xep:DoNotCall:OFF", | 
|  | "-Xep:ArrayToString:WARN", | 
|  | "-Xep:SelfEquals:WARN", | 
|  | "-Xep:SelfComparison:WARN", | 
|  | "-Xep:ReturnValueIgnored:WARN", | 
|  | "-Xep:BoxedPrimitiveEquality:WARN", | 
|  | "-Xep:SizeGreaterThanOrEqualsZero:WARN", | 
|  | "-Xep:MisusedDayOfYear:WARN", | 
|  | "-Xep:InvalidTimeZoneID:WARN", | 
|  | "-Xep:CollectionToArraySafeParameter:WARN", | 
|  | "-Xep:ModifyingCollectionWithItself:WARN", | 
|  | "-Xep:ComparableType:WARN", | 
|  | "-Xep:UnusedCollectionModifiedInPlace:WARN", | 
|  | "-Xep:HashtableContains:WARN", | 
|  | "-Xep:DoubleBraceInitialization:WARN", | 
|  | "-Xep:RandomModInteger:WARN", | 
|  | "-Xep:IdentityBinaryExpression:WARN", | 
|  | "-Xep:UnnecessaryStringBuilder:OFF", // https://github.com/google/error-prone/issues/4195 | 
|  | // Some of the invalid regexes in the tests cause java to throw | 
|  | // an exception that contains a null byte. The null byte is then | 
|  | // printed by errorprone to the build log, causing some tools to | 
|  | // think the build log is a binary file. Disable instead of demoting | 
|  | // to a warning. | 
|  | "-Xep:InvalidPatternSyntax:OFF", | 
|  | ], | 
|  | }, | 
|  |  | 
|  | test_config: "AndroidTest-core-tests.xml", | 
|  | } | 
|  |  | 
|  | java_test { | 
|  | name: "libcore-crypto-tests", | 
|  |  | 
|  | visibility: [ | 
|  | "//art/build/sdk", | 
|  | "//external/conscrypt/apex/tests", | 
|  | ], | 
|  | exclude_srcs: [ | 
|  | "luni/src/test/java/libcore/javax/crypto/CipherTest.java", | 
|  | ], | 
|  | srcs: [ | 
|  | "harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/*.java", | 
|  | "luni/src/test/java/libcore/javax/crypto/**/*.java", | 
|  | "luni/src/test/java/libcore/javax/net/ssl/**/*.java", | 
|  | "luni/src/test/java/libcore/libcore/util/SerializationTester.java", | 
|  | "luni/src/test/java/libcore/sun/security/**/*.java", | 
|  | "luni/src/test/java/org/apache/harmony/crypto/**/*.java", | 
|  | ], | 
|  |  | 
|  | java_resource_dirs: [ | 
|  | "luni/src/test/java", | 
|  | "luni/src/test/resources", | 
|  | "support/src/test/java", | 
|  | ], | 
|  |  | 
|  | sdk_version: "none", | 
|  | system_modules: "core-all-system-modules", | 
|  |  | 
|  | static_libs: [ | 
|  | "core-test-rules", | 
|  | "core-tests-support", | 
|  | "junit-params", | 
|  | "mockito-target", | 
|  | ], | 
|  |  | 
|  | errorprone: { | 
|  | javacflags: [ | 
|  | "-Xep:ArrayToString:WARN", | 
|  | "-Xep:ReturnValueIgnored:WARN", | 
|  | ], | 
|  | }, | 
|  | } | 
|  |  | 
|  | java_genrule { | 
|  | name: "libcore-non-cts-tests-txt", | 
|  | srcs: [ | 
|  | ":apache-harmony-tests{.jar}", | 
|  | ":conscrypt-tests{.jar}", | 
|  | ":core-tests{.jar}", | 
|  | ":core-ojtests{.jar}", | 
|  | ], | 
|  | tools: ["non-cts-json-generator"], | 
|  | out: ["libcore-non-cts-tests.txt"], | 
|  | cmd: "$(location non-cts-json-generator) $(in) > $(out)", | 
|  | } | 
|  |  | 
|  | // Exports annotated stubs source files in ojluni/annotations/sdk to make them | 
|  | // available to metalava. Used for nullability annotations in OpenJDK source. | 
|  | droiddoc_exported_dir { | 
|  | name: "ojluni-annotated-sdk-stubs", | 
|  | visibility: [ | 
|  | "//libcore:__subpackages__", | 
|  | ], | 
|  | path: "ojluni/annotations/sdk", | 
|  | } | 
|  |  | 
|  | droiddoc_exported_dir { | 
|  | name: "ojluni-annotated-nullability-stubs", | 
|  | path: "ojluni/annotations/sdk/nullability", | 
|  | } | 
|  |  | 
|  | // Exports annotated stubs source files in ojluni/annotations/mmodules to make | 
|  | // them available to metalava. Used for core platform API and intra-core API | 
|  | // annotations in OpenJDK source. | 
|  | droiddoc_exported_dir { | 
|  | name: "ojluni-annotated-mmodule-stubs", | 
|  | visibility: [ | 
|  | "//libcore/mmodules/intracoreapi", | 
|  | ], | 
|  | path: "ojluni/annotations/mmodule", | 
|  | } | 
|  |  | 
|  | droiddoc_exported_dir { | 
|  | name: "ojluni-annotated-flagged-stubs", | 
|  | path: "ojluni/annotations/flagged_api", | 
|  | visibility: ["//visibility:private"], | 
|  | } | 
|  |  | 
|  | droiddoc_exported_dir { | 
|  | name: "toolchainapi-annotated-flagged-stubs", | 
|  | path: "ojluni/annotations/flagged_toolchainapi", | 
|  | visibility: ["//libcore/toolchainapi"], | 
|  | } | 
|  |  | 
|  | // A file containing the list of tags that are "known" to us from the OpenJdk | 
|  | // source code and so should not cause an error or warning. | 
|  | filegroup { | 
|  | name: "known-oj-tags", | 
|  | visibility: [ | 
|  | "//frameworks/base", | 
|  | "//frameworks/base/api", | 
|  | ], | 
|  | srcs: [ | 
|  | "known_oj_tags.txt", | 
|  | ], | 
|  | } | 
|  |  | 
|  | // A special set of stubs containing the minimal set of self consistent | 
|  | // classes for which a system module can be created. Every system module must | 
|  | // contain the java.lang classes so the set was constructed by starting with | 
|  | // the java.lang classes and then adding their transitive dependencies without | 
|  | // splitting packages. So, if one class from a package is used then all classes | 
|  | // in that package were added to the set. | 
|  | // | 
|  | // Needed for java-current-stubs-system-modules. | 
|  | droidstubs { | 
|  | name: "java-current-stubs-source", | 
|  | srcs: [ | 
|  | ":core_oj_api_files", | 
|  | ":core_libart_api_files", | 
|  | ], | 
|  | installable: false, | 
|  | sdk_version: "none", | 
|  | system_modules: "none", | 
|  |  | 
|  | args: "--stub-packages java.*:javax.*:org.w3c.dom.*:org.xml.sax.*", | 
|  | } | 
|  |  | 
|  | // Generates stub files for the classes exposed in the public API, without | 
|  | // javadoc. This can be used as a starting point for adding a new file to | 
|  | // libcore/luni/annotations/flagged_api. | 
|  | droidstubs { | 
|  | name: "libart-sdk-stubs-no-javadoc", | 
|  | srcs: [ | 
|  | ":core_libart_api_files", | 
|  | // The definition of @SystemApi is needed to generate module-lib stubs. | 
|  | ":framework-api-annotations", | 
|  | ], | 
|  | installable: false, | 
|  | sdk_version: "none", | 
|  | system_modules: "none", | 
|  | api_levels_sdk_type: "module-lib", | 
|  | flags: [ | 
|  | "--exclude-documentation-from-stubs", | 
|  | "--show-for-stub-purposes-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.MODULE_LIBRARIES\\)", | 
|  | ], | 
|  | } | 
|  |  | 
|  | // Separate @FlaggedApi annotations for luni/ to avoid a circular dependency between | 
|  | // libcore_aconfig_flags_lib and core-all | 
|  | droiddoc_exported_dir { | 
|  | name: "luni-annotated-flagged-stubs", | 
|  | path: "luni/annotations/flagged_api", | 
|  | visibility: ["//visibility:private"], | 
|  | } | 
|  |  | 
|  | java_library { | 
|  | name: "java.current.stubs", | 
|  | srcs: [":java-current-stubs-source"], | 
|  | errorprone: { | 
|  | javacflags: [ | 
|  | "-Xep:MissingOverride:OFF", | 
|  | ], | 
|  | }, | 
|  | patch_module: "java.base", | 
|  | sdk_version: "none", | 
|  | system_modules: "none", | 
|  | } | 
|  |  | 
|  | // A special set of system modules needed to build art.module.public.api | 
|  | java_system_modules { | 
|  | name: "java-current-stubs-system-modules", | 
|  | libs: [ | 
|  | // Minimal set of classes required for a system module. | 
|  | "java.current.stubs", | 
|  | ], | 
|  | } | 
|  |  | 
|  | java_library { | 
|  | name: "framework-api-annotations-lib", | 
|  | srcs: [":framework-api-annotations"], | 
|  | static_libs: ["aconfig-annotations-lib-sdk-none"], | 
|  | sdk_version: "none", | 
|  | patch_module: "java.base", | 
|  | system_modules: "core-all-system-modules", | 
|  | installable: false, | 
|  | visibility: [ | 
|  | "//art/build/flags", | 
|  | "//libcore:__subpackages__", | 
|  | ], | 
|  | } | 
|  |  | 
|  | aconfig_declarations { | 
|  | name: "libcore-aconfig-flags", | 
|  | package: "com.android.libcore", | 
|  | container: "com.android.art", | 
|  | exportable: true, | 
|  | srcs: ["libcore.aconfig"], | 
|  | visibility: [ | 
|  | "//libcore:__subpackages__", | 
|  | "//frameworks/base", | 
|  | ], | 
|  | } | 
|  |  | 
|  | java_system_modules { | 
|  | name: "libcore-bootstrap-core-current-from-text-system-modules", | 
|  | libs: ["core.current.stubs.from-text"], | 
|  | visibility: ["//visibility:private"], | 
|  | } | 
|  |  | 
|  | java_library { | 
|  | name: "libcore-bootstrap-lib-for-flags-lib", | 
|  | srcs: [ | 
|  | // Needs @UnsupportedAppUsage definition from this source | 
|  | ":app-compat-annotations-source", | 
|  | // Needs @AssumeFalseForR8 and AconfigFlagAccessor from this source | 
|  | ":framework-api-annotations", | 
|  | // Needs LambdaMetafactory due to lambda usage in the lib | 
|  | ":openjdk_lambda_stub_files", | 
|  | ], | 
|  | sdk_version: "none", | 
|  | patch_module: "java.base", | 
|  | system_modules: "libcore-bootstrap-core-current-from-text-system-modules", | 
|  | installable: false, | 
|  | visibility: [ | 
|  | "//visibility:private", | 
|  | ], | 
|  | } | 
|  |  | 
|  | // We need this system module because openjdk_lambda_stub_files and core.current.stubs.from-text | 
|  | // need to be in the same module. Otherwise, javac isn't happy to use the LambdaMetaFactory if | 
|  | // it's not in the system module. | 
|  | java_system_modules { | 
|  | name: "libcore-bootstrap-lib-for-flags-lib-system-modules", | 
|  | libs: [ | 
|  | "core.current.stubs.from-text", | 
|  | "libcore-bootstrap-lib-for-flags-lib", | 
|  | ], | 
|  | visibility: ["//visibility:private"], | 
|  | } | 
|  |  | 
|  | java_aconfig_library { | 
|  | name: "libcore-aconfig-flags-lib-for-core-all-only", | 
|  | aconfig_declarations: "libcore-aconfig-flags", | 
|  | // This system module is specifically crafted to avoid a circular dependency on core-all. | 
|  | // Instead of dependency on core-all, this system module contains the stubs generated from | 
|  | // API files, e.g. libcore/api/current.txt. See "core.current.stubs.from-text" for more details. | 
|  | // An alternative is to generate the .java source files of this lib without running javac, | 
|  | // but it wasn't possible using java_aconfig_library when this comment is written. | 
|  | system_modules: "libcore-bootstrap-lib-for-flags-lib-system-modules", | 
|  | sdk_version: "none", | 
|  | patch_module: "java.base", | 
|  | installable: false, | 
|  | visibility: ["//visibility:private"], | 
|  | } | 
|  |  | 
|  | java_aconfig_library { | 
|  | name: "art-aconfig-flags-java-lib-for-core-all-only", | 
|  | aconfig_declarations: "art-aconfig-flags", | 
|  | system_modules: "libcore-bootstrap-lib-for-flags-lib-system-modules", | 
|  | sdk_version: "none", | 
|  | patch_module: "java.base", | 
|  | installable: false, | 
|  | visibility: ["//visibility:private"], | 
|  | } | 
|  |  | 
|  | java_aconfig_library { | 
|  | name: "libcore-aconfig-flags-lib", | 
|  | aconfig_declarations: "libcore-aconfig-flags", | 
|  | sdk_version: "none", | 
|  | patch_module: "java.base", | 
|  | system_modules: "core-all-system-modules", | 
|  | libs: ["framework-api-annotations-lib"], | 
|  | min_sdk_version: "31", // ART module is enabled on Android 12 or above. | 
|  | apex_available: [ | 
|  | "com.android.art", | 
|  | "com.android.art.debug", | 
|  | ], | 
|  | visibility: [ | 
|  | "//libcore:__subpackages__", | 
|  | ], | 
|  | } | 
|  |  | 
|  | // Define the public SDK API provided by the ART module. | 
|  | java_sdk_library { | 
|  | name: "art.module.public.api", | 
|  | visibility: [ | 
|  | "//art/build/sdk", | 
|  | "//build/soong/java/core-libraries", | 
|  | "//frameworks/base", | 
|  | "//frameworks/base/api", | 
|  |  | 
|  | // DO NOT REMOVE: Legacy visibility, needed for snapshots that are | 
|  | // generated for the S build. | 
|  | "//libcore/mmodules/core_platform_api", | 
|  | ], | 
|  | srcs: [ | 
|  | ":core_oj_api_files", | 
|  | ":core_libart_api_files", | 
|  |  | 
|  | // Some source files in :core_oj_api_files and :openjdk_mmodule_extra_files are | 
|  | // annotated by applying annotations to the .annotated.java stubs files in | 
|  | // ojluni/annotated/mmodules and rather than in the original source. See the comments | 
|  | // in openjdk_java_files.bp for more details. | 
|  | ":openjdk_mmodule_extra_files", | 
|  | ":okhttp_api_files", | 
|  | ], | 
|  | api_srcs: [ | 
|  | ":openjdk_javadoc_only_files", | 
|  | ], | 
|  | libs: [ | 
|  | // Put framework-api-annotations into libs to avoid exposing the definition of framework's | 
|  | // annotations from libcore (wrong place) instead of framework (correct place). | 
|  | "framework-api-annotations-lib", | 
|  | // Provide access to I18N constants that are used to initialize | 
|  | // constants in the public API. i.e. to allow the value of the | 
|  | // java.text.CollectionElementIterator.NULLORDER to be initialized from | 
|  | // android.icu.text.CollationElementIterator.NULLORDER. | 
|  | "i18n.module.intra.core.api.stubs", | 
|  | "art-aconfig-flags-java-lib", | 
|  | "libcore-aconfig-flags-lib", | 
|  | ], | 
|  | stub_only_static_libs: ["notices-for-stubs-jar"], | 
|  |  | 
|  | // Make dex jars for the stubs available for use by hiddenapi processing. | 
|  | compile_dex: true, | 
|  |  | 
|  | public: { | 
|  | enabled: true, | 
|  | }, | 
|  | system: { | 
|  | enabled: true, | 
|  | }, | 
|  | module_lib: { | 
|  | enabled: true, | 
|  | }, | 
|  |  | 
|  | api_only: true, | 
|  | droiddoc_options: [ | 
|  | "--force-convert-to-warning-nullability-annotations +*:-android.*:+android.icu.*:-dalvik.* ", | 
|  | "--hide-annotation libcore.api.Hide", | 
|  | ], | 
|  |  | 
|  | merge_inclusion_annotations_dirs: [ | 
|  | "luni-annotated-flagged-stubs", | 
|  | "ojluni-annotated-flagged-stubs", | 
|  | "ojluni-annotated-mmodule-stubs", | 
|  | ], | 
|  | // Emit nullability annotations from the source to the stub files. | 
|  | annotations_enabled: true, | 
|  |  | 
|  | merge_annotations_dirs: [ | 
|  | "metalava-manual", | 
|  | "ojluni-annotated-sdk-stubs", | 
|  | ], | 
|  |  | 
|  | doctag_files: [ | 
|  | ":known-oj-tags", | 
|  | ], | 
|  |  | 
|  | errorprone: { | 
|  | javacflags: [ | 
|  | "-Xep:MissingOverride:OFF", | 
|  | ], | 
|  | }, | 
|  | patch_module: "java.base", | 
|  | sdk_version: "none", | 
|  | system_modules: "java-current-stubs-system-modules", | 
|  | // The base name for the artifacts that are automatically published to the | 
|  | // dist and which end up in one of the sub-directories of prebuilts/sdk. | 
|  | // As long as this matches the name of the artifacts in prebuilts/sdk then | 
|  | // the API will be checked for compatibility against the latest released | 
|  | // version of the API. | 
|  | dist_stem: "art", | 
|  | dist_group: "android", | 
|  | aconfig_declarations: [ | 
|  | "art-aconfig-flags", | 
|  | "libcore-aconfig-flags", | 
|  | ], | 
|  | } | 
|  |  | 
|  | // Target for validating nullability annotations for correctness and | 
|  | // completeness. To check that there are no nullability errors: | 
|  | //   m art-module-public-api-stubs-nullability-validation | 
|  | // To check that there are only the expected nullability warnings: | 
|  | //   m art-module-public-api-stubs-nullability-validation-check-nullability-warnings | 
|  | // (If that check fails, it will provide instructions on how to proceed, | 
|  | // including the command to run to update the expected warnings file.) | 
|  | droidstubs { | 
|  | name: "art-module-public-api-stubs-nullability-validation", | 
|  | srcs: [":art_module_api_files"], | 
|  | installable: false, | 
|  | sdk_version: "none", | 
|  | system_modules: "none", | 
|  | annotations_enabled: true, | 
|  | args: "--hide-annotation libcore.api.Hide " + | 
|  | "--validate-nullability-from-merged-stubs ", | 
|  | merge_inclusion_annotations_dirs: ["ojluni-annotated-mmodule-stubs"], | 
|  | merge_annotations_dirs: [ | 
|  | // N.B. Stubs in this filegroup will be validated: | 
|  | "ojluni-annotated-nullability-stubs", | 
|  | ], | 
|  | // The list of classes which have nullability annotations included in the source. | 
|  | // (This is in addition to those which have annotations in the merged stubs.) | 
|  | validate_nullability_from_list: "nullability_annotated_classes.txt", | 
|  | // The expected set of warnings about missing annotations: | 
|  | check_nullability_warnings: "nullability_warnings.txt", | 
|  | } | 
|  |  | 
|  | // A special set of system modules for building the following library for use | 
|  | // in the art-module-public-api-system-modules. | 
|  | java_system_modules { | 
|  | name: "api-annotations-system-modules", | 
|  | libs: [ | 
|  | "art.module.public.api.stubs", | 
|  | ], | 
|  | } | 
|  |  | 
|  | // A library that contains annotations that define API surfaces (core | 
|  | // platform, intra core and the hidden API) along with some supporting | 
|  | // constants. The annotations are source only and do not introduce any runtime | 
|  | // dependencies. Specially built for use in system modules definitions to | 
|  | // avoid introducing compile time cycles. | 
|  | java_library { | 
|  | name: "art.module.api.annotations.for.system.modules", | 
|  | visibility: [ | 
|  | "//build/soong/java/core-libraries", | 
|  | ], | 
|  | srcs: [ | 
|  | ":api_surface_annotation_files", | 
|  | ], | 
|  |  | 
|  | installable: false, | 
|  | sdk_version: "none", | 
|  | system_modules: "api-annotations-system-modules", | 
|  | patch_module: "java.base", | 
|  | // This jar is packaged as part of the SDK, use -target 8 so that it works | 
|  | // with old JDKs. | 
|  | java_version: "1.8", | 
|  | } | 
|  |  | 
|  | // Create a library containing the api surface annotations, built against | 
|  | // core_current for use by the annotation processor in frameworks/base. | 
|  | java_library { | 
|  | name: "art.module.api.annotations", | 
|  | visibility: [ | 
|  | "//art/build/sdk", | 
|  | "//external/icu/android_icu4j", | 
|  | "//frameworks/base", | 
|  | "//frameworks/base/api", | 
|  | ], | 
|  | host_supported: true, | 
|  | srcs: [ | 
|  | ":api_surface_annotation_files", | 
|  | ], | 
|  | sdk_version: "core_current", | 
|  | // Make sure that this will be added to the sdk snapshot for S. | 
|  | min_sdk_version: "S", | 
|  | // This jar is packaged as part of the ART module host exports, use -target 8 so that it works | 
|  | // with old JDKs. | 
|  | java_version: "1.8", | 
|  | } |