commit | c6bd70a5e662e5930712e8a012ca7ba4a71a4164 | [log] [tgz] |
---|---|---|
author | Tao Bao <tbao@google.com> | Thu Sep 27 16:58:00 2018 -0700 |
committer | Tao Bao <tbao@google.com> | Wed Oct 03 11:31:44 2018 -0700 |
tree | 578259081b515c671a6d9f5a172fb9b8d0dee0c6 | |
parent | 943be51cf12b4eedbbda04f8fe332d5d747da34d [diff] |
releasetools: Raise on image building errors. The image building functions in build_image.py have been returning (success, result) or special values to indicate the validity of the result. The same logic can be better expressed by raising exceptions instead, because a) using a special value relies on caller to check for that magic value; b) exceptions can carry additional messages other than a boolean does, e.g. the output from the failing command; c) caller can have cleaner code flow without explicitly checking for the validity of the result. This CL changes such functions to raise on errors. The majority of these functions are internal to build_image.py only, except for BuildImage() that has a few callers in add_img_to_target_files.py (which all die upon error anyway). Test: `m dist` Test: python -m unittest test_build_image Test: python -m unittest test_add_img_to_target_files Test: python -m unittest test_validate_target_files Test: Inject an error to the depended binaries (e.g. avbtool), and check that build_image.py exits with error messages. Change-Id: Ibe4d51e267756bb1a00fa9238a213f9d55fd9b58
This is the Makefile-based portion of the Android Build System.
For documentation on how to run a build, see Usage.txt
For a list of behavioral changes useful for Android.mk writers see Changes.md
For an outdated reference on Android.mk files, see build-system.html. Our Android.mk files look similar, but are entirely different from the Android.mk files used by the NDK build system. When searching for documentation elsewhere, ensure that it is for the platform build system -- most are not.
This Makefile-based system is in the process of being replaced with Soong, a new build system written in Go. During the transition, all of these makefiles are read by Kati, and generate a ninja file instead of being executed directly. That's combined with a ninja file read by Soong so that the build graph of the two systems can be combined and run as one.