先看看Android官方的解释

Understand Build Layers

The build hierarchy includes the abstraction layers that correspond to the physical makeup of a device. These layers are described in the table below. Each layer relates to the one above it in a one-to-many relationship. For example, an architecture can have more than one board and each board can have more than one product. You may define an element in a given layer as a specialization of an element in the same layer, thus eliminating copying and simplifying maintenance.

Layer Example Description
Product myProduct, myProduct_eu, myProduct_eu_fr, j2, sdk The product layer defines the feature specification of a shipping product such as the modules to build, locales supported, and the configuration for various locales. In other words, this is the name of the overall product. Product-specific variables are defined in product definition Makefiles. A product can inherit from other product definitions, which simplifies maintenance. A common method is to create a base product that contains features that apply for all products, then creating product variants based on that base product. For example, you can have two products that differ only by their radios (CDMA vs GSM) inherit from the same base product that does not define a radio.
Board/Device sardine, trout, goldfish The device/board layer represents the physical layer of plastic on the device (i.e. the industrial design of the device). For example, North American devices probably include QWERTY keyboards whereas devices sold in France probably include AZERTY keyboards. This layer also represents the bare schematics of a product. These include the peripherals on the board and their configuration. The names used are merely codes for different board/device configurations.
Arch arm, x86, mips, arm64, x86_64, mips64 The architecture layer describes the processor configuration and ABI (Application Binary Interface) running on the board.

产品层

典型的产品定义文件夹一般会有以下文件

  • vendorsetup.sh
  • AndroidProducts.mk
  • product.mk

vendorsetup.sh

这个文件非常简单,只是添加产品条目而已,比如像下面这样:

add_lunch_combo p201_iptv-eng
add_lunch_combo p201_iptv-user
add_lunch_combo p201_iptv-userdebug

AndroidProducts.mk

这个文件也很简单,只是指定产品的构建文件而已,例:

PRODUCT_MAKEFILES := $(LOCAL_DIR)/sample.mk

这里可以指定多个构建文件,一个文件对应一种产品,文件名必须与产品名相同。

product.mk

product即为产品名,也就是AndroidProducts.mk中指定的构建文件。这个文件中一般定义了产品构建所必要的所有特性。

大专栏  understanding android build layer · Dyland>PRODUCT_BRAND
Parameter Description Example
PRODUCT_AAPT_CONFIG aapt configurations to use when creating packages
The brand (e.g., carrier) the software is customized for, if any
PRODUCT_CHARACTERISTICS aapt characteristics to allow adding variant-specific resources to a package. tablet,nosdcard
PRODUCT_COPY_FILES List of words like source_path:destination_path. The file at the source path should be copied to the destination path when building this product. The rules for the copy steps are defined in config/Makefile
PRODUCT_DEVICE Name of the industrial design. This is also the board name, and the build system uses it to locate the BoardConfig.mk. tuna
PRODUCT_LOCALES A space-separated list of two-letter language code, two-letter country code pairs that describe several settings for the user, such as the UI language and time, date and currency formatting. The first locale listed in PRODUCT_LOCALES is used as the product’s default locale. en_GB de_DE es_ES fr_CA
PRODUCT_MANUFACTURER Name of the manufacturer acme
PRODUCT_MODEL End-user-visible name for the end product
PRODUCT_NAME End-user-visible name for the overall product. Appears in the Settings > About screen.
PRODUCT_OTA_PUBLIC_KEYS List of Over the Air (OTA) public keys for the product
PRODUCT_PACKAGES Lists the APKs and modules to install. Calendar Contacts
PRODUCT_PACKAGE_OVERLAYS Indicate whether to use default resources or add any product specific overlays vendor/acme/overlay
PRODUCT_PROPERTY_OVERRIDES List of system property assignments in the format “key=value”

设备层

典型的设备层定义文件夹至少包含一个文件BoardConfig.mk,一般设备层还包含另外一个文件AndroidBoard.mk。这两个文件,BoardConfig.mk一般只是定义一些设备相关的宏,用于在其他地方使用,比如kernel,bootloader的编译。AndroidBoard.mk则是定义一些设备相关的编译规则和目标等。在很多例子里,设备定义路径与产品定义路径相同。比如我们项目中的device/amlogic/p201_iptv文件夹。

参考:

Adding a New Device  |  Android Open Source Project

Please enable JavaScript to view the comments powered by Disqus.
comments powered by Disqus

understanding android build layer · Dylan的更多相关文章

  1. 分析Android (build/core/*.mk脚本)

    文档简要整理Android的make脚本的内容.以供备忘和参考. 1.    Build LayersBuild Layers描述的是产品的硬件配置情况,据此make时选择不同的配置和模块.按照从上到 ...

  2. Android Build System Ultimate Guide

    Android Build System Ultimate Guide April 8,2013 Lately, Android Open Source Project has gone throug ...

  3. com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK assets/com.xx.xx

    完整的Error 信息(关键部分) Error:Execution failed for task ':fanwe_o2o_47_mgxz_dingzhi:transformResourcesWith ...

  4. Android Build System

    归类一些Android build system 相关的知识. http://elinux.org/Android_Build_System make <local_module> - m ...

  5. 理解 Android Build 系统

    在配置了以上的文件之后,便可以编译出我们新添加的设备的系统镜像了. 首先,调用“source build/envsetup.sh”该命令的输出中会看到 Build 系统已经引入了刚刚添加的 vendo ...

  6. Gradle: The New Android Build System

    Gradle: The New Android Build System Google selected Gradle as the foundation of the Android SDK bui ...

  7. 【转】Android ROM研究---Android build system增加模块

    原文网址:http://hualang.iteye.com/blog/1141315 Android build system就是编译系统的意思 在我们需要向自己编译的源代码中增加模块的时候,需要一些 ...

  8. using 1.7 requires using android build tools version 19 or later

    这意思大概是adt用了1.7,abt(android build tools)就要用19或更高,可是abt在哪设置呢,原来是在sdk manager中 之前我已安装的最高的abt是17,然后~~~,F ...

  9. 【转】理解 Android Build 系统----不错

    $ mmm -help用法:make [选项] [目标] ...选项: -b, -m 忽略兼容性. -B, --always-make Unconditionally make all targets ...

随机推荐

  1. 【论文笔记系列】AutoML:A Survey of State-of-the-art (下)

    [论文笔记系列]AutoML:A Survey of State-of-the-art (上) 上一篇文章介绍了Data preparation,Feature Engineering,Model S ...

  2. Window Redis安装

    1.下载redis 下载地址:https://github.com/MicrosoftArchive/redis/releases ​ 2. 安装redis 把下载的Redis-x64-3.2.100 ...

  3. CSP模拟赛游记

    时间:2019.10.5 考试时间:100分钟(连正式考试时间的一半还没有到)题目:由于某些原因不能公开. 由于第一次接触NOIinux系统所以连怎么建文件夹,调字体,如何编译都不知道,考试的前半小时 ...

  4. 关于nginx配置的一个报错connect() to unix:/tmp/php-cgi.sock failed (2: No such file or directory)

    针对配置php的情况: linux服务器一般提示这个 connect() to unix:/tmp/php-cgi.sock failed (2: No such file or directory) ...

  5. 移动端web前端开发

    移动端浏览器现状 视口 meta视口标签 二倍图 移动端主流方案 移动端技术解决方案 移动端常见布局 1.流式布局(百分比布局) 2.flex布局 3.rem适配布局 1)rem单位 2)媒体查询 3 ...

  6. Python语言学习前提:条件语句

    一.条件语句 1.条件语句:通过一条或多条语句的执行结果(True或False)来决定执行额代码块.python程序语言指定任何非0或非空(null)的值为true,0或null为false. 2. ...

  7. Angular(一)

    Angular开发者指南(一)入门介绍   什么是AngularAngularJS是动态Web应用程序的结构框架. 它允许您使用HTML作为模板语言,并允许您扩展HTML的语法以清晰,简洁地表达应用程 ...

  8. 项目server中设置session timeout遇到的问题

    RT:在项目server中的web.xml设置session timeout=10,当10分钟后,继续右键执行jsp文件,运行失败,如下图所示: 但是单独启动tomcat server后,在浏览器中输 ...

  9. [USACO09DEC]音符Music Notes (二分、STL)

    https://www.luogu.org/problem/P2969 题目描述 FJ is going to teach his cows how to play a song. The song ...

  10. 【个人笔记】ximo早期发的脱壳教程——手脱UPX壳

    [个人笔记]ximo早期发的脱壳教程--手脱UPX壳   壳分为两种:压缩壳和加密壳,UPX是一种很简单的压缩壳.   手脱UPX壳: 工具:ExeinfoPE.OD 对象:rmvbfix 方法1:单 ...