]> git.lizzy.rs Git - metalua.git/blobdiff - src/build-utils/precompile.lua
Merge branch 'master' of ssh://git.eclipse.org/gitroot/koneki/org.eclipse.koneki...
[metalua.git] / src / build-utils / precompile.lua
diff --git a/src/build-utils/precompile.lua b/src/build-utils/precompile.lua
deleted file mode 100644 (file)
index bf8aef9..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
--- Compile all files called *.mluam in a directory and its sub-directories,
--- into their *.luac counterpart.
---
--- This script is windows-only, Unices have half-decent shell script languages 
--- which let you do the same with a find and an xargs.
-
-cfg = { }
-for _, a in ipairs(arg) do
-   local var, val = a :match "^(.-)=(.*)"
-   if var then cfg[var] = val end
-end
-
-if not cfg.command or not cfg.directory then
-   error ("Usage: "..arg[0].." command=<metalua command> directory=<library root>")
-end
-
--- List all files, recursively, from newest to oldest
-local f = io.popen ("dir /S /b /o-D " .. cfg.directory)
-
-local file_seen = { }
-for src in f:lines() do
-   file_seen[src] = true
-   local base = src:match "^(.+)%.mlua$"
-   if base then
-      local target = base..".luac"
-      if file_seen[target] then 
-        -- the target file has been listed before the source ==> it's newer
-        print ("("..target.." up-to-date)")
-      else
-        local cmd = cfg.command.." "..src.." -o "..target
-        print (cmd)
-        os.execute (cmd)
-      end
-   end
-end
-
-