Module make
The main build module that handles complete process of building standalone executable.
Functions
__call (proj_paths, entry_script, output_file, rocks_dir, opts) | Makes a standalone executable from the Lua project(s). |
Local Functions
default_entry_script (rockspec_file) | Returns path and name of single CLI script specified in the rockspec. |
rockspec_project_dir (rockspec_file) | Guesses project's base directory from the rockspec path. |
resolve_proj_paths (proj_paths) | Resolves project paths from the CLI arguments. |
resolve_dependencies (entry_script, extra_modules, excludes, pkg_path) | Resolves the entry script's dependencies, logs results and returns lists of modules and objects. |
Functions
- __call (proj_paths, entry_script, output_file, rocks_dir, opts)
-
Makes a standalone executable from the Lua project(s).
Parameters:
- proj_paths {string,...}
- entry_script optional string Path of the main Lua script.
- output_file optional string Name of the output binary.
- rocks_dir optional string Directory where to install required modules.
- opts optional table Options.
Raises:
if some error occurred.
Local Functions
- default_entry_script (rockspec_file)
-
Returns path and name of single CLI script specified in the rockspec. Or returns nil if:
- the rockspec is unreadable,
- there's no script defined in
build.install.bin
, - there's more than one script in
build.install.bin
.
Parameters:
- rockspec_file string Path of the rockspec file.
Returns:
Or
- nil
- string An error message.
- rockspec_project_dir (rockspec_file)
-
Guesses project's base directory from the rockspec path.
Parameters:
- rockspec_file string Path of the rockspec file.
Returns:
-
string
Absolute path of the project's directory.
- resolve_proj_paths (proj_paths)
-
Resolves project paths from the CLI arguments.
Parameters:
- proj_paths {string,...}
Returns:
-
{{string,string},...}
A list of pairs: path of the project's base
directory, absolute path of the rockspec.
Raises:
if rockspec is not specified or there is no unambiguous rockspec in the project's directory. - resolve_dependencies (entry_script, extra_modules, excludes, pkg_path)
-
Resolves the entry script's dependencies, logs results
and returns lists of modules and objects.
Parameters:
- entry_script string Path of the the Lua script.
- extra_modules optional {string,...} Paths of additional Lua scripts to scan.
- excludes
optional {string,...}
Module(s) to exclude from the analysis; one or more
glob patterns matching module name in dot notation (e.g.
"pl.*"
). - pkg_path optional string The path where to look for modules (see package.searchpath).
Returns:
- {table,...} A list of module entries.
- {string,...} A list of paths of the object files (native extensions).
Raises:
is some error accured.