BUILD.bazel 855 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. load("@rules_python//python:pip.bzl", "compile_pip_requirements")
  2. load("@rules_python//python:defs.bzl", "py_binary")
  3. py_binary(
  4. name = "generate",
  5. srcs = ["generate.py"],
  6. deps = [
  7. "@pypi//chevron:pkg",
  8. "@pypi//importlib_metadata:pkg",
  9. "@pypi//markdown:pkg",
  10. "@pypi//pyyaml:pkg",
  11. ]
  12. )
  13. filegroup(
  14. name="static",
  15. srcs=glob(["static/*"]),
  16. )
  17. filegroup(
  18. name="templates",
  19. srcs=glob(["templates/*"]),
  20. )
  21. genrule(
  22. name = "out",
  23. srcs = [
  24. ":projects.yaml",
  25. ":static",
  26. ":templates",
  27. ],
  28. tools = [":generate"],
  29. outs = ["output"],
  30. cmd = "$(location :generate) $(location output) $(location :projects.yaml) $(locations :static) $(locations :templates)",
  31. )
  32. compile_pip_requirements(
  33. name = "requirements",
  34. requirements_txt = "requirements.txt",
  35. )