1load("//build/bazel/rules/apex:apex_aab.bzl", "apex_aab") 2 3package(default_visibility = ["//build/bazel/tests/apex:__subpackages__"]) 4 5# This package contains the multi-architecture aab and apks packages of 6# Bazel-buildable Mainline modules. These are exclusively used for development 7# and testing purposes and not for distribution. 8# 9# We have added testonly and visibility guardrails to ensure that these do not 10# get used unintentionally. 11 12modules = [ 13 "//build/bazel/examples/apex/minimal:build.bazel.examples.apex.minimal", 14 "//frameworks/av/apex:com.android.media.swcodec", 15 "//packages/modules/NeuralNetworks/apex:com.android.neuralnetworks", 16 "//packages/modules/adb/apex:com.android.adbd", 17 "//system/timezone/apex:com.android.tzdata", 18] 19 20name_label_map = {module[module.index(":") + 1:]: module for module in modules} 21 22[ 23 ( 24 apex_aab( 25 name = "%s_apex_aab" % name, 26 testonly = True, 27 mainline_module = label, 28 ), 29 genrule( 30 name = "%s_apks" % name, 31 testonly = True, 32 srcs = ["%s_apex_aab" % name], 33 outs = ["%s.apks" % name], 34 cmd = "$(location //prebuilts/bundletool) build-apks --bundle $(location %s_apex_aab) --output $@" % name, 35 tools = ["//prebuilts/bundletool"], 36 ), 37 ) 38 for name, label in name_label_map.items() 39] 40 41filegroup( 42 name = "mainline_modules", 43 testonly = True, 44 srcs = ["%s_apex_aab" % name for name, label in name_label_map.items()], 45) 46