Anton Hansson | 7ff32d2 | 2018-02-21 15:29:44 +0000 | [diff] [blame] | 1 | |
| 2 | # Enforcement checks that LOCAL_SDK_VERSION and LOCAL_PRIVATE_PLATFORM_APIS are |
| 3 | # set correctly. |
| 4 | # Should be included by java targets that allow specifying LOCAL_SDK_VERSION. |
Anton Hansson | f5f29aa | 2018-02-28 17:01:51 +0000 | [diff] [blame] | 5 | # The JAVA_SDK_ENFORCEMENT_WARNING and JAVA_SDK_ENFORCEMENT_ERROR variables may |
| 6 | # be set to a particular module class to enable warnings and errors for that |
| 7 | # subtype. |
| 8 | |
| 9 | whitelisted_modules := framework-res__auto_generated_rro |
Anton Hansson | 7ff32d2 | 2018-02-21 15:29:44 +0000 | [diff] [blame] | 10 | |
| 11 | ifeq ($(LOCAL_SDK_VERSION)$(LOCAL_PRIVATE_PLATFORM_APIS),) |
Anton Hansson | f5f29aa | 2018-02-28 17:01:51 +0000 | [diff] [blame] | 12 | ifeq (,$(filter $(LOCAL_MODULE),$(whitelisted_modules))) |
| 13 | ifneq ($(JAVA_SDK_ENFORCEMENT_WARNING)$(JAVA_SDK_ENFORCEMENT_ERROR),) |
| 14 | my_message := Must specify LOCAL_SDK_VERSION or LOCAL_PRIVATE_PLATFORM_APIS, |
| 15 | ifeq ($(LOCAL_MODULE_CLASS),$(JAVA_SDK_ENFORCEMENT_ERROR)) |
| 16 | $(call pretty-error,$(my_message)) |
| 17 | endif |
| 18 | ifeq ($(LOCAL_MODULE_CLASS),$(JAVA_SDK_ENFORCEMENT_WARNING)) |
| 19 | $(call pretty-warning,$(my_message)) |
| 20 | endif |
| 21 | my_message := |
| 22 | endif |
| 23 | endif |
Anton Hansson | 7ff32d2 | 2018-02-21 15:29:44 +0000 | [diff] [blame] | 24 | else ifneq ($(LOCAL_SDK_VERSION),) |
Anton Hansson | f5f29aa | 2018-02-28 17:01:51 +0000 | [diff] [blame] | 25 | ifneq ($(LOCAL_PRIVATE_PLATFORM_APIS),) |
| 26 | my_message := Specifies both LOCAL_SDK_VERSION ($(LOCAL_SDK_VERSION)) and |
| 27 | my_message += LOCAL_PRIVATE_PLATFORM_APIS ($(LOCAL_PRIVATE_PLATFORM_APIS)) |
| 28 | my_message += but should specify only one |
| 29 | $(call pretty-error,$(my_message)) |
| 30 | my_message := |
| 31 | endif |
Anton Hansson | 7ff32d2 | 2018-02-21 15:29:44 +0000 | [diff] [blame] | 32 | endif |