[latex3-commits] [git/LaTeX3-latex3-latex3] master: Use table-based approach for creating custom targets (66ae92b)

Joseph Wright joseph.wright at morningstar2.co.uk
Mon Jan 14 11:21:05 CET 2019


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/66ae92ba640225eead22e26bcebc5f367793a27c

>---------------------------------------------------------------

commit 66ae92ba640225eead22e26bcebc5f367793a27c
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Mon Jan 14 10:21:05 2019 +0000

    Use table-based approach for creating custom targets
    
    This way, things like uninstall 'just work'.


>---------------------------------------------------------------

66ae92ba640225eead22e26bcebc5f367793a27c
 l3kernel/build.lua |   47 ++++++-----------------------------------------
 1 file changed, 6 insertions(+), 41 deletions(-)

diff --git a/l3kernel/build.lua b/l3kernel/build.lua
index a48d68f..4b4cb22 100644
--- a/l3kernel/build.lua
+++ b/l3kernel/build.lua
@@ -173,47 +173,12 @@ function format()
   return 0
 end
 
--- l3kernel does all of the targets itself
-function main(target, files)
-  local errorlevel = 0
-  if target == "check" then
-    errorlevel = check(files)
-  elseif target == "clean" then
-    clean()
-  elseif target == "cmdcheck" then
-    errorlevel = cmdcheck()
-  elseif target == "ctan" then
-    errorlevel = ctan(true)
-  elseif target == "doc" then
-    errorlevel = doc(files)
-  elseif target == "format" then
-    errorlevel = format()
-  elseif target == "install" then
-    install()
-  elseif target == "save" then
-    if next(files) then
-      errorlevel = save(files)
-    else
-      help()
-    end
-  elseif target == "tag" then
-    if options["names"] and #options["names"] == 1 then
-      tag(options["names"][1])
-    else
-      print("Tag name required")
-      help()
-      exit(1)
-    end
-  elseif target == "unpack" then
-    errorlevel = unpack()
-  elseif target == "version" then
-    version()
-  else
-    help()
-  end
-  os.exit(errorlevel)
-end
-
+target_list = target_list or { }
+target_list.format =
+  {
+    func = format,
+    desc = "Creat l3formats"
+  }
 
 -- Find and run the build system
 kpse.set_program_name("kpsewhich")





More information about the latex3-commits mailing list