Build SystemUI and Keyguard with AAPT2
Bug:29462255
Change-Id: I9a886b4d17a7dbc4cfd7b4f8d398138f00df04a7
diff --git a/packages/Keyguard/Android.mk b/packages/Keyguard/Android.mk
index 9083212..f9e2686 100644
--- a/packages/Keyguard/Android.mk
+++ b/packages/Keyguard/Android.mk
@@ -16,6 +16,8 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
+LOCAL_USE_AAPT2 := true
+
LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-subdir-Iaidl-files)
LOCAL_MODULE := Keyguard
@@ -30,6 +32,8 @@
LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
+LOCAL_JAR_EXCLUDE_FILES := none
+
include $(BUILD_STATIC_JAVA_LIBRARY)
#include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/packages/Keyguard/test/Android.mk b/packages/Keyguard/test/Android.mk
index 15059c6..54224b7 100644
--- a/packages/Keyguard/test/Android.mk
+++ b/packages/Keyguard/test/Android.mk
@@ -16,6 +16,8 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
+LOCAL_USE_AAPT2 := true
+
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := KeyguardTest
diff --git a/packages/Keyguard/test/SampleTrustAgent/Android.mk b/packages/Keyguard/test/SampleTrustAgent/Android.mk
index 2a18ee1..6ffb018 100644
--- a/packages/Keyguard/test/SampleTrustAgent/Android.mk
+++ b/packages/Keyguard/test/SampleTrustAgent/Android.mk
@@ -16,6 +16,8 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
+LOCAL_USE_AAPT2 := true
+
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := SampleTrustAgent
@@ -27,6 +29,6 @@
# LOCAL_PROGUARD_FLAG_FILES := proguard.flags
-LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4
+LOCAL_STATIC_ANDROID_LIBRARIES := android-support-v4
include $(BUILD_PACKAGE)
diff --git a/packages/SystemUI/Android.mk b/packages/SystemUI/Android.mk
index 6d8b9f6..258c82e 100644
--- a/packages/SystemUI/Android.mk
+++ b/packages/SystemUI/Android.mk
@@ -16,17 +16,21 @@
include $(CLEAR_VARS)
+LOCAL_USE_AAPT2 := true
+
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-Iaidl-files-under, src)
-LOCAL_STATIC_JAVA_LIBRARIES := \
+LOCAL_STATIC_ANDROID_LIBRARIES := \
Keyguard \
android-support-v7-recyclerview \
android-support-v7-preference \
android-support-v7-appcompat \
android-support-v14-preference \
- android-support-v17-leanback \
+ android-support-v17-leanback
+
+LOCAL_STATIC_JAVA_LIBRARIES := \
framework-protos \
SystemUI-proto-tags
@@ -39,19 +43,6 @@
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
-LOCAL_RESOURCE_DIR := \
- frameworks/base/packages/Keyguard/res \
- $(LOCAL_PATH)/res \
- frameworks/support/v7/preference/res \
- frameworks/support/v14/preference/res \
- frameworks/support/v7/appcompat/res \
- frameworks/support/v7/recyclerview/res \
- frameworks/support/v17/leanback/res
-
-LOCAL_AAPT_FLAGS := --auto-add-overlay \
- --extra-packages com.android.keyguard:android.support.v7.recyclerview:android.support.v7.preference:android.support.v14.preference:android.support.v7.appcompat \
- --extra-packages android.support.v17.leanback
-
ifneq ($(SYSTEM_UI_INCREMENTAL_BUILDS),)
LOCAL_PROGUARD_ENABLED := disabled
LOCAL_JACK_ENABLED := incremental
diff --git a/packages/SystemUI/tests/Android.mk b/packages/SystemUI/tests/Android.mk
index 6c39e35..2020abb 100644
--- a/packages/SystemUI/tests/Android.mk
+++ b/packages/SystemUI/tests/Android.mk
@@ -15,6 +15,7 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
+LOCAL_USE_AAPT2 := true
LOCAL_MODULE_TAGS := tests
LOCAL_JACK_FLAGS := --multi-dex native
@@ -23,37 +24,31 @@
LOCAL_PROTOC_FLAGS := -I$(LOCAL_PATH)/..
LOCAL_PROTO_JAVA_OUTPUT_PARAMS := optional_field_style=accessors
-LOCAL_AAPT_FLAGS := --auto-add-overlay \
- --extra-packages com.android.systemui:com.android.keyguard:android.support.v14.preference:android.support.v7.preference:android.support.v7.appcompat:android.support.v7.recyclerview \
- --extra-packages android.support.v17.leanback
+LOCAL_PACKAGE_NAME := SystemUITests
LOCAL_SRC_FILES := $(call all-java-files-under, src) \
$(call all-Iaidl-files-under, src) \
$(call all-java-files-under, ../src)
LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res \
- frameworks/support/v7/preference/res \
- frameworks/support/v14/preference/res \
- frameworks/support/v7/appcompat/res \
- frameworks/support/v7/recyclerview/res \
- frameworks/support/v17/leanback/res \
frameworks/base/packages/SystemUI/res \
- frameworks/base/packages/Keyguard/res
-LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common android.car
-
-LOCAL_PACKAGE_NAME := SystemUITests
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
- mockito-target \
+LOCAL_STATIC_ANDROID_LIBRARIES := \
Keyguard \
android-support-v7-recyclerview \
android-support-v7-preference \
android-support-v7-appcompat \
android-support-v14-preference \
- android-support-v17-leanback \
+ android-support-v17-leanback
+
+LOCAL_STATIC_JAVA_LIBRARIES := \
+ mockito-target \
SystemUI-proto-tags
+LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common android.car
+
+LOCAL_AAPT_FLAGS := --extra-packages com.android.systemui
+
# sign this with platform cert, so this test is allowed to inject key events into
# UI it doesn't own. This is necessary to allow screenshots to be taken
LOCAL_CERTIFICATE := platform