本文主要是介绍Android.mk转换到Android.bp方法(二十九),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Android.mk转换到Android.bp方法
1.源码在:build/soong/androidmk2.编译源码后,androidmk生成工具位置
# out/soong/host/linux-x86/bin/androidmk3.使用命令
栗子:Android.mk
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_PRIVATE_PLATFORM_APIS := true
LOCAL_MODULE_TAGS := optional
LOCAL_CERTIFICATE := platform
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := test
LOCAL_DEX_PREOPT := false
include $(BUILD_PACKAGE)# androidmk Android.mk > Android.bp
Android.bp生成如下:
android_app {
// LOCAL_PRIVATE_PLATFORM_APIS := true certificate: "platform", srcs: ["src/**/*.java"], name: "test", dex_preopt: { enabled: false, },
}4.禁止framework/base/Android.bp生成odex
java_library {name: "framework",//禁止生成odexdex_preopt: { enabled: false, },srcs: []
}5.编译可执行程序:Android.mk---->Android.np
<1>.Android.mk
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS)
#LOCAL_C_INCLUDES:= external/tinyalsa/include
#LOCAL_CPPFLAGS := -std=c++11 -Wall -Werror #C++
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := test_bb
LOCAL_SRC_FILES := test.c
LOCAL_CFLAGS += -Wall -Werror
LOCAL_SHARED_LIBRARIES:= libcutils libutils
include $(BUILD_EXECUTABLE) # androidmk Android.mk > Android.bp
<2>.Android.bp
cc_binary { //LOCAL_C_INCLUDES:= external/tinyalsa/include //LOCAL_CPPFLAGS := -std=c++11 -Wall -Werror #C++ name: "test_bb", srcs: ["test.c"], cflags: [ "-Wall", "-Werror", ], shared_libs: [ "libcutils", "libutils", ],
}
这篇关于Android.mk转换到Android.bp方法(二十九)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!