From 28b46fc16c026365378909f1cc88fad0d3b2395c Mon Sep 17 00:00:00 2001 From: Ulas Kirazci Date: Wed, 24 Jul 2013 14:32:14 -0700 Subject: [PATCH] Allow proto builds to pass in java proto params. Also source files which have dependencies need to be bundled together (at least the way the build system is set up now). Move --proto_path=$(TOP) to the end so that it does not take precedence over user-supplied --proto_path flags. Change-Id: Ia532647fe8811d39230a23ba3671685b0388cbe0 --- core/base_rules.mk | 1 + core/clear_vars.mk | 1 + core/definitions.mk | 10 ++++------ 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/base_rules.mk b/core/base_rules.mk index f0a6398649..f6497dabbe 100644 --- a/core/base_rules.mk +++ b/core/base_rules.mk @@ -264,6 +264,7 @@ $(proto_java_sources_file_stamp): PRIVATE_PROTO_JAVA_OUTPUT_OPTION := --java_out endif endif $(proto_java_sources_file_stamp): PRIVATE_PROTOC_FLAGS := $(LOCAL_PROTOC_FLAGS) +$(proto_java_sources_file_stamp): PRIVATE_PROTO_JAVA_OUTPUT_PARAMS := $(LOCAL_PROTO_JAVA_OUTPUT_PARAMS) $(proto_java_sources_file_stamp) : $(proto_sources_fullpath) $(PROTOC) $(call transform-proto-to-java) diff --git a/core/clear_vars.mk b/core/clear_vars.mk index 8d848140ad..7ad58b2e9b 100644 --- a/core/clear_vars.mk +++ b/core/clear_vars.mk @@ -120,6 +120,7 @@ LOCAL_BUILD_HOST_DEX:= LOCAL_DEX_PREOPT:= # '',true,false,nostripping LOCAL_PROTOC_OPTIMIZE_TYPE:= # lite(default),micro,nano,full LOCAL_PROTOC_FLAGS:= +LOCAL_PROTO_JAVA_OUTPUT_PARAMS:= LOCAL_NO_CRT:= LOCAL_PROPRIETARY_MODULE:= LOCAL_MODULE_OWNER:= diff --git a/core/definitions.mk b/core/definitions.mk index 7834baa4d0..4da78de152 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -889,13 +889,11 @@ define transform-proto-to-java @echo "Protoc: $@ <= $(PRIVATE_PROTO_SRC_FILES)" @rm -rf $(PRIVATE_PROTO_JAVA_OUTPUT_DIR) @mkdir -p $(PRIVATE_PROTO_JAVA_OUTPUT_DIR) -$(hide) for f in $(PRIVATE_PROTO_SRC_FILES); do \ - $(PROTOC) \ - $(addprefix --proto_path=, $(PRIVATE_PROTO_INCLUDES)) \ - $(PRIVATE_PROTO_JAVA_OUTPUT_OPTION)=$(PRIVATE_PROTO_JAVA_OUTPUT_DIR) \ +$(hide) $(PROTOC) \ + $(PRIVATE_PROTO_JAVA_OUTPUT_OPTION)="$(PRIVATE_PROTO_JAVA_OUTPUT_PARAMS):$(PRIVATE_PROTO_JAVA_OUTPUT_DIR)" \ $(PRIVATE_PROTOC_FLAGS) \ - $$f || exit 33; \ - done + $(addprefix --proto_path=, $(PRIVATE_PROTO_INCLUDES)) \ + $(PRIVATE_PROTO_SRC_FILES) $(hide) touch $@ endef