Fix proto flags in java

Compute the common proto flags and pass them to the protoc invocation
when generating java files.

Test: m checkbuild
Change-Id: I0d4c23ad001d01eab03b404545383f009214106d
This commit is contained in:
Colin Cross 2017-11-14 13:11:23 -08:00
parent f18e11074d
commit d5dbfb78a0
2 changed files with 8 additions and 3 deletions

View file

@ -186,7 +186,7 @@ type javaBuilderFlags struct {
kotlincFlags string
kotlincClasspath classpath
protoFlags string
protoFlags []string
protoOutFlag string
}

View file

@ -15,6 +15,8 @@
package java
import (
"strings"
"github.com/google/blueprint"
"github.com/google/blueprint/proptools"
@ -39,7 +41,7 @@ var (
)
func genProto(ctx android.ModuleContext, outputSrcJar android.WritablePath,
protoFiles android.Paths, protoFlags string, protoOut, protoOutFlags string) {
protoFiles android.Paths, protoFlags []string, protoOut, protoOutFlags string) {
ctx.Build(pctx, android.BuildParams{
Rule: proto,
@ -50,7 +52,7 @@ func genProto(ctx android.ModuleContext, outputSrcJar android.WritablePath,
"outDir": android.ProtoDir(ctx).String(),
"protoOut": protoOut,
"protoOutFlags": protoOutFlags,
"protoFlags": protoFlags,
"protoFlags": strings.Join(protoFlags, " "),
},
})
}
@ -93,5 +95,8 @@ func protoFlags(ctx android.ModuleContext, p *android.ProtoProperties, flags jav
ctx.PropertyErrorf("proto.type", "unknown proto type %q",
proptools.String(p.Proto.Type))
}
flags.protoFlags = android.ProtoFlags(ctx, p)
return flags
}