def _attr_files(ctx, name):
    """Returns the list of files for the current target's attribute.

    This is a convenience function since the aspect context does not expose the
    same convenience `file`/`files` fields used in rule contexts.

    Args:
      ctx: The Skylark context.
      name: The name of the attribute.

    Returns:
      A list of Files.
    """
    return [f for t in getattr(ctx.rule.attr, name) for f in t.files]