Skip to content

Commit

Permalink
Make PDF rules output a versioned file
Browse files Browse the repository at this point in the history
  • Loading branch information
lupino3 committed Jul 31, 2018
1 parent f798a58 commit ea209b2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
7 changes: 5 additions & 2 deletions docs/user/en/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package(default_visibility = ["//visibility:public"])

load("//src/main/java/org/edumips64:version.bzl", "version")

filegroup(
name = "javahelp",
srcs = [
Expand Down Expand Up @@ -61,22 +63,23 @@ genrule(
]),
)

pdf = "edumips64-" + version + "-manual-en.pdf"
genrule(
name = "pdf",
srcs = [
":src",
":makefile",
"//docs/user:common_conf",
],
outs = ["EduMIPS64.pdf"],
outs = [pdf],
cmd = "\n".join([
# Get the absolute path of the output directory as a destination.
"DST=$$(readlink -f $(@D))",
"echo $$DST",
"cd $$(dirname $(location :makefile))",
# Remove -Q to debug Sphinx.
"make latexpdf BUILDDIR=$$DST SPHINXOPTS='-N -a -E -Q'",
"cp $$DST/latex/EduMIPS64.pdf $$DST/EduMIPS64.pdf"
"cp $$DST/latex/EduMIPS64.pdf $$DST/" + pdf,
]),
)

Expand Down
7 changes: 5 additions & 2 deletions docs/user/it/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package(default_visibility = ["//visibility:public"])

load("//src/main/java/org/edumips64:version.bzl", "version")

filegroup(
name = "javahelp",
srcs = [
Expand Down Expand Up @@ -61,22 +63,23 @@ genrule(
]),
)

pdf = "edumips64-" + version + "-manual-it.pdf"
genrule(
name = "pdf",
srcs = [
":src",
":makefile",
"//docs/user:common_conf",
],
outs = ["EduMIPS64.pdf"],
outs = [pdf],
cmd = "\n".join([
# Get the absolute path of the output directory as a destination.
"DST=$$(readlink -f $(@D))",
"echo $$DST",
"cd $$(dirname $(location :makefile))",
# Remove -Q to debug Sphinx.
"make latexpdf BUILDDIR=$$DST SPHINXOPTS='-N -a -E -Q'",
"cp $$DST/latex/EduMIPS64.pdf $$DST/EduMIPS64.pdf"
"cp $$DST/latex/EduMIPS64.pdf $$DST/" + pdf,
]),
)

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/edumips64/BUILD
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
load("@io_bazel_rules_gwt//gwt:gwt.bzl", "gwt_application")
load(":version.bzl", "version")

# Build variables.
codename = "Nicolosi"

splash_img = "images/splash.png"

version = "1.2.4"

manifest_nosplash_lines = [
"Codename: {}".format(codename),
"Signature-Version: {}".format(version),
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/edumips64/version.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version = "1.2.4"

0 comments on commit ea209b2

Please sign in to comment.