hws/build.sc
changeset 928 2f3c077359c4
child 937 dc5ab66b11cc
equal deleted inserted replaced
927:ef54868a9226 928:2f3c077359c4
       
     1 #!/usr/bin/env amm
       
     2 
       
     3 val files = Seq("hw01.tex",
       
     4 	        "hw02.tex",
       
     5 	        "hw03.tex",
       
     6 	        "hw04.tex",
       
     7 	        "hw05.tex",
       
     8                 "hw06.tex",
       
     9 	        "hw07.tex",
       
    10 	        "hw08.tex",
       
    11 	        "hw09.tex")
       
    12 
       
    13 val pdf_files = files.map(s => s.stripSuffix("tex") ++ "pdf")
       
    14 
       
    15 
       
    16 @main
       
    17 def make() = {
       
    18   for (f <- files) {
       
    19     println(s"Processing $f ...")
       
    20     os.proc("lualatex", f).call(stdout = os.Inherit, stdin = os.Inherit)
       
    21   }
       
    22 }
       
    23 
       
    24 @main
       
    25 def make_sols() = {
       
    26   for (f <- files) {
       
    27     val old_pdf = f.stripSuffix(".tex") ++ ".pdf"
       
    28     val new_pdf = f.stripSuffix(".tex") ++ "-sol.pdf"
       
    29     println(s"Processing $f -> $new_pdf ...")
       
    30     os.proc("lualatex", f, "sol").call(stdout = os.Inherit, stdin = os.Inherit)
       
    31     os.move.over(os.pwd / old_pdf, os.pwd / new_pdf)
       
    32   }
       
    33 }
       
    34 
       
    35 @main
       
    36 def hg() = {
       
    37   println(os.proc("hg", "commit", "-m texupdate", files ++ pdf_files).call())
       
    38   println(os.proc("hg", "push").call())
       
    39 }