forked from RobotLocomotion/drake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
47 lines (42 loc) · 1.33 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# -*- python -*-
package(default_visibility = ["//visibility:public"])
load(
"@drake//tools/skylark:drake_py.bzl",
"drake_py_binary",
)
load("//tools/lint:lint.bzl", "add_lint_tests")
genrule(
name = "sphinx",
srcs = glob([
"**/*.rst",
]) + [
"conf.py",
"images/logo_w_text.jpg",
"images/doxygen_instructions/visual_studio_build_targets.png",
],
outs = ["sphinx.zip"],
cmd = " ".join([
# Run sphinx-build.
"$(location @sphinx//:sphinx-build) -b html", # HTML output.
"-a -E -d $(@D)/.doctrees/", # Don't use caching.
"-W -N -q", # Turn warnings into errors; else be quiet.
"$$(dirname $(location conf.py))", # Source dir.
"$(@D)/.tmpout", # Output dir.
"&&",
# Create zipfile.
"( CWD=`pwd` && cd $(@D)/.tmpout && zip -q -r $$CWD/$@ ./ )",
"&&",
# Cleanup temporary files.
"rm -rf $(@D)/.doctrees/ $(@D)/.tmpout",
]),
# Some (currently disabled) Sphinx extentions try to reach out to the
# network; we should fail-fast if someone tries to turn them on.
tags = ["block-network"],
tools = ["@sphinx//:sphinx-build"],
)
drake_py_binary(
name = "serve_sphinx",
srcs = ["serve_sphinx.py"],
data = [":sphinx.zip"],
)
add_lint_tests(python_lint_exclude = [":conf.py"])