| TEMPLATE = """# Autogenerated with {script_name} |
| java_language_level: {language_level} |
| def get_library_targets(): |
| this_dir = os.path.dirname(os.path.realpath(__file__)) |
| out = subprocess.check_output([ |
| "bazel", "query", "kind(\"java_library\", //...:all)"], cwd=this_dir) |
| return out.strip().split("\n") |
| all_targets = get_library_targets() |
| "script_name": os.path.basename(__file__), |
| "language_level": JAVA_LANGUAGE_LEVEL, |
| "exclude_dirs": "\n".join( |
| map(lambda x: " -" + x, EXCLUDE_DIRECTORIES)), |
| "targets": "\n".join(map(lambda x: " " + x, all_targets)), |
| "test_sources": "\n".join(map(lambda x: " " + x, TEST_SOURCES)), |
| return TEMPLATE.format(**data) |
| if __name__ == "__main__": |