github.com/westcoastroms/westcoastroms-build@v0.0.0-20190928114312-2350e5a73030/build/make/core/tasks/boot_jars_package_check.mk (about)

     1  # Copyright (C) 2014 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  #
    16  # Rules to check if classes in the boot jars are from the whitelisted packages.
    17  #
    18  
    19  ifneq ($(SKIP_BOOT_JARS_CHECK),true)
    20  ifneq ($(TARGET_BUILD_PDK),true)
    21  ifdef PRODUCT_BOOT_JARS
    22  
    23  intermediates := $(call intermediates-dir-for, PACKAGING, boot-jars-package-check,,COMMON)
    24  stamp := $(intermediates)/stamp
    25  built_boot_jars := $(foreach j, $(PRODUCT_BOOT_JARS), \
    26    $(call intermediates-dir-for, JAVA_LIBRARIES, $(j),,COMMON)/classes.jar)
    27  script := build/make/core/tasks/check_boot_jars/check_boot_jars.py
    28  whitelist_file := build/make/core/tasks/check_boot_jars/package_whitelist.txt
    29  
    30  $(stamp): PRIVATE_BOOT_JARS := $(built_boot_jars)
    31  $(stamp): PRIVATE_SCRIPT := $(script)
    32  $(stamp): PRIVATE_WHITELIST := $(whitelist_file)
    33  $(stamp) : $(built_boot_jars) $(script) $(whitelist_file)
    34  	@echo "Check package name for $(PRIVATE_BOOT_JARS)"
    35  	$(hide) $(PRIVATE_SCRIPT) $(PRIVATE_WHITELIST) $(PRIVATE_BOOT_JARS)
    36  	$(hide) mkdir -p $(dir $@) && touch $@
    37  
    38  .PHONY: check-boot-jars
    39  check-boot-jars : $(stamp)
    40  
    41  # Run check-boot-jars by default
    42  droidcore : check-boot-jars
    43  
    44  endif  # PRODUCT_BOOT_JARS
    45  endif  # TARGET_BUILD_PDK not true
    46  endif  # SKIP_BOOT_JARS_CHECK not true