赞
踩
Android.mk和Android.bp文件中的一些常见属性的对应关系可以参考:build/soong/androidmk/androidmk/android.go文件
- build/soong/androidmk/androidmk/android.go
- func init() {
- addStandardProperties(bpparser.StringType,
- map[string]string{
- "LOCAL_MODULE": "name",
- "LOCAL_CXX_STL": "stl",
- "LOCAL_MULTILIB": "compile_multilib",
- "LOCAL_ARM_MODE_HACK": "instruction_set",
- "LOCAL_SDK_VERSION": "sdk_version",
- "LOCAL_MIN_SDK_VERSION": "min_sdk_version",
- "LOCAL_NDK_STL_VARIANT": "stl",
- "LOCAL_JAR_MANIFEST": "manifest",
- "LOCAL_CERTIFICATE": "certificate",
- "LOCAL_PACKAGE_NAME": "name",
- "LOCAL_MODULE_RELATIVE_PATH": "relative_install_path",
- "LOCAL_PROTOC_OPTIMIZE_TYPE": "proto.type",
- "LOCAL_MODULE_OWNER": "owner",
- "LOCAL_RENDERSCRIPT_TARGET_API": "renderscript.target_api",
- "LOCAL_NOTICE_FILE": "notice",
- "LOCAL_JAVA_LANGUAGE_VERSION": "java_version",
- "LOCAL_INSTRUMENTATION_FOR": "instrumentation_for",
- "LOCAL_MANIFEST_FILE": "manifest",
-
- "LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING": "dex_preopt.profile",
- "LOCAL_TEST_CONFIG": "test_config",
- })
- addStandardProperties(bpparser.ListType,
- map[string]string{
- "LOCAL_SRC_FILES": "srcs",
- "LOCAL_SRC_FILES_EXCLUDE": "exclude_srcs",
- "LOCAL_HEADER_LIBRARIES": "header_libs",
- "LOCAL_SHARED_LIBRARIES": "shared_libs",
- "LOCAL_STATIC_LIBRARIES": "static_libs",
- "LOCAL_WHOLE_STATIC_LIBRARIES": "whole_static_libs",
- "LOCAL_SYSTEM_SHARED_LIBRARIES": "system_shared_libs",
- "LOCAL_ASFLAGS": "asflags",
- "LOCAL_CLANG_ASFLAGS": "clang_asflags",
- "LOCAL_COMPATIBILITY_SUPPORT_FILES": "data",
- "LOCAL_CONLYFLAGS": "conlyflags",
- "LOCAL_CPPFLAGS": "cppflags",
- "LOCAL_REQUIRED_MODULES": "required",
- "LOCAL_HOST_REQUIRED_MODULES": "host_required",
- "LOCAL_TARGET_REQUIRED_MODULES": "target_required",
- "LOCAL_OVERRIDES_MODULES": "overrides",
- "LOCAL_LDLIBS": "host_ldlibs",
- "LOCAL_CLANG_CFLAGS": "clang_cflags",
- "LOCAL_YACCFLAGS": "yacc.flags",
- "LOCAL_SANITIZE_RECOVER": "sanitize.recover",
- "LOCAL_LOGTAGS_FILES": "logtags",
- "LOCAL_EXPORT_HEADER_LIBRARY_HEADERS": "export_header_lib_headers",
- "LOCAL_EXPORT_SHARED_LIBRARY_HEADERS": "export_shared_lib_headers",
- "LOCAL_EXPORT_STATIC_LIBRARY_HEADERS": "export_static_lib_headers",
- "LOCAL_INIT_RC": "init_rc",
- "LOCAL_VINTF_FRAGMENTS": "vintf_fragments",
- "LOCAL_TIDY_FLAGS": "tidy_flags",
- // TODO: This is comma-separated, not space-separated
- "LOCAL_TIDY_CHECKS": "tidy_checks",
- "LOCAL_RENDERSCRIPT_INCLUDES": "renderscript.include_dirs",
- "LOCAL_RENDERSCRIPT_FLAGS": "renderscript.flags",
-
- "LOCAL_JAVA_RESOURCE_DIRS": "java_resource_dirs",
- "LOCAL_JAVA_RESOURCE_FILES": "java_resources",
- "LOCAL_JAVACFLAGS": "javacflags",
- "LOCAL_ERROR_PRONE_FLAGS": "errorprone.javacflags",
- "LOCAL_DX_FLAGS": "dxflags",
- "LOCAL_JAVA_LIBRARIES": "libs",
- "LOCAL_STATIC_JAVA_LIBRARIES": "static_libs",
- "LOCAL_JNI_SHARED_LIBRARIES": "jni_libs",
- "LOCAL_AAPT_FLAGS": "aaptflags",
- "LOCAL_PACKAGE_SPLITS": "package_splits",
- "LOCAL_COMPATIBILITY_SUITE": "test_suites",
- "LOCAL_OVERRIDES_PACKAGES": "overrides",
-
- "LOCAL_ANNOTATION_PROCESSORS": "plugins",
-
- "LOCAL_PROGUARD_FLAGS": "optimize.proguard_flags",
- "LOCAL_PROGUARD_FLAG_FILES": "optimize.proguard_flags_files",
-
- // These will be rewritten to libs/static_libs by bpfix, after their presence is used to convert
- // java_library_static to android_library.
- "LOCAL_SHARED_ANDROID_LIBRARIES": "android_libs",
- "LOCAL_STATIC_ANDROID_LIBRARIES": "android_static_libs",
- "LOCAL_ADDITIONAL_CERTIFICATES": "additional_certificates",
-
- // Jacoco filters:
- "LOCAL_JACK_COVERAGE_INCLUDE_FILTER": "jacoco.include_filter",
- "LOCAL_JACK_COVERAGE_EXCLUDE_FILTER": "jacoco.exclude_filter",
-
- "LOCAL_FULL_LIBS_MANIFEST_FILES": "additional_manifests",
- })
-
- addStandardProperties(bpparser.BoolType,
- map[string]string{
- // Bool properties
- "LOCAL_IS_HOST_MODULE": "host",
- "LOCAL_CLANG": "clang",
- "LOCAL_FORCE_STATIC_EXECUTABLE": "static_executable",
- "LOCAL_NATIVE_COVERAGE": "native_coverage",
- "LOCAL_NO_CRT": "nocrt",
- "LOCAL_ALLOW_UNDEFINED_SYMBOLS": "allow_undefined_symbols",
- "LOCAL_RTTI_FLAG": "rtti",
- "LOCAL_PACK_MODULE_RELOCATIONS": "pack_relocations",
- "LOCAL_TIDY": "tidy",
- "LOCAL_USE_CLANG_LLD": "use_clang_lld",
- "LOCAL_PROPRIETARY_MODULE": "proprietary",
- "LOCAL_VENDOR_MODULE": "vendor",
- "LOCAL_ODM_MODULE": "device_specific",
- "LOCAL_PRODUCT_MODULE": "product_specific",
- "LOCAL_SYSTEM_EXT_MODULE": "system_ext_specific",
- "LOCAL_EXPORT_PACKAGE_RESOURCES": "export_package_resources",
- "LOCAL_PRIVILEGED_MODULE": "privileged",
- "LOCAL_AAPT_INCLUDE_ALL_RESOURCES": "aapt_include_all_resources",
- "LOCAL_DONT_MERGE_MANIFESTS": "dont_merge_manifests",
- "LOCAL_USE_EMBEDDED_NATIVE_LIBS": "use_embedded_native_libs",
- "LOCAL_USE_EMBEDDED_DEX": "use_embedded_dex",
-
- "LOCAL_DEX_PREOPT": "dex_preopt.enabled",
- "LOCAL_DEX_PREOPT_APP_IMAGE": "dex_preopt.app_image",
- "LOCAL_DEX_PREOPT_GENERATE_PROFILE": "dex_preopt.profile_guided",
-
- "LOCAL_PRIVATE_PLATFORM_APIS": "platform_apis",
- "LOCAL_JETIFIER_ENABLED": "jetifier",
- })
- }
一些配置的实例:
Android.mk | Android.bp | |
---|---|---|
生成App | include $(BUILD_PACKAGE) | android_app { ...... } |
生成java库 | include $(BUILD_JAVA_LIBRARY) | java_library { ...... } |
生成java静态库 | include $(BUILD_STATIC_JAVA_LIBRARY) | java_library_static { ...... } |
生成头文件库 | include $(BUILD_HEADER_LIBRARY) | cc_library_headers { ...... } |
生成native动态库 | include $(BUILD_SHARED_LIBRARY) | cc_library_shared { ...... } |
生成native静态库 | include $(BUILD_STATIC_LIBRARY) | cc_library_static { ...... } |
生成native执行程序 | include $(BUILD_EXECUTABLE) | cc_binary { ...... } |
依赖静态库 | LOCAL_STATIC_LIBRARIES := | static_libs: [] |
依赖动态库 | LOCAL_SHARED_LIBRARIES := | shared_libs: [] |
依赖java库 | LOCAL_STATIC_JAVA_LIBRARIES := | static_libs: [] |
依赖头文件库 | LOCAL_HEADER_LIBRARIES := | header_libs: [] |
模块安装到vendor分区 | LOCAL_VENDOR_MODULE := true | vendor: true或者 LOCAL_PROPRIETARY_MODULE := true |
模块安装到product分区 | LOCAL_PRODUCT_MODULE := true | product_specific: true |
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。