-
Notifications
You must be signed in to change notification settings - Fork 214
Expand file tree
/
Copy pathbuild.lua
More file actions
91 lines (72 loc) · 2.89 KB
/
build.lua
File metadata and controls
91 lines (72 loc) · 2.89 KB
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
#!/usr/bin/env texlua
---@diagnostic disable: lowercase-global
-- Configuration file for use with "l3build"
module = "gbt7714"
testfiledir = "./test/testfiles"
testsuppdir = testfiledir .. "/support"
-- sourcefiles = {"*.dtx", "*.sty"}
installfiles = {"*.sty", "*.bst"}
tagfiles = {"*.dtx", "*.ins", "CHANGELOG.md", "variants/*.ins"}
checkengines = {"xetex"}
stdengine = "xetex"
checkconfigs = {
"build",
"test/config-chapterbib",
"test/config-bibunits",
}
typesetexe = "xelatex"
unpackexe = "xetex"
checkruns = 3
local version_pattern = "[%d%l.-]+"
local f = assert(io.open("CHANGELOG.md", "r"))
local changelog_content = f:read("*all")
f:close()
local package_version, package_date = string.match(changelog_content,
"## %[(" .. version_pattern .. ")%] %- (%d%d%d%d%-%d%d%-%d%d)")
local ok, mydata = pcall(require, "zepingleedata.lua")
if not ok then
mydata = {}
end
local package_repository = "https://github.com/zepinglee/gbt7714-bibtex-style"
uploadconfig = {
version = package_version .. " " .. package_date,
author = "Zeping Lee",
license = "lppl1.3c",
uploader = mydata.name or "Zeping Lee",
email = mydata.email,
summary = "BibTeX implementation of China’s bibliography style standard GB/T 7714—2015",
description =
[[The package provides a BibTeX implementation for the Chinese national bibliography style standard GB/T 7714—2015. It consists of two bst files for numerical and author-year styles as well as a LaTeX package which provides the citation style defined in the standard. The package is compatible with natbib and supports language detection (Chinese and English) for each biblilography entry.]],
ctanPath = "/biblio/bibtex/contrib/gbt7714",
repository = package_repository,
bugtracker = package_repository .. "/issues",
topic = {"bibtex-sty", "chinese", "std-conform"},
update = true,
}
lvtext = ".tex"
function runtest_tasks(name)
return "bibtex -terse " .. name
end
function update_tag(file, content, tagname, tagdate)
local version = string.gsub(tagname, "^v", "")
local date = string.gsub(tagdate, "%-", "/")
content = string.gsub(content,
"Copyright %([Cc]%) (%d%d%d%d)%-+%d%d%d%d",
"Copyright (c) %1-" .. os.date("%Y"))
if file == "CHANGELOG.md" then
local previous = string.match(content, "/compare/v(" .. version_pattern .. ")%.%.%.HEAD")
if version ~= previous then
content = string.gsub(content,
"## %[Unreleased%]",
"## [Unreleased]\n\n## [" .. version .. "] - " .. tagdate)
content = string.gsub(content,
"v" .. version_pattern .. "%.%.%.HEAD",
"v" .. version .. "...HEAD\n[" .. version .. "]: " .. package_repository .. "/compare/v" .. previous
.. "...v" .. version)
end
elseif string.match(file, "%.dtx$") or string.match(file, "%.ins$") then
content = string.gsub(content, "%d%d%d%d/%d%d/%d%d v" .. version_pattern,
date .. " v" .. version)
end
return content
end