diff options
author | 2024-02-06 17:54:58 +0000 | |
---|---|---|
committer | 2024-02-06 17:54:58 +0000 | |
commit | 7870d329a5c21132adc16a5974f66839c1422c16 (patch) | |
tree | 4687e3b7a0f8a196d2857d0f13d82ad400e7ebab /java/java.go | |
parent | d7e6bd8a04a3848ce767fd6722d266a785998059 (diff) | |
parent | 23956d12ab1789ca47dad453154292b522ba0bfa (diff) |
Merge "Mechanism to select a specific version of java_sdk_library_import" into main
Diffstat (limited to 'java/java.go')
-rw-r--r-- | java/java.go | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/java/java.go b/java/java.go index 30a3763a1..d7d271cca 100644 --- a/java/java.go +++ b/java/java.go @@ -2097,6 +2097,11 @@ type ImportProperties struct { // If unspecified, follows the naming convention that the source module of // the prebuilt is Name() without "prebuilt_" prefix Source_module_name *string + + // Non-nil if this java_import module was dynamically created by a java_sdk_library_import + // The name is the undecorated name of the java_sdk_library as it appears in the blueprint file + // (without any prebuilt_ prefix) + Created_by_java_sdk_library_name *string `blueprint:"mutated"` } type Import struct { @@ -2182,6 +2187,10 @@ func (j *Import) Stem() string { return proptools.StringDefault(j.properties.Stem, j.BaseModuleName()) } +func (j *Import) CreatedByJavaSdkLibraryName() *string { + return j.properties.Created_by_java_sdk_library_name +} + func (a *Import) JacocoReportClassesFile() android.Path { return nil } @@ -2833,7 +2842,20 @@ func addCLCFromDep(ctx android.ModuleContext, depModule android.Module, type JavaApiContributionImport struct { JavaApiContribution - prebuilt android.Prebuilt + prebuilt android.Prebuilt + prebuiltProperties javaApiContributionImportProperties +} + +type javaApiContributionImportProperties struct { + // Name of the source soong module that gets shadowed by this prebuilt + // If unspecified, follows the naming convention that the source module of + // the prebuilt is Name() without "prebuilt_" prefix + Source_module_name *string + + // Non-nil if this java_import module was dynamically created by a java_sdk_library_import + // The name is the undecorated name of the java_sdk_library as it appears in the blueprint file + // (without any prebuilt_ prefix) + Created_by_java_sdk_library_name *string `blueprint:"mutated"` } func ApiContributionImportFactory() android.Module { @@ -2841,7 +2863,7 @@ func ApiContributionImportFactory() android.Module { android.InitAndroidModule(module) android.InitDefaultableModule(module) android.InitPrebuiltModule(module, &[]string{""}) - module.AddProperties(&module.properties) + module.AddProperties(&module.properties, &module.prebuiltProperties) module.AddProperties(&module.sdkLibraryComponentProperties) return module } @@ -2854,6 +2876,14 @@ func (module *JavaApiContributionImport) Name() string { return module.prebuilt.Name(module.ModuleBase.Name()) } +func (j *JavaApiContributionImport) BaseModuleName() string { + return proptools.StringDefault(j.prebuiltProperties.Source_module_name, j.ModuleBase.Name()) +} + +func (j *JavaApiContributionImport) CreatedByJavaSdkLibraryName() *string { + return j.prebuiltProperties.Created_by_java_sdk_library_name +} + func (ap *JavaApiContributionImport) GenerateAndroidBuildActions(ctx android.ModuleContext) { ap.JavaApiContribution.GenerateAndroidBuildActions(ctx) } |