-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.lua
44 lines (39 loc) · 1.56 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
#!/usr/bin/env texlua
-- Identify the bundle and module
module = "rubos-tuda-template"
-- TDS-based installation
installfiles = {}
sourcefiles = {}
unpackfiles = {}
tdsdirs = {tex = "tex/latex/rubos-tuda-template"}
-- documentation (this will change to doc once i write "actual" documentation)
docfiledir = "examples"
-- demofiles = {"examples/Example.tex","examples/Feature-Showoff.tex"}
-- ypesetdemofiles = {"*.tex"}
typesetfiles = {"*.tex"}
typesetexe = "lualatex"
typesetopts = "-interaction=nonstopmode --shell-escape -halt-on-error"
packtdszip = true -- recommended for "tree" layouts
-- Tagging
tagfiles = {"tex/*.sty", "tex/*.cls"}
function tag_hook(tagname)
-- os.execute('git commit -a -m "Step release tag"')
-- os.execute('git tag -a -m "" ' .. tagname)
end
-- Detail how to set the version automatically
function update_tag(file, content, tagname, tagdate)
tagname = string.gsub(tagname, "^v", "")
if string.match(file, ".*%.sty") or string.match(file, ".*%.cls") then
-- \ProvidesExplPackage{<name>}{<date>}{<version>}{<description>}
temp = string.gsub(content,
"\\ProvidesExplPackage%{([^}]*)%}%{([^}]*)%}%{([^}]*)%}%{([^}]*)%}",
"\\ProvidesExplPackage{%1}{" .. tagdate .. "}{" .. tagname .. "}{%4}"
)
-- \ProvidesExplClass{<name>}{<date>}{<version>}{<description>}
return temp.gsub(temp,
"\\ProvidesExplClass%{([^}]*)%}%{([^}]*)%}%{([^}]*)%}%{([^}]*)%}",
"\\ProvidesExplClass{%1}{" .. tagdate .. "}{" .. tagname .. "}{%4}"
)
end
return content
end