From 36c35119526023c9e28ec22915b26b1bf7da6bc3 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Tue, 25 Oct 2016 14:17:26 -0700 Subject: applypatch: Add testcases for applypatch executable. Refactor applypatch/main.cpp into libapplypatch_modes so that we can add testcases. Some changes to applypatch/main.cpp: - Replace char** argv with const char**; - Use android::base::Split() to split ":"; - Use android::base::ParseUInt(). Bug: 32383590 Test: Unit tests pass, install-recovery.sh works. Change-Id: I44e7bfa5ab717d439ea1d0ee9ddb7b2c40bb95a4 --- applypatch/Android.mk | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'applypatch/Android.mk') diff --git a/applypatch/Android.mk b/applypatch/Android.mk index 9bbac4410..fa0fe8a37 100644 --- a/applypatch/Android.mk +++ b/applypatch/Android.mk @@ -68,21 +68,41 @@ LOCAL_STATIC_LIBRARIES += libcrypto libbz libz LOCAL_CFLAGS := -Werror include $(BUILD_HOST_STATIC_LIBRARY) -# applypatch (executable) +# libapplypatch_modes (static library) # =============================== include $(CLEAR_VARS) LOCAL_CLANG := true -LOCAL_SRC_FILES := main.cpp +LOCAL_SRC_FILES := \ + applypatch_modes.cpp +LOCAL_MODULE := libapplypatch_modes +LOCAL_C_INCLUDES := bootable/recovery +LOCAL_STATIC_LIBRARIES := \ + libapplypatch \ + libbase \ + libedify \ + libcrypto +LOCAL_CFLAGS := -Werror +include $(BUILD_STATIC_LIBRARY) + +# applypatch (target executable) +# =============================== +include $(CLEAR_VARS) +LOCAL_CLANG := true +LOCAL_SRC_FILES := applypatch_main.cpp LOCAL_MODULE := applypatch -LOCAL_C_INCLUDES += bootable/recovery -LOCAL_STATIC_LIBRARIES += \ +LOCAL_C_INCLUDES := bootable/recovery +LOCAL_STATIC_LIBRARIES := \ + libapplypatch_modes \ libapplypatch \ libbase \ libedify \ libotafault \ libcrypto \ libbz -LOCAL_SHARED_LIBRARIES += libbase libz libcutils libc +LOCAL_SHARED_LIBRARIES := \ + libbase \ + libz \ + libcutils LOCAL_CFLAGS := -Werror include $(BUILD_EXECUTABLE) -- cgit v1.2.3