1 # Copyright 2015 The Chromium OS Authors. All rights reserved. 2 # Use of this source code is governed by a BSD-style license that can be 3 # found in the LICENSE file. 4 5 LOCAL_MOJO_ROOT := $(call my-dir) 6 original_generated_sources_dir := $(call generated-sources-dir-for,$(original_module_class),$(original_module)) 7 LOCAL_SRCJAR_LIST := 8 9 define collect-srcjar-list 10 11 mojom_file := $(1) 12 target_path := $(original_generated_sources_dir) 13 LOCAL_SRCJAR_LIST += $$(target_path)/$$(mojom_file).srcjar 14 15 endef 16 17 # Collect all .srcjar files 18 $(foreach file,$(LOCAL_MOJOM_FILES),$(eval $(call collect-srcjar-list,$(file)))) 19 20 local_target_path := $(call local-intermediates-dir,true)/src 21 22 $(local_target_path) : PRIVATE_SRCJAR_LIST := $(LOCAL_SRCJAR_LIST) 23 $(local_target_path) : PRIVATE_TARGET := $(local_target_path) 24 $(local_target_path) : PRIVATE_CUSTOM_TOOL = \ 25 (rm -rf $(PRIVATE_TARGET) && mkdir -p $(PRIVATE_TARGET) && \ 26 for f in $(PRIVATE_SRCJAR_LIST); do unzip -qo -d $(PRIVATE_TARGET) $$f; done) 27 $(local_target_path) : $(LOCAL_SRCJAR_LIST) 28 $(transform-generated-source) 29 30 LOCAL_ADDITIONAL_DEPENDENCIES += $(local_target_path) $(LOCAL_SRCJAR_LIST) 31