[latex3-commits] [l3svn] 05/05: l3build: Document new "setversion" target
noreply at latex-project.org
noreply at latex-project.org
Wed Oct 7 23:36:01 CEST 2015
This is an automated email from the git hooks/post-receive script.
joseph pushed a commit to branch master
in repository l3svn.
commit e66c65d27d3cee4aafff493ad9918cbdb663ff20
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Wed Oct 7 22:34:41 2015 +0100
l3build: Document new "setversion" target
---
l3build/l3build.dtx | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/l3build/l3build.dtx b/l3build/l3build.dtx
index a91a228..1069c9b 100644
--- a/l3build/l3build.dtx
+++ b/l3build/l3build.dtx
@@ -111,6 +111,7 @@
\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{lvtext} {".lvt"} {Extension of test files.}
\luavarset{tlgext} {".tlg"} {Extension of test file output.}
@@ -457,6 +458,15 @@
% 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 byy |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}
+% the programmer has set up the appropriate function in the |build.lua| file.
+% \end{buildcmd}
%
% \begin{buildcmd}{unpack}
% This is an internal target that is normally not needed on user level.
@@ -921,6 +931,31 @@
% \label{fig:expect-ins}
% \end{figure}
%
+% \subsection{Automatic version modification}
+%
+% As detailed above, the |sertversion| target will automatically edit
+% source files to modify date and version. This behaviour is governed by the
+% Lua function |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, |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
+% \begin{verbatim}
+% function update_line(line, date, version)
+% local date = string.gsub(date, "%-", "/")
+% -- Replace the identifiers
+% if string.match(line, "^\\def\\filedate{%d%d%d%d/%d%d/%d%d}$") then
+% line = "\\def\\filedate{" .. date .. "}"
+% end
+% if string.match(line, "^\\def\\fileversion{%d+}$") then
+% line = "\\def\\fileversion{" .. version .. "}"
+% end
+% return line
+% end
+% \end{verbatim}
+%
% \subsection{Typesetting documentation}
%
% As part of the overall build process, \pkg{l3build} will create PDF
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the latex3-commits
mailing list