Android.mk文件语法规范与变量详细说明
2016-04-28 11:06
591 查看
Android.mk文件语法规范与变量详细说明
分为以下几种情况:
Building a simple APK
Building a APK that depends on a static .jar file
Building a APK that should be signed with the platform key
Building a APK that should be signed with a specific vendor key
Adding a prebuilt APK
Adding a Static Java Library
分为以下几种情况:
Building a simple APK
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) # Build all java files in the java subdirectory LOCAL_SRC_FILES := $(call all-subdir-java-files) # Name of the APK to build LOCAL_PACKAGE_NAME := LocalPackage # Tell it to build an APK include $(BUILD_PACKAGE)
Building a APK that depends on a static .jar file
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) # List of static libraries to include in the package LOCAL_STATIC_JAVA_LIBRARIES := static-library # Build all java files in the java subdirectory LOCAL_SRC_FILES := $(call all-subdir-java-files) # Name of the APK to build LOCAL_PACKAGE_NAME := LocalPackage # Tell it to build an APK include $(BUILD_PACKAGE)
Building a APK that should be signed with the platform key
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) # Build all java files in the java subdirectory LOCAL_SRC_FILES := $(call all-subdir-java-files) # Name of the APK to build LOCAL_PACKAGE_NAME := LocalPackage LOCAL_CERTIFICATE := platform # Tell it to build an APK include $(BUILD_PACKAGE)
Building a APK that should be signed with a specific vendor key
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) # Build all java files in the java subdirectory LOCAL_SRC_FILES := $(call all-subdir-java-files) # Name of the APK to build LOCAL_PACKAGE_NAME := LocalPackage LOCAL_CERTIFICATE := vendor/example/certs/app # Tell it to build an APK include $(BUILD_PACKAGE)
Adding a prebuilt APK
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) # Module name should match apk name to be installed. LOCAL_MODULE := LocalModuleName LOCAL_SRC_FILES := $(LOCAL_MODULE).apk LOCAL_MODULE_CLASS := APPS LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX) include $(BUILD_PREBUILT)
Adding a Static Java Library
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) # Build all java files in the java subdirectory LOCAL_SRC_FILES := $(call all-subdir-java-files) # Any libraries that this library depends on LOCAL_JAVA_LIBRARIES := android.test.runner # The name of the jar file to create LOCAL_MODULE := sample # Build a static jar file. include $(BUILD_STATIC_JAVA_LIBRARY)
相关文章推荐
- 懒人爱家务_动画效果编程基础--AnimationAndroid
- Android图片缓存技术!直接用在你的项目中,简单方便高效
- android 数据库版本管理及其更新
- 清华TUNA镜像源下载Android源码的方法
- Android 4.0 Launcher源码分析系列(一)
- Android中Menu的基本用法
- Java/Android引用类型及其使用分析
- hjr-Android:Sqlite数据库
- Android Fragment实现分屏
- Android动画进阶—使用开源动画库nineoldandroids
- Genymotion:最快的安卓模拟器,Android 开发利器 安装说明
- Proguard returned with error code 1. See console
- android 跳转到指定应用程序
- android的消息处理机制(图+源码分析)——Looper,Handler,Message
- Android开发自己总结的Adapter的一些工具类
- Android源码编译之Nexus5真机编译
- android修改debug keystore文件使之和正式keystore sha1一致
- recycleview中item的刷新方法
- Android Volley框架的使用(三)
- Android开发快捷键