diff options
Diffstat (limited to 'java/java.go')
| -rw-r--r-- | java/java.go | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/java/java.go b/java/java.go index d3e74fd1c..65bfce088 100644 --- a/java/java.go +++ b/java/java.go @@ -1156,7 +1156,6 @@ func (j *TestHost) DepsMutator(ctx android.BottomUpMutatorContext) { } j.addDataDeviceBinsDeps(ctx) - j.deps(ctx) } @@ -2710,8 +2709,13 @@ func (m *Library) convertJavaResourcesAttributes(ctx android.TopDownMutatorConte var resources bazel.LabelList var resourceStripPrefix *string + if m.properties.Java_resources != nil && len(m.properties.Java_resource_dirs) > 0 { + ctx.ModuleErrorf("bp2build doesn't support both java_resources and java_resource_dirs being set on the same module.") + } + if m.properties.Java_resources != nil { resources.Append(android.BazelLabelForModuleSrc(ctx, m.properties.Java_resources)) + resourceStripPrefix = proptools.StringPtr(ctx.ModuleDir()) } //TODO(b/179889880) handle case where glob includes files outside package @@ -2968,14 +2972,14 @@ type kotlinAttributes struct { func ktJvmLibraryBazelTargetModuleProperties() bazel.BazelTargetModuleProperties { return bazel.BazelTargetModuleProperties{ Rule_class: "kt_jvm_library", - Bzl_load_location: "//build/bazel/rules/kotlin:rules.bzl", + Bzl_load_location: "//build/bazel/rules/kotlin:kt_jvm_library.bzl", } } func javaLibraryBazelTargetModuleProperties() bazel.BazelTargetModuleProperties { return bazel.BazelTargetModuleProperties{ Rule_class: "java_library", - Bzl_load_location: "//build/bazel/rules/java:rules.bzl", + Bzl_load_location: "//build/bazel/rules/java:library.bzl", } } @@ -3084,7 +3088,7 @@ func javaBinaryHostBp2Build(ctx android.TopDownMutatorContext, m *Binary) { props := bazel.BazelTargetModuleProperties{ Rule_class: "java_binary", - Bzl_load_location: "//build/bazel/rules/java:rules.bzl", + Bzl_load_location: "@rules_java//java:defs.bzl", } binAttrs := &javaBinaryHostAttributes{ Runtime_deps: runtimeDeps, @@ -3140,7 +3144,7 @@ func (i *Import) ConvertWithBp2build(ctx android.TopDownMutatorContext) { } props := bazel.BazelTargetModuleProperties{ Rule_class: "java_import", - Bzl_load_location: "//build/bazel/rules/java:rules.bzl", + Bzl_load_location: "//build/bazel/rules/java:import.bzl", } name := android.RemoveOptionalPrebuiltPrefix(i.Name()) |