diff options
Diffstat (limited to 'java/java.go')
| -rw-r--r-- | java/java.go | 36 |
1 files changed, 10 insertions, 26 deletions
diff --git a/java/java.go b/java/java.go index e83678ed1..3b0ad8d9f 100644 --- a/java/java.go +++ b/java/java.go @@ -876,7 +876,6 @@ func LibraryFactory() android.Module { module.initModuleAndImport(module) android.InitApexModule(module) - android.InitSdkAwareModule(module) android.InitBazelModule(module) InitJavaModule(module, android.HostAndDeviceSupported) return module @@ -899,7 +898,6 @@ func LibraryHostFactory() android.Module { module.Module.properties.Installable = proptools.BoolPtr(true) android.InitApexModule(module) - android.InitSdkAwareModule(module) android.InitBazelModule(module) InitJavaModule(module, android.HostSupported) return module @@ -1340,7 +1338,6 @@ func TestFactory() android.Module { module.Module.dexpreopter.isTest = true module.Module.linter.properties.Lint.Test = proptools.BoolPtr(true) - android.InitSdkAwareModule(module) InitJavaModule(module, android.HostAndDeviceSupported) return module } @@ -1379,7 +1376,6 @@ func JavaTestImportFactory() android.Module { android.InitPrebuiltModule(module, &module.properties.Jars) android.InitApexModule(module) - android.InitSdkAwareModule(module) InitJavaModule(module, android.HostAndDeviceSupported) return module } @@ -1802,7 +1798,6 @@ type Import struct { android.ApexModuleBase android.BazelModuleBase prebuilt android.Prebuilt - android.SdkBase // Functionality common to Module and Import. embeddableInModuleAndImport @@ -2005,15 +2000,7 @@ func (j *Import) GenerateAndroidBuildActions(ctx android.ModuleContext) { j.dexpreopter.uncompressedDex = *j.dexProperties.Uncompress_dex var dexOutputFile android.OutputPath - dexParams := &compileDexParams{ - flags: flags, - sdkVersion: j.SdkVersion(ctx), - minSdkVersion: j.MinSdkVersion(ctx), - classesJar: outputFile, - jarName: jarName, - } - - dexOutputFile = j.dexer.compileDex(ctx, dexParams) + dexOutputFile = j.dexer.compileDex(ctx, flags, j.MinSdkVersion(ctx), outputFile, jarName) if ctx.Failed() { return } @@ -2184,7 +2171,6 @@ func ImportFactory() android.Module { android.InitPrebuiltModule(module, &module.properties.Jars) android.InitApexModule(module) - android.InitSdkAwareModule(module) android.InitBazelModule(module) InitJavaModule(module, android.HostAndDeviceSupported) return module @@ -2689,7 +2675,7 @@ func (m *Library) convertLibraryAttrsBp2Build(ctx android.TopDownMutatorContext) if m.properties.Libs != nil { // TODO 244210934 ALIX Check if this else statement breaks presubmits get rid of it if it doesn't - if strings.HasPrefix(ctx.ModuleType(), "java_binary") || strings.HasPrefix(ctx.ModuleType(), "java_library") { + if strings.HasPrefix(ctx.ModuleType(), "java_binary") || strings.HasPrefix(ctx.ModuleType(), "java_library") || ctx.ModuleType() == "android_library" { for _, d := range m.properties.Libs { neverlinkLabel := android.BazelLabelForModuleDepSingle(ctx, d) neverlinkLabel.Label = neverlinkLabel.Label + "-neverlink" @@ -2764,14 +2750,6 @@ func javaLibraryBp2Build(ctx android.TopDownMutatorContext, m *Library) { Rule_class: "java_library", Bzl_load_location: "//build/bazel/rules/java:library.bzl", } - - ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: name}, attrs) - neverlinkProp := true - neverLinkAttrs := &javaLibraryAttributes{ - Exports: bazel.MakeSingleLabelListAttribute(bazel.Label{Label: ":" + name}), - Neverlink: bazel.BoolAttribute{Value: &neverlinkProp}, - } - ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: name + "-neverlink"}, neverLinkAttrs) } else { attrs.Common_srcs = bazel.MakeLabelListAttribute(android.BazelLabelForModuleSrc(ctx, m.properties.Common_srcs)) @@ -2779,10 +2757,16 @@ func javaLibraryBp2Build(ctx android.TopDownMutatorContext, m *Library) { Rule_class: "kt_jvm_library", Bzl_load_location: "@rules_kotlin//kotlin:jvm_library.bzl", } - // TODO (b/244210934): create neverlink-duplicate target once kt_jvm_library supports neverlink attribute - ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: name}, attrs) } + ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: name}, attrs) + neverlinkProp := true + neverLinkAttrs := &javaLibraryAttributes{ + Exports: bazel.MakeSingleLabelListAttribute(bazel.Label{Label: ":" + name}), + Neverlink: bazel.BoolAttribute{Value: &neverlinkProp}, + } + ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: name + "-neverlink"}, neverLinkAttrs) + } type javaBinaryHostAttributes struct { |