1def format(target):
2    """Return the module name of a target if built by Soong, '' otherwise."""
3    p = providers(target)
4    if not p:
5        return ""
6    soong_prebuilt_info = p.get(
7        "//bazel/rules:soong_prebuilt.bzl%SoongPrebuiltInfo")
8    if soong_prebuilt_info:
9        return "%s:%s" % (soong_prebuilt_info.module_name, soong_prebuilt_info.platform_flavor)
10    return ""
11