diff options
| author | 2024-01-19 00:22:22 +0000 | |
|---|---|---|
| committer | 2024-01-30 01:59:51 +0000 | |
| commit | 3cf0463a470549d3faea79cea5e1ae5573243a78 (patch) | |
| tree | a47cf4242bda62f436aebc13c3ea6148e9c24b0f /java/java.go | |
| parent | 2b6dfb554d3332b26ef293b7c9618bbe4e47f20d (diff) | |
Support mechanism to select a specific version of module sdk prebuilt
This CL is the java_(test_)_import equivalent of aosp/2928483.
With trunk stable, we will have
multiple prebuilts of the prebuilt java .jars in
prebuilts/module_sdk/art/<v>/test-exports/, and this CL introduces a
mechanism to use apex_contributions to select a specific versioned
prebuilt when building.
Implementation details: Create a new source_module_name property to
identify the root module. rdeps referring to the root module will get
redirected if necessary. This property also
becomes the stem, if `stem` is not set explicitly.
Bug: 322175508
Test: Added a unit test
Change-Id: I2dff38acdf2002355586dbb2be8c1f98af4741f7
Diffstat (limited to 'java/java.go')
| -rw-r--r-- | java/java.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/java/java.go b/java/java.go index d18d915cc..38690b115 100644 --- a/java/java.go +++ b/java/java.go @@ -2089,6 +2089,11 @@ type ImportProperties struct { // that depend on this module, as well as to aidl for this module. Export_include_dirs []string } + + // 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 } type Import struct { @@ -2162,12 +2167,16 @@ func (j *Import) PrebuiltSrcs() []string { return j.properties.Jars } +func (j *Import) BaseModuleName() string { + return proptools.StringDefault(j.properties.Source_module_name, j.ModuleBase.Name()) +} + func (j *Import) Name() string { return j.prebuilt.Name(j.ModuleBase.Name()) } func (j *Import) Stem() string { - return proptools.StringDefault(j.properties.Stem, j.ModuleBase.Name()) + return proptools.StringDefault(j.properties.Stem, j.BaseModuleName()) } func (a *Import) JacocoReportClassesFile() android.Path { |