forked from josephwright/csquotes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.lua
43 lines (35 loc) · 1.09 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
#!/usr/bin/env texlua
-- Build script for "csquotes" files
-- Identify the bundle and module
bundle = ""
module = "csquotes"
-- Install .def files as well as .sty
-- These are also the sources
installfiles = {"*.cfg", "*.def", "*.sty"}
sourcefiles = installfiles
-- Documentation is standalone
typesetfiles = {"*.tex"}
-- No packed source files
unpackfiles = {""}
-- Release a TDS-style zip
packtdszip = true
-- Detail how to set the version automatically
versionfiles = {"*.def", "*.sty", "*.tex"}
function setversion_update_line(line, date, release)
local date = string.gsub(date, "%-", "/")
-- Code
if string.match(line, "^ %[%d%d%d%d/%d%d/%d%d") then
line = string.gsub(line, "%d%d%d%d/%d%d/%d%d [^ ]*", date .. " " .. release)
end
-- Docs
if string.match(line, "^ date=") then
line = string.gsub(line, "{[^}]*}", "{" .. date .."}")
end
if string.match(line, "^ revision=") then
line = string.gsub(line, "{[^}]*}", "{" .. release .."}")
end
return line
end
-- Find and run the build system
kpse.set_program_name ("kpsewhich")
dofile (kpse.lookup ("l3build.lua"))