forked from latex3/latex3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.lua
63 lines (58 loc) · 1.61 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
#!/usr/bin/env texlua
-- Build script for LaTeX3 files
-- No bundle or module here, but these have to be defined
bundle = "LaTeX3"
module = ""
-- A couple of custom variables: the order here is set up for 'importance'
bundles = {"l3backend", "l3kernel", "l3packages", "l3experimental", "l3trial"}
checkbundles =
{
"l3kernel",
"l3packages",
"l3experimental",
"l3trial",
}
ctanbundles = {"l3backend", "l3kernel", "l3packages", "l3experimental"}
-- Location of main directory: use Unix-style path separators
maindir = "."
-- A custom main function
function main(target)
local errorlevel
if target == "check" then
errorlevel = call(checkbundles, "check")
elseif target == "clean" then
print ("Cleaning up")
call(bundles, "clean")
rm (".", "*.zip")
elseif target == "ctan" then
errorlevel = call (ctanbundles, "ctan")
if errorlevel == 0 then
for _,i in ipairs (ctanbundles) do
cp ("*.zip", i, ".")
end
end
elseif target == "doc" then
errorlevel = call(ctanbundles, "doc")
elseif target == "install" then
errorlevel = call (bundles, "install")
elseif target == "uninstall" then
errorlevel = call(bundles,"uninstall")
elseif target == "unpack" then
errorlevel = call (bundles, "unpack")
elseif target == "upload" then
errorlevel = call(ctanbundles,"upload")
elseif target == "tag" then
if options["names"] and #options["names"] == 1 then
call(ctanbundles,"tag")
else
print("Tag name required")
help()
exit(1)
end
else
help ()
end
if errorlevel ~=0 then
os.exit(1)
end
end