-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.lua
76 lines (65 loc) · 2.07 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
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env texlua
-- Build script for "BXjakyureki" files
-- Identify the bundle and module: the module may be empty in the case where
-- there is no subdivision
bundle = ""
module = "bxjakyureki"
-- Location of main directory: use Unix-style path separators
maindir = "."
installfiles = {
"*.sty",
"bxjakyureki-kyureki.def",
"bxjakyureki-gengo.def"
}
sourcefiles = {
"*.dtx",
"*.ins",
"bxjakyureki-kyureki.def",
"bxjakyureki-gengo.def"
}
tagfiles = {"*.dtx","*.ins","LICENSE"}
textfiles = {"*.md", "LICENSE"}
-- Check settings
checkengines = {"ptex", "uptex", "luatex", "xetex", "pdftex"}
stdengine = "ptex"
-- checkformat = "latex"
-- checkopts = "-interaction=nonstopmode"
-- Typedet engine settings
-- typesetexe = "pdflatex"
-- typesetopts = "-interaction=nonstopmode"
-- pdftex also log non-ASCII.
asciiengines = {}
-- Should not wrap log lines.
maxprintline = 9999
-- Detail how to set the version automatically
function update_tag(file,content,tagname,tagdate)
local iso = "%d%d%d%d%-%d%d%-%d%d"
local author = "Yukimasa Morimi (h20y6m)"
if string.match(content,"Copyright %(c%)%s*[%d%-,]+ " .. author) then
local year = os.date("%Y")
content = string.gsub(content,
"Copyright %(c%)%s*([%d%-,]+) " .. author,
"Copyright (c) %1," .. year .. " " .. author)
content = string.gsub(content,year .. "," .. year,year)
content = string.gsub(content,
"%-" .. math.tointeger(year - 1) .. "," .. year,
"-" .. year)
content = string.gsub(content,
math.tointeger(year - 2) .. "," .. math.tointeger(year - 1) .. "," .. year,
math.tointeger(year - 2) .. "-" .. year)
end
if string.match(file,"%.dtx$") then
content = string.gsub(content,
"\n\\ProvidesExpl" .. "(%w+ *{[^}]+} *){" .. iso .. "}",
"\n\\ProvidesExpl%1{" .. tagname .. "}")
return string.gsub(content,
"\n%% \\date{Released " .. iso .. "}\n",
"\n%% \\date{Released " .. tagname .. "}\n")
end
return content
end
-- For old l3build
kpse.set_program_name("kpsewhich")
if not release_date then
dofile(kpse.lookup("l3build.lua"))
end