-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.lua
64 lines (55 loc) · 1.79 KB
/
build.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env texlua
--[[
In short, to build the project:
l3build ctan
]]
module = "presenter"
docfiledir = "texmf/doc/latex/" .. module
typesetfiles = {"presenter-doc.tex", "presenter-code.tex"}
sourcefiledir = "texmf/source/latex/" .. module
-- l3build check
-- Checking will copy the unpack files to the final directory.
installfiles = {"*.sty", "*.cls"}
extraunpackdir = "texmf/tex/latex/" .. module
function checkinit_hook()
for _,src in pairs(installfiles) do
cp(src, unpackdir, extraunpackdir)
end
return 0
end
-- main check config
checkruns = 1
testfiledir = "testfiles"
testsuppdir = testfiledir .. "/support"
-- extra check configs
-- When save, use l3build save -c <config> <testname>
checkconfigs = {
"build",
"testfiles/tworuns/config"
}
-- l3build doc
-- prepare the test pdf in the doc (should be done after 'l3build check')
-- only main folder check could be included
maindir = "."
builddir = maindir .. "/build"
testdir = builddir .. "/test"
typesetdir = builddir .. "/doc"
function docinit_hook()
cp("*.pdf", testdir, typesetdir)
return 0
end
-- l3build tag x.x.x
-- Simple tagging, copyright information needs manual update.
tagfiles = {"*.dtx","presenter-code.tex"}
function update_tag(file, content, tagname, tagdate)
local iso = "%d%d%d%d%-%d%d%-%d%d"
local ver = "%d.%d.%d"
if string.match(file, "%.dtx$") then
return string.gsub(content, "{" .. iso .. "}{" .. ver .. "}",
"{" .. tagdate .. "}{" .. tagname .. "}")
elseif string.match(file, "%.tex$") then
return string.gsub(content, "\\date{" .. iso .. " \\quad v" .. ver .. "}",
"\\date{" .. tagdate .. " \\quad v" .. tagname .. "}")
end
return content
end