-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.lua
144 lines (128 loc) · 5.35 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#!/usr/bin/env texlua
packageversion="0.96n"
packagedate="2024-10-27"
local luatexstatus = status.list()
-- Build script for "LaTeX PDF management testphase bundle" bundle
-- Identify the bundle and module
bundle = ""
module = "pdfmanagement-testphase"
typesetexe="pdflatex"
installfiles = {"*.sty","*.cls","*.def","*.lua","*.ltx"}
if options["target"] == "ctan" then
sourcefiles = {"*.dtx","*.ins",
"firstaid/xcolor-patches-tmp-ltx.sty",
"firstaid/color-ltx.sty",
"firstaid/colorspace-patches-tmp-ltx.sty",
}
else
sourcefiles = {"*.dtx","*.ins",
"firstaid/xcolor-patches-tmp-ltx.sty",
"firstaid/color-ltx.sty",
"firstaid/colorspace-patches-tmp-ltx.sty",
"newpackages/new-bookmark.sty",
"newpackages/bkm-generic.def",
"newpackages/new-attachfile.sty",
"newpackages/atfi-generic.def",
}
end
checkruns = 4
recordstatus=true
specialformats = specialformats or {}
specialformats["latex"] = specialformats["latex"] or
{
luatex = {binary="luahbtex",format = "lualatex-dev"},
pdftex = {format = "pdflatex-dev"},
xetex = {format = "xelatex-dev"},
latexdvips = {binary="latex",format = "latex-dev"}
}
-- to try without dev-format
-- specialformats["latex"] = specialformats["latex"] or
-- {
-- luatex = {binary="luahbtex",format = "lualatex"},
-- pdftex = {format = "pdflatex"},
-- xetex = {format = "xelatex"},
-- latexdvips = {binary="latex",format = "latex"}
-- }
-- packtdszip = true
checkengines = {"pdftex","luatex","xetex"}
if os.type == "windows" then
checkconfigs = {"build", -- luatex, pdftex, xetex
"config-noxetex", --pdftex + luatex (std)
"config-luatex", -- luatex
"config-dvips", -- latex + dvips
"config-pdftex", -- pdftex
"config-xetex" -- xetex
}
else
-- exclude dvips tests if not on windows
checkconfigs = {"build", -- luatex, pdftex, xetex
"config-noxetex", --pdftex + luatex (std)
"config-luatex", -- luatex
-- "config-dvips", -- latex + dvips
"config-pdftex", -- pdftex
"config-xetex" -- xetex
}
-- exclude only record status works again
excludetests = {"show","catalog-remove"}
end
-- tagging
tagfiles = {
"*dtx",
"firstaid/*.sty",
"README.md",
"CHANGELOG.md"
}
function update_tag (file,content,tagname,tagdate)
tagdate = string.gsub (packagedate,"-", "/")
if string.match (file, "l3backend%-testphase.dtx" ) then
content = string.gsub (content,
"{%d%d%d%d%-%d%d%-%d%d}",
"{".. packagedate .. "}")
content = string.gsub (content,
"date{Version %d%.%d+%a, released %d%d%d%d%-%d%d%-%d%d",
"date{Version "..packageversion..", released ".. packagedate)
content = string.gsub (content,
"Copyright %(C%) (%d%d%d%d)%-%d%d%d%d",
"Copyright (C) %1-"..os.date("%Y"))
return content
elseif string.match (file, "%.dtx$" ) then
content = string.gsub (content,
"\\ProvidesExplPackage{(.-)}{.-}{.-}",
"\\ProvidesExplPackage{%1}{" .. packagedate.."}{"..packageversion .. "}")
content = string.gsub (content,
"\\ProvidesExplFile{(.-)}{.-}{.-}",
"\\ProvidesExplFile{%1}{" .. packagedate.."}{"..packageversion .. "}")
content = string.gsub (content,
"\\ProvidesFile{(.-)}%[%d%d%d%d%-%d%d%-%d%d v%d%.%d+%a",
"\\ProvidesFile{%1}["..packagedate.." v"..packageversion)
content = string.gsub (content,
"date{Version %d%.%d+%a, released %d%d%d%d%-%d%d%-%d%d",
"date{Version "..packageversion..", released ".. packagedate)
content = string.gsub (content,
"Copyright %(C%) (%d%d%d%d)%-%d%d%d%d",
"Copyright (C) %1-"..os.date("%Y"))
return content
elseif string.match (file, "%.sty$" ) then
content = string.gsub (content,
"\\ProvidesPackage{(.-)}%[%d%d%d%d%-%d%d%-%d%d v%d%.%d+%a",
"\\ProvidesPackage{%1}["..packagedate.." v"..packageversion)
content = string.gsub (content,
"\\ProvidesExplPackage{(.-)}{.-}{.-}",
"\\ProvidesExplPackage{%1}{" .. packagedate.."}{"..packageversion .. "}")
return content
elseif string.match (file, "^README.md$") then
content = string.gsub (content,
"Version: %d%.%d+%a, %d%d%d%d%-%d%d%-%d%d",
"Version: " .. packageversion .. ", " .. packagedate )
content = string.gsub (content,
"(%d%d%d%d)%-%d%d%d%d",
"%1-"..os.date("%Y"))
return content
elseif string.match (file, "^CHANGELOG.md$") then
content = string.gsub (content,
"%[Unreleased%]",
"[".. packagedate.."]" )
return content
end
return content
end