Android源代码使用第三方jar包和android-support-v7-appcompat兼容lib库

下面是我引用了一个小的例子,这个makefile使用到了tct.drm.frameworks.jar,mtk-drm:libs/mtk.drm.frameworks.jar这两个jar包,并且该工程是依赖android-support-v7-appcompat兼容库的。 如果我们想把这个工程放到Android源码下编译,那么就需要加下面标注红色的内容:

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional

LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_SRC_FILES += $(call all-java-files-under, ../../../../../external/drmagent/java)

#Include res dir from libraries appcompat_dir := ../../../../../prebuilts/sdk/current/support/v7/appcompat/res

res_dirs := res $(appcompat_dir)

LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(res_dirs))

LOCAL_JAVA_LIBRARIES := frameworks_ext tct.framework

LOCAL_JAVA_LIBRARIES := tct.feature_query

LOCAL_PACKAGE_NAME := FileManager

LOCAL_MODULE_PATH := $(TARGET_OUT_APP_PATH)

LOCAL_STATIC_JAVA_LIBRARIES += android-support-v4

LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-appcompat

LOCAL_STATIC_JAVA_LIBRARIES += tct-drm mtk-drm

#LOCAL_STATIC_JAVA_LIBRARIES += xUitls-1.5.4

LOCAL_CERTIFICATE := platform

LOCAL_AAPT_FLAGS := --auto-add-overlay

LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.appcompat

LOCAL_PROGUARD_FLAG_FILES := proguard.cfg

include $(BUILD_PACKAGE)

include $(call all-makefiles-under,$(LOCAL_PATH))

include $(CLEAR_VARS)

LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := tct-drm:libs/tct.drm.frameworks.jar \

                                        mtk-drm:libs/mtk.drm.frameworks.jar

include $(BUILD_MULTI_PREBUILT)

 

你可能感兴趣的:(android)