summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/bootclasspath_fragment.go15
-rw-r--r--java/config/makevars.go2
-rw-r--r--java/core-libraries/Android.bp24
-rw-r--r--java/core-libraries/TxtStubLibraries.bp140
-rw-r--r--java/droiddoc.go2
-rw-r--r--java/droidstubs.go5
-rw-r--r--java/hiddenapi_modular.go4
7 files changed, 28 insertions, 164 deletions
diff --git a/java/bootclasspath_fragment.go b/java/bootclasspath_fragment.go
index d15dbc991..7d8a9f7bb 100644
--- a/java/bootclasspath_fragment.go
+++ b/java/bootclasspath_fragment.go
@@ -632,21 +632,6 @@ func (b *BootclasspathFragmentModule) generateHiddenAPIBuildActions(ctx android.
return output
}
-// retrieveLegacyEncodedBootDexFiles attempts to retrieve the legacy encoded boot dex jar files.
-func retrieveLegacyEncodedBootDexFiles(ctx android.ModuleContext, contents []android.Module) bootDexJarByModule {
- // If the current bootclasspath_fragment is the active module or a source module then retrieve the
- // encoded dex files, otherwise return an empty map.
- //
- // An inactive (i.e. not preferred) bootclasspath_fragment needs to retrieve the encoded dex jars
- // as they are still needed by an apex. An inactive prebuilt_bootclasspath_fragment does not need
- // to do so and may not yet have access to dex boot jars from a prebuilt_apex/apex_set.
- if isActiveModule(ctx.Module()) || !android.IsModulePrebuilt(ctx.Module()) {
- return extractEncodedDexJarsFromModules(ctx, contents)
- } else {
- return nil
- }
-}
-
// createHiddenAPIFlagInput creates a HiddenAPIFlagInput struct and initializes it with information derived
// from the properties on this module and its dependencies.
func (b *BootclasspathFragmentModule) createHiddenAPIFlagInput(ctx android.ModuleContext, contents []android.Module, fragments []android.Module) HiddenAPIFlagInput {
diff --git a/java/config/makevars.go b/java/config/makevars.go
index 4e0919537..649b6c58f 100644
--- a/java/config/makevars.go
+++ b/java/config/makevars.go
@@ -34,8 +34,6 @@ func makeVarsProvider(ctx android.MakeVarsContext) {
ctx.Strict("ANDROID_JAVA_HOME", "${JavaHome}")
ctx.Strict("ANDROID_JAVA8_HOME", "prebuilts/jdk/jdk8/${hostPrebuiltTag}")
- ctx.Strict("ANDROID_JAVA9_HOME", "prebuilts/jdk/jdk9/${hostPrebuiltTag}")
- ctx.Strict("ANDROID_JAVA11_HOME", "prebuilts/jdk/jdk11/${hostPrebuiltTag}")
ctx.Strict("ANDROID_JAVA_TOOLCHAIN", "${JavaToolchain}")
ctx.Strict("JAVA", "${JavaCmd} ${JavaVmFlags}")
ctx.Strict("JAVAC", "${JavacCmd} ${JavacVmFlags}")
diff --git a/java/core-libraries/Android.bp b/java/core-libraries/Android.bp
index 8b7387a85..c6ab5611a 100644
--- a/java/core-libraries/Android.bp
+++ b/java/core-libraries/Android.bp
@@ -207,6 +207,26 @@ java_library {
],
}
+java_api_library {
+ name: "core.module_lib.stubs.from-text",
+ api_surface: "module-lib",
+ api_contributions: [
+ "art.module.public.api.stubs.source.api.contribution",
+ "art.module.public.api.stubs.source.system.api.contribution",
+ "art.module.public.api.stubs.source.module_lib.api.contribution",
+
+ // Add the module-lib correspondence when Conscrypt or i18N module
+ // provides @SystemApi(MODULE_LIBRARIES). Currently, assume that only ART module provides
+ // @SystemApi(MODULE_LIBRARIES).
+ "conscrypt.module.public.api.stubs.source.api.contribution",
+ "i18n.module.public.api.stubs.source.api.contribution",
+ ],
+ libs: [
+ "stub-annotations",
+ ],
+ visibility: ["//visibility:private"],
+}
+
// Produces a dist file that is used by the
// prebuilts/sdk/update_prebuilts.py script to update the prebuilts/sdk
// directory.
@@ -504,7 +524,3 @@ java_system_modules {
"art-module-intra-core-api-stubs-system-modules-lib",
],
}
-
-build = [
- "TxtStubLibraries.bp",
-]
diff --git a/java/core-libraries/TxtStubLibraries.bp b/java/core-libraries/TxtStubLibraries.bp
deleted file mode 100644
index c46f8b8ea..000000000
--- a/java/core-libraries/TxtStubLibraries.bp
+++ /dev/null
@@ -1,140 +0,0 @@
-// Copyright (C) 2023 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.
-
-// This file contains java_system_modules provided by the SDK.
-// These system modules transitively depend on core stub libraries generated from .txt files.
-
-// Same as core-public-stubs-system-modules, but the stubs are generated from .txt files
-java_system_modules {
- name: "core-public-stubs-system-modules.from-text",
- visibility: ["//visibility:public"],
- libs: [
- "core-current-stubs-for-system-modules-no-annotations.from-text",
- ],
-}
-
-java_library {
- name: "core-current-stubs-for-system-modules-no-annotations.from-text",
- visibility: ["//visibility:private"],
- defaults: [
- "system-modules-no-annotations",
- ],
- static_libs: [
- "core.current.stubs.from-text",
- "core-lambda-stubs.from-text",
- ],
-}
-
-// Same as core-module-lib-stubs-system-modules, but the stubs are generated from .txt files
-java_system_modules {
- name: "core-module-lib-stubs-system-modules.from-text",
- visibility: ["//visibility:public"],
- libs: [
- "core-module-lib-stubs-for-system-modules-no-annotations.from-text",
- ],
-}
-
-java_library {
- name: "core-module-lib-stubs-for-system-modules-no-annotations.from-text",
- visibility: ["//visibility:private"],
- defaults: [
- "system-modules-no-annotations",
- ],
- static_libs: [
- "core.module_lib.stubs.from-text",
- "core-lambda-stubs.from-text",
- ],
-}
-
-java_api_library {
- name: "core.module_lib.stubs.from-text",
- api_surface: "module-lib",
- api_contributions: [
- "art.module.public.api.stubs.source.api.contribution",
- "art.module.public.api.stubs.source.system.api.contribution",
- "art.module.public.api.stubs.source.module_lib.api.contribution",
-
- // Add the module-lib correspondence when Conscrypt or i18N module
- // provides @SystemApi(MODULE_LIBRARIES). Currently, assume that only ART module provides
- // @SystemApi(MODULE_LIBRARIES).
- "conscrypt.module.public.api.stubs.source.api.contribution",
- "i18n.module.public.api.stubs.source.api.contribution",
- ],
- libs: [
- "stub-annotations",
- ],
- visibility: ["//visibility:private"],
-}
-
-// Same as legacy-core-platform-api-stubs-system-modules, but the stubs are generated from .txt files
-java_system_modules {
- name: "legacy-core-platform-api-stubs-system-modules.from-text",
- visibility: core_platform_visibility,
- libs: [
- "legacy.core.platform.api.no.annotations.stubs.from-text",
- "core-lambda-stubs.from-text",
- ],
-}
-
-java_library {
- name: "legacy.core.platform.api.no.annotations.stubs.from-text",
- visibility: core_platform_visibility,
- defaults: [
- "system-modules-no-annotations",
- ],
- hostdex: true,
- compile_dex: true,
-
- static_libs: [
- "legacy.core.platform.api.stubs.from-text",
- ],
- patch_module: "java.base",
-}
-
-// Same as stable-core-platform-api-stubs-system-modules, but the stubs are generated from .txt files
-java_system_modules {
- name: "stable-core-platform-api-stubs-system-modules.from-text",
- visibility: core_platform_visibility,
- libs: [
- "stable.core.platform.api.no.annotations.stubs.from-text",
- "core-lambda-stubs.from-text",
- ],
-}
-
-java_library {
- name: "stable.core.platform.api.no.annotations.stubs.from-text",
- visibility: core_platform_visibility,
- defaults: [
- "system-modules-no-annotations",
- ],
- hostdex: true,
- compile_dex: true,
-
- static_libs: [
- "stable.core.platform.api.stubs.from-text",
- ],
- patch_module: "java.base",
-}
-
-java_api_library {
- name: "core-lambda-stubs.from-text",
- api_surface: "toolchain",
- api_contributions: [
- "art.module.toolchain.api.api.contribution",
- ],
- libs: [
- // LambdaMetaFactory depends on CallSite etc. which is part of the Core API surface
- "core.current.stubs.from-text",
- ],
-}
diff --git a/java/droiddoc.go b/java/droiddoc.go
index 87588f377..f7d7de6ae 100644
--- a/java/droiddoc.go
+++ b/java/droiddoc.go
@@ -303,7 +303,7 @@ func (j *Javadoc) aidlFlags(ctx android.ModuleContext, aidlPreprocess android.Op
}
flags = append(flags, android.JoinWithPrefix(aidlIncludes.Strings(), "-I"))
- flags = append(flags, "-I"+android.PathForModuleSrc(ctx).String())
+ flags = append(flags, "-I"+ctx.ModuleDir())
if src := android.ExistentPathForSource(ctx, ctx.ModuleDir(), "src"); src.Valid() {
flags = append(flags, "-I"+src.String())
}
diff --git a/java/droidstubs.go b/java/droidstubs.go
index c000ac382..180ba92cf 100644
--- a/java/droidstubs.go
+++ b/java/droidstubs.go
@@ -775,6 +775,11 @@ func (d *Droidstubs) GenerateAndroidBuildActions(ctx android.ModuleContext) {
` m %s-update-current-api\n\n`+
` To submit the revised current.txt to the main Android repository,\n`+
` you will need approval.\n`+
+ `If your build failed due to stub validation, you can resolve the errors with\n`+
+ `either of the two choices above and try re-building the target.\n`+
+ `If the mismatch between the stubs and the current.txt is intended,\n`+
+ `you can try re-building the target by executing the following command:\n`+
+ `m DISABLE_STUB_VALIDATION=true <your build target>\n`+
`******************************\n`, ctx.ModuleName())
rule.Command().
diff --git a/java/hiddenapi_modular.go b/java/hiddenapi_modular.go
index 81be33dd1..fbc0197d6 100644
--- a/java/hiddenapi_modular.go
+++ b/java/hiddenapi_modular.go
@@ -358,7 +358,7 @@ func buildRuleToGenerateHiddenAPIStubFlagsFile(ctx android.BuilderContext, name,
// If there are stub flag files that have been generated by fragments on which this depends then
// use them to validate the stub flag file generated by the rules created by this method.
- if len(stubFlagSubsets) > 0 {
+ if !ctx.Config().DisableVerifyOverlaps() && len(stubFlagSubsets) > 0 {
validFile := buildRuleValidateOverlappingCsvFiles(ctx, name, desc, outputPath, stubFlagSubsets,
HIDDENAPI_STUB_FLAGS_IMPL_FLAGS)
@@ -1006,7 +1006,7 @@ func buildRuleToGenerateHiddenApiFlags(ctx android.BuilderContext, name, desc st
// If there are flag files that have been generated by fragments on which this depends then use
// them to validate the flag file generated by the rules created by this method.
- if len(flagSubsets) > 0 {
+ if !ctx.Config().DisableVerifyOverlaps() && len(flagSubsets) > 0 {
validFile := buildRuleValidateOverlappingCsvFiles(ctx, name, desc, outputPath, flagSubsets,
HIDDENAPI_FLAGS_CSV_IMPL_FLAGS)