本文介绍了Android.mk包括其他项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题的目标是知道如何创建可以构建和运行的Android.mk(makefile),这个项目结构如下。 / p>

The goal of my question is to know how to create a Android.mk (makefile) that can build and run, this structures of project below.


  1. 图书馆(日食图书馆)

    • [/ data / projectLibrary /]


  • 包含1个静态库(lib1.jar)

  • 取决于上面的库

  • [/ data / projectUI /]


  • 包含2个静态库(lib1.jar,lib2.jar)

  • [/ data / projectService /]




问题



Questions


  1. 每个项目我应该有一个Android.mk?

  2. 或者我应该有一个包含所有其他项目的Android.mk?



An droid MK(服务)



Android MK (Service)

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional

LOCAL_STATIC_JAVA_LIBRARIES := android-common
LOCAL_STATIC_JAVA_LIBRARIES += jsr305
LOCAL_STATIC_JAVA_LIBRARIES += android-common-chips
LOCAL_STATIC_JAVA_LIBRARIES += lib1
LOCAL_STATIC_JAVA_LIBRARIES += lib2

LOCAL_JAVA_LIBRARIES += telephony-common mms-common

LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_SRC_FILES += $(call all-java-files-under, ../projectLibrary/src)

LOCAL_RESOURCE_DIR += $(LOCAL_PATH)/res
LOCAL_RESOURCE_DIR += ../projectLibrary/res

# Include res dir from chips
chips_dir := ../../../frameworks/ex/chips/res
res_dirs := $(chips_dir) res
$(shell rm -f $(LOCAL_PATH)/chips)
LOCAL_RESOURCE_DIR += $(addprefix $(LOCAL_PATH)/, $(res_dirs))

LOCAL_AAPT_FLAGS := --auto-add-overlay
LOCAL_AAPT_FLAGS += --extra-packages com.android.ex.chips

LOCAL_REQUIRED_MODULES := SoundRecorder

LOCAL_PROGUARD_FLAG_FILES := proguard.flags

LOCAL_CERTIFICATE := myCertificate

LOCAL_PACKAGE_NAME := MyAppName

include $(BUILD_PACKAGE)

# make the jni
include $(call all-makefiles-under, jni)

# make the static libs
include $(CLEAR_VARS)
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := lib1:libs/lib1.jar
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := lib2:libs/lib2.jar
include $(BUILD_MULTI_PREBUILT)

# make the other makefiles, if necessary
include $(call all-makefiles-under, $(LOCAL_PATH))



其他



我已经在寻找它了网络,

Others

I already looked for it on the web,




  • :(

[]的

推荐答案


  1. 没有。它不需要。

  2. 是的。您可以在packages / apps / Dialer下引用aosp源。
    这符合您声明的情况。拨号器包括packages / app / ContactsCommon和packages / app / InCallUI。你会发现在InCallUI的路径下没有Android.mk。

这篇关于Android.mk包括其他项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-26 12:43