当前位置:   article > 正文

Android.bp/mk的常见语法对比_local_export_shared_library_headers

local_export_shared_library_headers

Android.mk和Android.bp文件中的一些常见属性的对应关系可以参考:build/soong/androidmk/androidmk/android.go文件

  1. build/soong/androidmk/androidmk/android.go
  2. func init() {
  3. addStandardProperties(bpparser.StringType,
  4. map[string]string{
  5. "LOCAL_MODULE": "name",
  6. "LOCAL_CXX_STL": "stl",
  7. "LOCAL_MULTILIB": "compile_multilib",
  8. "LOCAL_ARM_MODE_HACK": "instruction_set",
  9. "LOCAL_SDK_VERSION": "sdk_version",
  10. "LOCAL_MIN_SDK_VERSION": "min_sdk_version",
  11. "LOCAL_NDK_STL_VARIANT": "stl",
  12. "LOCAL_JAR_MANIFEST": "manifest",
  13. "LOCAL_CERTIFICATE": "certificate",
  14. "LOCAL_PACKAGE_NAME": "name",
  15. "LOCAL_MODULE_RELATIVE_PATH": "relative_install_path",
  16. "LOCAL_PROTOC_OPTIMIZE_TYPE": "proto.type",
  17. "LOCAL_MODULE_OWNER": "owner",
  18. "LOCAL_RENDERSCRIPT_TARGET_API": "renderscript.target_api",
  19. "LOCAL_NOTICE_FILE": "notice",
  20. "LOCAL_JAVA_LANGUAGE_VERSION": "java_version",
  21. "LOCAL_INSTRUMENTATION_FOR": "instrumentation_for",
  22. "LOCAL_MANIFEST_FILE": "manifest",
  23. "LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING": "dex_preopt.profile",
  24. "LOCAL_TEST_CONFIG": "test_config",
  25. })
  26. addStandardProperties(bpparser.ListType,
  27. map[string]string{
  28. "LOCAL_SRC_FILES": "srcs",
  29. "LOCAL_SRC_FILES_EXCLUDE": "exclude_srcs",
  30. "LOCAL_HEADER_LIBRARIES": "header_libs",
  31. "LOCAL_SHARED_LIBRARIES": "shared_libs",
  32. "LOCAL_STATIC_LIBRARIES": "static_libs",
  33. "LOCAL_WHOLE_STATIC_LIBRARIES": "whole_static_libs",
  34. "LOCAL_SYSTEM_SHARED_LIBRARIES": "system_shared_libs",
  35. "LOCAL_ASFLAGS": "asflags",
  36. "LOCAL_CLANG_ASFLAGS": "clang_asflags",
  37. "LOCAL_COMPATIBILITY_SUPPORT_FILES": "data",
  38. "LOCAL_CONLYFLAGS": "conlyflags",
  39. "LOCAL_CPPFLAGS": "cppflags",
  40. "LOCAL_REQUIRED_MODULES": "required",
  41. "LOCAL_HOST_REQUIRED_MODULES": "host_required",
  42. "LOCAL_TARGET_REQUIRED_MODULES": "target_required",
  43. "LOCAL_OVERRIDES_MODULES": "overrides",
  44. "LOCAL_LDLIBS": "host_ldlibs",
  45. "LOCAL_CLANG_CFLAGS": "clang_cflags",
  46. "LOCAL_YACCFLAGS": "yacc.flags",
  47. "LOCAL_SANITIZE_RECOVER": "sanitize.recover",
  48. "LOCAL_LOGTAGS_FILES": "logtags",
  49. "LOCAL_EXPORT_HEADER_LIBRARY_HEADERS": "export_header_lib_headers",
  50. "LOCAL_EXPORT_SHARED_LIBRARY_HEADERS": "export_shared_lib_headers",
  51. "LOCAL_EXPORT_STATIC_LIBRARY_HEADERS": "export_static_lib_headers",
  52. "LOCAL_INIT_RC": "init_rc",
  53. "LOCAL_VINTF_FRAGMENTS": "vintf_fragments",
  54. "LOCAL_TIDY_FLAGS": "tidy_flags",
  55. // TODO: This is comma-separated, not space-separated
  56. "LOCAL_TIDY_CHECKS": "tidy_checks",
  57. "LOCAL_RENDERSCRIPT_INCLUDES": "renderscript.include_dirs",
  58. "LOCAL_RENDERSCRIPT_FLAGS": "renderscript.flags",
  59. "LOCAL_JAVA_RESOURCE_DIRS": "java_resource_dirs",
  60. "LOCAL_JAVA_RESOURCE_FILES": "java_resources",
  61. "LOCAL_JAVACFLAGS": "javacflags",
  62. "LOCAL_ERROR_PRONE_FLAGS": "errorprone.javacflags",
  63. "LOCAL_DX_FLAGS": "dxflags",
  64. "LOCAL_JAVA_LIBRARIES": "libs",
  65. "LOCAL_STATIC_JAVA_LIBRARIES": "static_libs",
  66. "LOCAL_JNI_SHARED_LIBRARIES": "jni_libs",
  67. "LOCAL_AAPT_FLAGS": "aaptflags",
  68. "LOCAL_PACKAGE_SPLITS": "package_splits",
  69. "LOCAL_COMPATIBILITY_SUITE": "test_suites",
  70. "LOCAL_OVERRIDES_PACKAGES": "overrides",
  71. "LOCAL_ANNOTATION_PROCESSORS": "plugins",
  72. "LOCAL_PROGUARD_FLAGS": "optimize.proguard_flags",
  73. "LOCAL_PROGUARD_FLAG_FILES": "optimize.proguard_flags_files",
  74. // These will be rewritten to libs/static_libs by bpfix, after their presence is used to convert
  75. // java_library_static to android_library.
  76. "LOCAL_SHARED_ANDROID_LIBRARIES": "android_libs",
  77. "LOCAL_STATIC_ANDROID_LIBRARIES": "android_static_libs",
  78. "LOCAL_ADDITIONAL_CERTIFICATES": "additional_certificates",
  79. // Jacoco filters:
  80. "LOCAL_JACK_COVERAGE_INCLUDE_FILTER": "jacoco.include_filter",
  81. "LOCAL_JACK_COVERAGE_EXCLUDE_FILTER": "jacoco.exclude_filter",
  82. "LOCAL_FULL_LIBS_MANIFEST_FILES": "additional_manifests",
  83. })
  84. addStandardProperties(bpparser.BoolType,
  85. map[string]string{
  86. // Bool properties
  87. "LOCAL_IS_HOST_MODULE": "host",
  88. "LOCAL_CLANG": "clang",
  89. "LOCAL_FORCE_STATIC_EXECUTABLE": "static_executable",
  90. "LOCAL_NATIVE_COVERAGE": "native_coverage",
  91. "LOCAL_NO_CRT": "nocrt",
  92. "LOCAL_ALLOW_UNDEFINED_SYMBOLS": "allow_undefined_symbols",
  93. "LOCAL_RTTI_FLAG": "rtti",
  94. "LOCAL_PACK_MODULE_RELOCATIONS": "pack_relocations",
  95. "LOCAL_TIDY": "tidy",
  96. "LOCAL_USE_CLANG_LLD": "use_clang_lld",
  97. "LOCAL_PROPRIETARY_MODULE": "proprietary",
  98. "LOCAL_VENDOR_MODULE": "vendor",
  99. "LOCAL_ODM_MODULE": "device_specific",
  100. "LOCAL_PRODUCT_MODULE": "product_specific",
  101. "LOCAL_SYSTEM_EXT_MODULE": "system_ext_specific",
  102. "LOCAL_EXPORT_PACKAGE_RESOURCES": "export_package_resources",
  103. "LOCAL_PRIVILEGED_MODULE": "privileged",
  104. "LOCAL_AAPT_INCLUDE_ALL_RESOURCES": "aapt_include_all_resources",
  105. "LOCAL_DONT_MERGE_MANIFESTS": "dont_merge_manifests",
  106. "LOCAL_USE_EMBEDDED_NATIVE_LIBS": "use_embedded_native_libs",
  107. "LOCAL_USE_EMBEDDED_DEX": "use_embedded_dex",
  108. "LOCAL_DEX_PREOPT": "dex_preopt.enabled",
  109. "LOCAL_DEX_PREOPT_APP_IMAGE": "dex_preopt.app_image",
  110. "LOCAL_DEX_PREOPT_GENERATE_PROFILE": "dex_preopt.profile_guided",
  111. "LOCAL_PRIVATE_PLATFORM_APIS": "platform_apis",
  112. "LOCAL_JETIFIER_ENABLED": "jetifier",
  113. })
  114. }

一些配置的实例:

Android.mkAndroid.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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/392485
推荐阅读
相关标签
  

闽ICP备14008679号