Merge "Make javamicro a plugin"
am: fd26de477f
Change-Id: Ibb4cf9da092e3e04275a4d5f441e59d4fb6f9d02
This commit is contained in:
@@ -75,9 +75,11 @@ func protoFlags(ctx android.ModuleContext, j *CompilerProperties, p *android.Pro
|
||||
flags.proto = android.GetProtoFlags(ctx, p)
|
||||
|
||||
if String(p.Proto.Plugin) == "" {
|
||||
var typeToPlugin string
|
||||
switch String(p.Proto.Type) {
|
||||
case "micro":
|
||||
flags.proto.OutTypeFlag = "--javamicro_out"
|
||||
typeToPlugin = "javamicro"
|
||||
case "nano":
|
||||
flags.proto.OutTypeFlag = "--javanano_out"
|
||||
case "lite":
|
||||
@@ -89,6 +91,12 @@ func protoFlags(ctx android.ModuleContext, j *CompilerProperties, p *android.Pro
|
||||
ctx.PropertyErrorf("proto.type", "unknown proto type %q",
|
||||
String(p.Proto.Type))
|
||||
}
|
||||
|
||||
if typeToPlugin != "" {
|
||||
hostTool := ctx.Config().HostToolPath(ctx, "protoc-gen-"+typeToPlugin)
|
||||
flags.proto.Deps = append(flags.proto.Deps, hostTool)
|
||||
flags.proto.Flags = append(flags.proto.Flags, "--plugin=protoc-gen-"+typeToPlugin+"="+hostTool.String())
|
||||
}
|
||||
}
|
||||
|
||||
flags.proto.OutParams = append(flags.proto.OutParams, j.Proto.Output_params...)
|
||||
|
Reference in New Issue
Block a user