def make_copy_files_rule(repository_ctx, name, srcs, outs):
    """Returns a rule to copy a set of files."""

    # Copy files.
    cmds = ['cp -f "{}" "$(location {})"'.format(src, out) for (src, out) in zip(srcs, outs)]
    outs = ['        "{}",'.format(out) for out in outs]
    return """genrule(
    name = "{}",
    outs = [
{}
    ],
    cmd = \"""{} \""",
)""".format(name, "\n".join(outs), " && \\\n".join(cmds))