BUILD.bazel 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. load("@rules_python//python:defs.bzl", "py_binary")
  2. load("@deps//:requirements.bzl", "requirement")
  3. py_binary(
  4. name = "main",
  5. srcs = ["main.py"],
  6. data = glob(["templates/*.mustache", "static/*"]),
  7. deps = [
  8. requirement("Markdown"),
  9. requirement("pystache"),
  10. requirement("PyYAML"),
  11. requirement("base58"),
  12. ]
  13. )
  14. py_binary(
  15. name = "experimental",
  16. srcs = ["experimental.py"],
  17. data = glob(["templates/*.mustache", "static/*"]),
  18. deps = [
  19. requirement("Markdown"),
  20. requirement("pystache"),
  21. requirement("PyYAML"),
  22. ]
  23. )
  24. filegroup(
  25. name = "data",
  26. srcs=glob(["quips/*", "quotes/*", "works/**/*", "works.json"], exclude=["**/*~"]),
  27. )
  28. genrule(
  29. name = "out",
  30. srcs = [":data"] + glob(["templates/*.mustache", "static/*"]),
  31. tools = [":main"],
  32. outs = ["output"],
  33. cmd = "$(location :main) $(location output) $(locations :data)",
  34. )
  35. genrule(
  36. name = "experiment",
  37. srcs = [":data"] + glob(["templates/*.mustache", "static/*"]),
  38. tools = [":experimental"],
  39. outs = ["exp"],
  40. cmd = "$(location :experimental) $(location exp) $(locations :data)",
  41. )