diff options
Diffstat (limited to 'java/java.go')
-rw-r--r-- | java/java.go | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/java/java.go b/java/java.go index 4460053f8..1d572faef 100644 --- a/java/java.go +++ b/java/java.go @@ -606,10 +606,8 @@ func getJavaVersion(ctx android.ModuleContext, javaVersion string, sdkContext an } else if ctx.Device() { return defaultJavaLanguageVersion(ctx, sdkContext.SdkVersion(ctx)) } else if ctx.Config().TargetsJava21() { - // Temporary experimental flag to be able to try and build with - // java version 21 options. The flag, if used, just sets Java - // 21 as the default version, leaving any components that - // target an older version intact. + // Build flag that controls whether Java 21 is used as the default + // target version, or Java 17. return JAVA_VERSION_21 } else { return JAVA_VERSION_17 @@ -944,6 +942,7 @@ func (j *Library) GenerateAndroidBuildActions(ctx android.ModuleContext) { // Even though the source javalib is not used, we need to hide it to prevent duplicate installation rules. // TODO (b/331665856): Implement a principled solution for this. j.HideFromMake() + j.SkipInstall() } j.provideHiddenAPIPropertyInfo(ctx) @@ -1301,16 +1300,6 @@ type testProperties struct { // host test. Device_first_data []string `android:"path_device_first"` - // same as data, but adds dependencies using the device's os variation, the device's first - // architecture's variation, and the vendor image variation. Can be used to add a module built - // for device to the data of a host test. - Device_first_vendor_data []string `android:"path_device_first_vendor"` - - // same as data, but adds dependencies using the device's os variation, the device's first - // architecture's variation, the vendor image variation, and the shared linkage variation. Can - // be used to add a module built for device to the data of a host test. - Device_first_vendor_shared_data []string `android:"path_device_first_vendor_shared"` - // same as data, but adds dependencies using the device's os variation and the device's first // 32-bit architecture's variation. If a 32-bit arch doesn't exist for this device, it will use // a 64 bit arch instead. Can be used to add a module built for device to the data of a @@ -1608,8 +1597,6 @@ func (j *Test) generateAndroidBuildActionsWithConfig(ctx android.ModuleContext, j.data = append(j.data, android.PathsForModuleSrc(ctx, j.testProperties.Device_common_data)...) j.data = append(j.data, android.PathsForModuleSrc(ctx, j.testProperties.Device_first_data)...) j.data = append(j.data, android.PathsForModuleSrc(ctx, j.testProperties.Device_first_prefer32_data)...) - j.data = append(j.data, android.PathsForModuleSrc(ctx, j.testProperties.Device_first_vendor_data)...) - j.data = append(j.data, android.PathsForModuleSrc(ctx, j.testProperties.Device_first_vendor_shared_data)...) j.extraTestConfigs = android.PathsForModuleSrc(ctx, j.testProperties.Test_options.Extra_test_configs) @@ -1621,6 +1608,8 @@ func (j *Test) generateAndroidBuildActionsWithConfig(ctx android.ModuleContext, j.data = append(j.data, android.OutputFileForModule(ctx, dep, "")) }) + var directImplementationDeps android.Paths + var transitiveImplementationDeps []depset.DepSet[android.Path] ctx.VisitDirectDepsWithTag(jniLibTag, func(dep android.Module) { sharedLibInfo, _ := android.OtherModuleProvider(ctx, dep, cc.SharedLibraryInfoProvider) if sharedLibInfo.SharedLibrary != nil { @@ -1639,11 +1628,20 @@ func (j *Test) generateAndroidBuildActionsWithConfig(ctx android.ModuleContext, Output: relocatedLib, }) j.data = append(j.data, relocatedLib) + + directImplementationDeps = append(directImplementationDeps, android.OutputFileForModule(ctx, dep, "")) + if info, ok := android.OtherModuleProvider(ctx, dep, cc.ImplementationDepInfoProvider); ok { + transitiveImplementationDeps = append(transitiveImplementationDeps, info.ImplementationDeps) + } } else { ctx.PropertyErrorf("jni_libs", "%q of type %q is not supported", dep.Name(), ctx.OtherModuleType(dep)) } }) + android.SetProvider(ctx, cc.ImplementationDepInfoProvider, &cc.ImplementationDepInfo{ + ImplementationDeps: depset.New(depset.PREORDER, directImplementationDeps, transitiveImplementationDeps), + }) + j.Library.GenerateAndroidBuildActions(ctx) } @@ -3277,6 +3275,7 @@ func DefaultsFactory() android.Module { &JavaApiLibraryProperties{}, &bootclasspathFragmentProperties{}, &SourceOnlyBootclasspathProperties{}, + &ravenwoodTestProperties{}, ) android.InitDefaultsModule(module) |