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 5LOCAL_MOJO_ROOT := $(call my-dir) 6original_generated_sources_dir := $(call generated-sources-dir-for,$(original_module_class),$(original_module)) 7LOCAL_SRCJAR_LIST := 8 9define collect-srcjar-list 10 11mojom_file := $(1) 12target_path := $(original_generated_sources_dir) 13LOCAL_SRCJAR_LIST += $$(target_path)/$$(mojom_file).srcjar 14 15endef 16 17# Collect all .srcjar files 18$(foreach file,$(LOCAL_MOJOM_FILES),$(eval $(call collect-srcjar-list,$(file)))) 19 20local_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 30LOCAL_ADDITIONAL_DEPENDENCIES += $(local_target_path) $(LOCAL_SRCJAR_LIST) 31