cws/build.sc
author Christian Urban <christian.urban@kcl.ac.uk>
Thu, 05 Oct 2023 10:31:05 +0100
changeset 939 f85e784d3014
parent 919 53f08d873e09
permissions -rwxr-xr-x
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
836
a3418ee8c404 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     1
#!/usr/bin/env amm
a3418ee8c404 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     2
889
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 887
diff changeset
     3
val files = Seq("cw01.tex",
919
53f08d873e09 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
     4
	        "cw02.tex",
53f08d873e09 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
     5
	        "cw03.tex",
53f08d873e09 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
     6
	        "cw04.tex",
53f08d873e09 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
     7
	        "cw05.tex")
836
a3418ee8c404 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     8
889
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 887
diff changeset
     9
val pdf_files = files.map(s => s.stripSuffix("tex") ++ "pdf")
836
a3418ee8c404 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    10
a3418ee8c404 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    11
a3418ee8c404 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    12
@main
a3418ee8c404 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    13
def make() = {
a3418ee8c404 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    14
  for (f <- files) {
a3418ee8c404 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    15
    println(s"Processing $f ...")
919
53f08d873e09 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
    16
    os.proc("lualatex", f).call(stdout = os.Inherit, stdin = os.Inherit)
53f08d873e09 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 889
diff changeset
    17
    os.proc("lualatex", f).call(stdout = os.Inherit, stdin = os.Inherit)
836
a3418ee8c404 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    18
  }
a3418ee8c404 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    19
}
a3418ee8c404 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    20
a3418ee8c404 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    21
a3418ee8c404 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    22
@main
a3418ee8c404 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    23
def hg() = {
889
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 887
diff changeset
    24
  println(os.proc("hg", "commit", "-m texupdate", files ++ pdf_files).call())
00c1c3408c93 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 887
diff changeset
    25
  println(os.proc("hg", "push").call())
836
a3418ee8c404 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    26
}