Skip to content

Commit

Permalink
fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
solsjo authored and Oskar Solsjö committed Sep 1, 2022
1 parent 0ef1f6f commit bbddd75
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ container:
image: l.gcr.io/google/bazel:latest
task:
name: Build the example document
build_script: bazel build //example/... --verbose_failures
build_script: bazel build //example:all
task:
name: Build all package tests
build_script: bazel build //packages:all --verbose_failures
build_script: bazel build //packages:all
7 changes: 3 additions & 4 deletions latex.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ def _latex_impl(ctx):
custom_dependencies.append(file.dirname)
custom_dependencies = ','.join(custom_dependencies)

ext =".{}".format(ctx.attr.format)
flags = ["--flag=--latex-args=--output-format={}".format(ctx.attr.format)]
for value in ctx.attr.cmd_flags:
if "output-format" in value and ctx.attr.format not in value:
Expand All @@ -30,7 +29,7 @@ def _latex_impl(ctx):
"--flag=--latex-args=-shell-escape -jobname=" + ctx.label.name,
"--flag=-Wall",
"--input=" + ctx.file.main.path,
"--tool-output=" + ctx.file.main.basename.rsplit(".", 1)[0] + ext,
"--tool-output=" + ctx.file.main.basename.rsplit(".", 1)[0] + ".{}".format(ctx.attr.format),
"--output=" + ctx.outputs.out.path,
"--inputs=" + custom_dependencies,
] + flags,
Expand All @@ -46,7 +45,7 @@ def _latex_impl(ctx):
outputs = [ctx.outputs.out],
tools = [ctx.executable._tool],
)
latex_info = LatexOutputInfo(file = ctx.outputs.out, format=ext)
latex_info = LatexOutputInfo(file = ctx.outputs.out, format=ctx.attr.format)
return [latex_info]

_latex = rule(
Expand All @@ -63,7 +62,7 @@ _latex = rule(
"format": attr.string(
doc = "Output file format",
default = "pdf",
values = ["dvi","pdf"],
values = ["dvi", "pdf"],
),
"_tool": attr.label(
default = Label("@bazel_latex//:tool_wrapper_py"),
Expand Down

0 comments on commit bbddd75

Please sign in to comment.