understanding android build layer · Dylan

build?/

android

先看看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

原文地址:https://www.cnblogs.com/lijianming180/p/12026590.html

时间: 2024-10-22 23:13:55

understanding android build layer · Dylan的相关文章

Android Build System Ultimate Guide

Android Build System Ultimate Guide April 8,2013 Lately, Android Open Source Project has gone through various changes. For instance, Since JB Google decided to replace bluez bluetooth stack with an open source stack implemented by Broadcom claiming t

理解 Android Build 系统

http://www.ibm.com/developerworks/cn/opensource/os-cn-android-build/ Android Build 系统是用来编译 Android 系统,Android SDK 以及相关文档的一套框架.众所周知,Android 是一个开源的操作系统.Android 的源码中包含了许许多多的模块. 不同产商的不同设备对于 Android 系统的定制都是不一样的.如何将这些模块统一管理起来,如何能够在不同的操作系统上进行编译,如何在编译时能够支持面向

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

原文网址:http://hualang.iteye.com/blog/1141315 Android build system就是编译系统的意思 在我们需要向自己编译的源代码中增加模块的时候,需要一些规则,当然这个规则都是类似的. Android.mk文件解析 让我们来看一个 Android.mk 文件的样子 Java代码 LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE :=Hello LOCAL_SRC_FILES

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,然后~~~,FQ什么的不容易做到啊,直接从同事那拷了一个20的文件夹,问题就解决了

android开发里跳过的坑-AS导入NDK工程提示错误 No such property: sdkHandler for class: com.android.build.gradle.LibraryPlugin

接到一个NDK工程需要调试,导入后发现总是提示错误 Error:(37, 1) A problem occurred evaluating project ':libuvccamera'.> No such property: sdkHandler for class: com.android.build.gradle.LibraryPlugin 百度上各种说法,有说要降低gadle版本,有说要在环境变量里配置ANDROID_NDK的路径,试验了都不行,最后参考别人NDK gradle文件修改如

Could not find property 'outputFile' on com.android.build.gradle.internal.api.ApplicationVariantImpl

Android studio从1.0 RC 4升级到1.0(其实就是打了一个8M的patch)后,这个时候相应的gradle的版本也会直接使用"com.android.tools.build:gradle:1.0.0",如果这时你在gradle文件中又用到outputFile就会出现上述的问题.好吧,其实这也是gradle团队搞的问题,有时候我们多希望gradle能像android一样,对旧版本有一个非常好的兼容性. 废话不多说,直接说怎么解决这个问题吧,这个问题的原因是outputF

Gradle: The New Android Build System

Gradle: The New Android Build System Google selected Gradle as the foundation of the Android SDK build system because it provides flexibility along with the ability to define common standards for Android builds. With Gradle, Android developers can us

java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0解决办法

androidstudio编译程序时出现java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0.Unsupported major.minor version 52.这个错误是由于(jdk)高版本的java project使用了低版本的来运行.使用命令(java -version 和 javac -version)查看java

android build path contains duplicate entry:'src' for project XXX

项目导入的时候,遇到了这个问题:android build path contains duplicate entry:'src' for project XXX,如图: 解决办法:找到该工程的project.properties文件,修改target=android-17,修改后面的数字,把其修改为我们安装的sdk的对应的数字 原因是:我所安装的sdk的版本和所导入的工程的sdk的版本不相符. android build path contains duplicate entry:'src'