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 | |
Anton Hansson | 18cf217 | 2018-03-07 11:30:16 +0000 | [diff] [blame] | 11 | |
| 12 | ifeq (,$(JAVA_SDK_ENFORCEMENT_ERROR)) |
| 13 | JAVA_SDK_ENFORCEMENT_ERROR := APPS |
| 14 | endif |
| 15 | |
Anton Hansson | 7ff32d2 | 2018-02-21 15:29:44 +0000 | [diff] [blame] | 16 | ifeq ($(LOCAL_SDK_VERSION)$(LOCAL_PRIVATE_PLATFORM_APIS),) |
Anton Hansson | f5f29aa | 2018-02-28 17:01:51 +0000 | [diff] [blame] | 17 | ifeq (,$(filter $(LOCAL_MODULE),$(whitelisted_modules))) |
| 18 | ifneq ($(JAVA_SDK_ENFORCEMENT_WARNING)$(JAVA_SDK_ENFORCEMENT_ERROR),) |
| 19 | my_message := Must specify LOCAL_SDK_VERSION or LOCAL_PRIVATE_PLATFORM_APIS, |
| 20 | ifeq ($(LOCAL_MODULE_CLASS),$(JAVA_SDK_ENFORCEMENT_ERROR)) |
| 21 | $(call pretty-error,$(my_message)) |
| 22 | endif |
| 23 | ifeq ($(LOCAL_MODULE_CLASS),$(JAVA_SDK_ENFORCEMENT_WARNING)) |
| 24 | $(call pretty-warning,$(my_message)) |
| 25 | endif |
| 26 | my_message := |
| 27 | endif |
| 28 | endif |
Anton Hansson | 7ff32d2 | 2018-02-21 15:29:44 +0000 | [diff] [blame] | 29 | else ifneq ($(LOCAL_SDK_VERSION),) |
Anton Hansson | f5f29aa | 2018-02-28 17:01:51 +0000 | [diff] [blame] | 30 | ifneq ($(LOCAL_PRIVATE_PLATFORM_APIS),) |
| 31 | my_message := Specifies both LOCAL_SDK_VERSION ($(LOCAL_SDK_VERSION)) and |
| 32 | my_message += LOCAL_PRIVATE_PLATFORM_APIS ($(LOCAL_PRIVATE_PLATFORM_APIS)) |
| 33 | my_message += but should specify only one |
| 34 | $(call pretty-error,$(my_message)) |
| 35 | my_message := |
| 36 | endif |
Anton Hansson | 7ff32d2 | 2018-02-21 15:29:44 +0000 | [diff] [blame] | 37 | endif |