Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 88a1b9da authored by Sam Delmerico's avatar Sam Delmerico Committed by Gerrit Code Review
Browse files

Merge "Convert javacflags -> javacopts for java_binary_host"

parents 865d5e6c 4e27229b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ var fs = map[string]string{

func TestJavaBinaryHost(t *testing.T) {
	runJavaBinaryHostTestCase(t, bp2buildTestCase{
		description: "java_binary_host with srcs, exclude_srcs, jni_libs and manifest.",
		description: "java_binary_host with srcs, exclude_srcs, jni_libs, javacflags, and manifest.",
		filesystem:  fs,
		blueprint: `java_binary_host {
    name: "java-binary-host-1",
@@ -49,6 +49,7 @@ func TestJavaBinaryHost(t *testing.T) {
    exclude_srcs: ["b.java"],
    manifest: "test.mf",
    jni_libs: ["jni-lib-1"],
    javacflags: ["-Xdoclint:all/protected"],
    bazel_module: { bp2build_available: true },
}`,
		expectedBazelTargets: []string{
@@ -57,6 +58,7 @@ func TestJavaBinaryHost(t *testing.T) {
				"main_class": `"com.android.test.MainClass"`,
				"deps":       `["//other:jni-lib-1"]`,
				"jvm_flags":  `["-Djava.library.path=$${RUNPATH}other"]`,
				"javacopts":  `["-Xdoclint:all/protected"]`,
			}),
		},
	})
+6 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import (
	"strings"

	"android/soong/bazel"

	"github.com/google/blueprint"
	"github.com/google/blueprint/proptools"

@@ -2000,6 +2001,7 @@ type javaBinaryHostAttributes struct {
	Deps       bazel.LabelListAttribute
	Main_class string
	Jvm_flags  bazel.StringListAttribute
	Javacopts  bazel.StringListAttribute
}

// JavaBinaryHostBp2Build is for java_binary_host bp2build.
@@ -2021,6 +2023,10 @@ func javaBinaryHostBp2Build(ctx android.TopDownMutatorContext, m *Binary) {
		Main_class: mainClass,
	}

	if m.properties.Javacflags != nil {
		attrs.Javacopts = bazel.MakeStringListAttribute(m.properties.Javacflags)
	}

	// Attribute deps
	deps := []string{}
	if m.properties.Static_libs != nil {