diff options
author | Karl Berry <karl@freefriends.org> | 2015-10-14 22:32:58 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-10-14 22:32:58 +0000 |
commit | 0346eca0b9378bffafb6b32579dd4542b71b57f5 (patch) | |
tree | f9a5b79922bd74de6945c98e47f9b1d3009da982 /Master/texmf-dist/source/latex/l3build | |
parent | 6028cf981b015fefcf1205f6cba193542627ddbf (diff) |
l3 (14oct15)
git-svn-id: svn://tug.org/texlive/trunk@38642 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3build')
-rw-r--r-- | Master/texmf-dist/source/latex/l3build/l3build.dtx | 72 |
1 files changed, 70 insertions, 2 deletions
diff --git a/Master/texmf-dist/source/latex/l3build/l3build.dtx b/Master/texmf-dist/source/latex/l3build/l3build.dtx index a91a228d8f0..e05215fd42f 100644 --- a/Master/texmf-dist/source/latex/l3build/l3build.dtx +++ b/Master/texmf-dist/source/latex/l3build/l3build.dtx @@ -39,8 +39,8 @@ \RequirePackage{expl3} \def\ExplFileName{l3build} \def\ExplFileDescription{L3 Regression test suite} -\def\ExplFileDate{2015/09/24} -\def\ExplFileVersion{6172} +\def\ExplFileDate{2015/10/14} +\def\ExplFileVersion{6210} \documentclass[full]{l3doc} \renewcommand\partname{Part} \usepackage{multicol,needspace} @@ -111,7 +111,9 @@ \luavarset{typesetsuppfiles}{\{~\}} {Files needed to support typesetting when \enquote{sandboxed}.} \luavarset{unpackfiles} {\{"*.ins"\}} {Files to run to perform unpacking.} \luavarset{unpacksuppfiles} {\{~\}} {Files needed to support unpacking when \enquote{sandboxed}.} +\luavarset{versionfiles} {\{"*.dtx"\}} {Files for automatic version editing.} \luavarseparator +\luavarset{bakext} {".bak"} {Extension of backup files.} \luavarset{lvtext} {".lvt"} {Extension of test files.} \luavarset{tlgext} {".tlg"} {Extension of test file output.} \luavarset{lvtext} {".lve"} {Extension of auto-generating test file output.} @@ -155,6 +157,7 @@ \luavarset{packtdszip} {false} {Build a TDS-style zip file for CTAN?} \luavarset{scriptname} {"build.lua"} {Name of script used in dependencies.} \luavarset{typesetcmds} {""} {Instructions to be passed to \TeX{} when doing typesetting.} +\luavarset{versionform} {""} {Nature of version strings for auto-replacement.} } \allluavars \newcommand\luavartypeset{% @@ -457,6 +460,16 @@ % A normalisation process is performed when checking to avoid common differences such as register allocation; full details are listed in section~\ref{sec:norm}. % \end{buildcmd} % +% \begin{buildcmd}{setversion} +% Modifies the content of files specified by |versionfiles| to allow +% automatic updating of the file date and version. The latter are +% specified using the |-d| and |-v| command line options and if not +% given will default to the current date in ISO format (YYYY-MM-DD) and |-1|, +% respectively. As detailed below, the standard set up has no search pattern +% defined for this target and so no action will be taken \emph{unless} +% a version type for substitution is set up (using \var{versionform} or +% by defining a custom function). +% \end{buildcmd} % % \begin{buildcmd}{unpack} % This is an internal target that is normally not needed on user level. @@ -921,6 +934,61 @@ % \label{fig:expect-ins} % \end{figure} % +% \section{Release-focussed features} +% +% \subsection{Automatic version modification} +% +% As detailed above, the |setversion| target will automatically edit +% source files to modify date and version. This behaviour is governed by +% variable \luavar{versionform}. As standard, no automatic replacement +% takes place, but setting \luavar{versionform} will allow this to happen, +% with options +% \begin{itemize} +% \item |ProvidesPackage| Searches for lines using the \LaTeXe{} +% \cs{ProvidesPackage}, \cs{ProvidesClass} and \cs{ProvidesFile} +% identifiers (as a whole line). +% \item |ProvidesExplPackage| Searches for lines using the \pkg{expl3} +% \cs{ProvidesExplPackage}, \cs{ProvidesExplClass} and +% \cs{ProvidesExplFile} identifiers (at the start of a line). +% \item |filename| Searches for lines using |\def\filename|, +% |\def\filedate|, \dots, formulation. +% \item |ExplFileName| Searches for lines using |\def\ExplFileName|, +% |\def\ExplFileDate|, \dots, formulation. +% \end{itemize} +% +% For more complex cases, the programmer may directly define the +% Lua function |setversion_update_line()|, which takes as arguments the line of the +% source, the supplied date and the supplied version. It should return a +% (possibly unmodified) line and may use one, both or neither of the +% date and version to update the line. Typically, |setversion_update_line| should +% match to the exact pattern used by the programmer in the source files. +% For example, for code using macros for the date and version +% a suitable function might read as shown in Figure~\ref{fig:update-line}. +% \begin{figure} +% \begin{lstlisting}[frame=single,language={[5.2]Lua},gobble = 6] +% function setversion_update_line(line, date, version) +% local i +% -- No real regex so do it one type at a time +% for _,i in pairs({"Class", "File", "Package"}) do +% if string.match( +% line, +% "^\\Provides" .. i .. "{[a-zA-Z0-9%-]+}%[[^%]]*%]$" +% ) then +% line = string.gsub(line, "%[%d%d%d%d/%d%d/%d%d", "[" +% .. string.gsub(date, "%-", "/") +% line = string.gsub( +% line, "(%[%d%d%d%d/%d%d/%d%d) [^ ]*", "%1 " .. version +% ) +% break +% end +% end +% return line +% end +% \end{lstlisting} +% \caption{Example \texttt{setversion_update_line} function.} +% \label{fig:update-line} +% \end{figure} +% % \subsection{Typesetting documentation} % % As part of the overall build process, \pkg{l3build} will create PDF |