Dan Shi | 679cc2a | 2017-11-30 13:20:43 -0800 | [diff] [blame] | 1 | # Copyright (C) 2017 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | # Create an artifact to include TEST_MAPPING files in source tree. |
| 16 | |
| 17 | .PHONY: test_mapping |
| 18 | |
| 19 | intermediates := $(call intermediates-dir-for,PACKAGING,test_mapping) |
| 20 | test_mappings_zip := $(intermediates)/test_mappings.zip |
| 21 | test_mapping_list := $(OUT_DIR)/.module_paths/TEST_MAPPING.list |
| 22 | test_mappings := $(file <$(test_mapping_list)) |
| 23 | $(test_mappings_zip) : PRIVATE_test_mappings := $(subst $(newline),\n,$(test_mappings)) |
| 24 | |
| 25 | $(test_mappings_zip) : $(test_mappings) $(SOONG_ZIP) |
| 26 | @echo "Building artifact to include TEST_MAPPING files." |
| 27 | rm -rf $@ |
| 28 | echo -e "$(PRIVATE_test_mappings)" > $@.list |
| 29 | $(SOONG_ZIP) -o $@ -C . -l $@.list |
| 30 | rm -f $@.list |
| 31 | |
| 32 | test_mapping : $(test_mappings_zip) |
| 33 | |
| 34 | $(call dist-for-goals, dist_files test_mapping,$(test_mappings_zip)) |