Skip to content

Commit

Permalink
Update docs versions
Browse files Browse the repository at this point in the history
  • Loading branch information
tm-jdelapuente committed Oct 8, 2024
1 parent ceee6be commit 6b4b332
Showing 1 changed file with 74 additions and 67 deletions.
141 changes: 74 additions & 67 deletions docs/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ for src in glob(
"*.html",
"milestones/*.html",
],
exclude = [
exclude=[
"template.html",
"lexicon*.html",
"language.html",
Expand All @@ -16,50 +16,51 @@ for src in glob(
"plugins.html",
],
):
deps += [html_template(name = src.replace(".", "_").replace("/", "_"), src = src)]
deps += [html_template(name=src.replace(".", "_").replace("/", "_"), src=src)]

html_template(
name = "codelabs_html",
src = "//docs/codelabs:templated_index",
output = "codelabs.html",
name="codelabs_html",
src="//docs/codelabs:templated_index",
output="codelabs.html",
)

genrule(
name = "rules",
outs = ["rules.json"],
cmd = '"$TOOL" init && "$TOOL" query rules > "$OUT"',
local = True,
sandbox = False,
tools = ["//src:please"],
visibility = ["//docs/test/..."],
name="rules",
outs=["rules.json"],
cmd='"$TOOL" init && "$TOOL" query rules > "$OUT"',
local=True,
sandbox=False,
tools=["//src:please"],
visibility=["//docs/test/..."],
)

genrule(
name = "lexicon_html",
srcs = deps + [
name="lexicon_html",
srcs=deps
+ [
"lexicon.html",
"lexicon_entry.html",
"template.html",
":rules",
],
outs = ["lexicon.html"],
cmd = [
outs=["lexicon.html"],
cmd=[
'"$TOOLS_LEX" -i docs/lexicon.html -i docs/lexicon_entry.html docs/rules.json > "$OUT"',
'"$TOOLS_TMPL" --template docs/template.html --in lexicon.html > tmp.html',
'mv tmp.html "$OUT"',
],
tools = {
tools={
"lex": ["//docs/tools/lexicon_templater"],
"tmpl": ["//docs/tools/templater"],
},
visibility = ["//docs/test/..."],
visibility=["//docs/test/..."],
)

# Plugin versions to pull the docs from
plugins = {
"python": "v1.7.3",
"python": "v1.7.4",
"java": "v0.4.2",
"go": "v1.21.4",
"go": "v1.21.5",
"cc": "v0.4.0",
"shell": "v0.2.0",
"go-proto": "v0.3.0",
Expand All @@ -70,73 +71,76 @@ plugins = {
plugin_targets = []

for plugin, revision in plugins.items():
plugin_rules_target = plugin_rules(name = plugin, revision = revision)
plugin_rules_target = plugin_rules(name=plugin, revision=revision)
plugin_targets += [plugin_rules_target]

filegroup(
name = "plugins",
exported_deps = plugin_targets,
visibility = ["//docs/test/..."],
name="plugins",
exported_deps=plugin_targets,
visibility=["//docs/test/..."],
)

genrule(
name = "plugins_html",
srcs = deps + [
name="plugins_html",
srcs=deps
+ [
"lexicon.html",
"lexicon_entry.html",
"template.html",
"plugins.html",
],
outs = ["plugins.html"],
cmd = [
outs=["plugins.html"],
cmd=[
'"$TOOLS_PLUGIN" --plugin docs/plugins.html --lex docs/lexicon_entry.html docs/*_plugin.json > "$OUT"',
'"$TOOLS_TMPL" --template docs/template.html --in plugins.html > tmp.html',
'mv tmp.html "$OUT"',
],
tools = {
tools={
"plugin": ["//docs/tools/plugin_templater"],
"tmpl": ["//docs/tools/templater"],
},
visibility = ["//docs/test/..."],
deps = [":plugins"],
visibility=["//docs/test/..."],
deps=[":plugins"],
)

genrule(
name = "config_html",
srcs = [
name="config_html",
srcs=[
"config.html",
"template.html",
],
outs = ["config.html"],
cmd = [
outs=["config.html"],
cmd=[
'"$TOOLS_CONFIG" > config.html',
'"$TOOLS_TMPL" --template docs/template.html --in config.html > tmp.html',
'mv tmp.html "$OUT"',
],
tools = {
tools={
"config": ["//docs/tools/config_templater"],
"tmpl": ["//docs/tools/templater"],
},
)

genrule(
name = "language_html",
srcs = {
name="language_html",
srcs={
"template": ["template.html"],
"html": ["language.html"],
"grammar": ["grammar.txt"],
},
outs = ["language.html"],
cmd = '"$TOOLS_TEMPLATE" --template $SRCS_TEMPLATE --in $SRCS_HTML | "$TOOLS_GRAMMAR" > "$OUT"',
tools = {
outs=["language.html"],
cmd='"$TOOLS_TEMPLATE" --template $SRCS_TEMPLATE --in $SRCS_HTML | "$TOOLS_GRAMMAR" > "$OUT"',
tools={
"grammar": ["//docs/tools/grammar_templater"],
"template": ["//docs/tools/templater"],
},
)

filegroup(
name = "docs",
srcs = glob(["images/*.png"]) + deps + [
name="docs",
srcs=glob(["images/*.png"])
+ deps
+ [
":language_html",
":plugins_html",
":lexicon_html",
Expand All @@ -153,34 +157,34 @@ filegroup(
"favicon",
":codelabs_html",
],
visibility = ["//docs/..."],
deps = ["//docs/codelabs"],
visibility=["//docs/..."],
deps=["//docs/codelabs"],
)

#TODO(jpoole): unify these two once we switch to the new website
# TODO(jpoole): unify these two once we switch to the new website
tarball(
name = "tarball",
srcs = [":docs"],
out = "docs.tar.gz",
labels = ["hlink:plz-out/pkg"],
name="tarball",
srcs=[":docs"],
out="docs.tar.gz",
labels=["hlink:plz-out/pkg"],
)

# This is used exclusively for the s3 website
tarball(
name = "deep-tarball",
srcs = [
name="deep-tarball",
srcs=[
":docs",
"//docs/codelabs",
],
out = "deep-docs.tar.gz",
flatten = False,
labels = ["hlink:plz-out/pkg"],
out="deep-docs.tar.gz",
flatten=False,
labels=["hlink:plz-out/pkg"],
)

filegroup(
name = "template_html",
srcs = ["template.html"],
visibility = ["//docs/..."],
name="template_html",
srcs=["template.html"],
visibility=["//docs/..."],
)

results_files = [
Expand All @@ -189,25 +193,28 @@ results_files = [
]

genrule(
name = "performance_data",
outs = [f"performance/{file}.jsonl" for file in results_files],
cmd = [f"curl https://please.build/performance/{file}.jsonl > performance/{file}.jsonl" for file in results_files],
name="performance_data",
outs=[f"performance/{file}.jsonl" for file in results_files],
cmd=[
f"curl https://please.build/performance/{file}.jsonl > performance/{file}.jsonl"
for file in results_files
],
)

# Convenient for popping open the docs in a browser after building (must use 'plz run').
sh_cmd(
name = "view",
cmd = "sensible-browser http://localhost:8080 && cd plz-out/gen/docs && python3 -m http.server 8080",
data = [
name="view",
cmd="sensible-browser http://localhost:8080 && cd plz-out/gen/docs && python3 -m http.server 8080",
data=[
":docs",
":performance_data",
],
)

sh_cmd(
name = "server",
cmd = "cd plz-out/gen/docs && python3 -m http.server 8080",
data = [
name="server",
cmd="cd plz-out/gen/docs && python3 -m http.server 8080",
data=[
":docs",
":performance_data",
],
Expand Down

0 comments on commit 6b4b332

Please sign in to comment.