Add argument to skip building APEXes.

Also set the variables that only apply to the APEX building in a
subshell so that they don't affect the SDK.

Building the SDK requires TARGET_BUILD_UNBUNDLED. Before the subshell
it was implied by TARGET_BUILD_APPS, but now it has to be set
explicitly.

Test: env MAINLINE_MODULE_PRODUCTS=art_module_arm64 \
        art/build/build-art-module.sh
Test: art/build/build-art-module.sh --skip-apex
  on AOSP master and master-art
Bug: 172480615
Change-Id: I97b01bfa6ff22955cd613ca413f60090101779ab
1 file changed