diff options
| author | Alix <agespino@google.com> | 2023-03-09 20:43:10 +0000 |
|---|---|---|
| committer | Alix Espino <agespino@google.com> | 2023-03-13 15:27:01 +0000 |
| commit | 82acaf545fd828a2a81bbab54a3eb700d924f579 (patch) | |
| tree | 7fa9119d2a49246ef4f387f687b6cdfac0d3bcff /java/java.go | |
| parent | eb33a1d474fb42576fb69ee289c39a05d8e80681 (diff) | |
Update load statements in java.go bp2build
load statements will all now point to rules.bzl files and won't have to
be constantly updated.
Bug: 271612705
Test: CI
Change-Id: I663b9730f1b5b333682ea301ce4d9a505626faaa
Diffstat (limited to 'java/java.go')
| -rw-r--r-- | java/java.go | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/java/java.go b/java/java.go index 63c4416bc..533e12fdb 100644 --- a/java/java.go +++ b/java/java.go @@ -2843,12 +2843,12 @@ func javaLibraryBp2Build(ctx android.TopDownMutatorContext, m *Library) { if !bp2BuildInfo.hasKotlin { props = bazel.BazelTargetModuleProperties{ Rule_class: "java_library", - Bzl_load_location: "//build/bazel/rules/java:library.bzl", + Bzl_load_location: "//build/bazel/rules/java:rules.bzl", } } else { props = bazel.BazelTargetModuleProperties{ Rule_class: "kt_jvm_library", - Bzl_load_location: "//build/bazel/rules/kotlin:kt_jvm_library.bzl", + Bzl_load_location: "//build/bazel/rules/kotlin:rules.bzl", } } @@ -2928,7 +2928,8 @@ func javaBinaryHostBp2Build(ctx android.TopDownMutatorContext, m *Binary) { } props := bazel.BazelTargetModuleProperties{ - Rule_class: "java_binary", + Rule_class: "java_binary", + Bzl_load_location: "//build/bazel/rules/java:rules.bzl", } attrs := &javaBinaryHostAttributes{ Runtime_deps: runtimeDeps, @@ -2943,7 +2944,7 @@ func javaBinaryHostBp2Build(ctx android.TopDownMutatorContext, m *Binary) { ktName := m.Name() + "_kt" ktProps := bazel.BazelTargetModuleProperties{ Rule_class: "kt_jvm_library", - Bzl_load_location: "//build/bazel/rules/kotlin:kt_jvm_library.bzl", + Bzl_load_location: "//build/bazel/rules/kotlin:rules.bzl", } ktAttrs := &javaLibraryAttributes{ @@ -2980,7 +2981,10 @@ func (i *Import) ConvertWithBp2build(ctx android.TopDownMutatorContext) { attrs := &bazelJavaImportAttributes{ Jars: jars, } - props := bazel.BazelTargetModuleProperties{Rule_class: "java_import"} + props := bazel.BazelTargetModuleProperties{ + Rule_class: "java_import", + Bzl_load_location: "//build/bazel/rules/java:rules.bzl", + } name := android.RemoveOptionalPrebuiltPrefix(i.Name()) @@ -2991,7 +2995,13 @@ func (i *Import) ConvertWithBp2build(ctx android.TopDownMutatorContext) { Neverlink: bazel.BoolAttribute{Value: &neverlink}, Exports: bazel.MakeSingleLabelListAttribute(bazel.Label{Label: ":" + name}), } - ctx.CreateBazelTargetModule(bazel.BazelTargetModuleProperties{Rule_class: "java_library"}, android.CommonAttributes{Name: name + "-neverlink"}, neverlinkAttrs) + ctx.CreateBazelTargetModule( + bazel.BazelTargetModuleProperties{ + Rule_class: "java_library", + Bzl_load_location: "//build/bazel/rules/java:rules.bzl", + }, + android.CommonAttributes{Name: name + "-neverlink"}, + neverlinkAttrs) } |
