Artifact Content

Artifact b107c87ce0d846d4ade5ef7fc80a53716ae13c898a84aeac649d1923b6a6e43a:


-- build.lua [-f build.conf.lua] [section [section [...]]] [-- [args for running]]
-- build with main config, override with section in order of appearance
-- "-f" argument is to use an alternate build config, "--" does not create an output file, but runs the created code immediately (with the given args)
--
-- example: build.lua comment v
-- will build with this config file: _self.build_comment.lua (comment) no binary (main) with comments included (comment) and verbose enabled (v)
--
-- naming of features, sections and snippets is free (sections may not use config options - will show a warning)
-- a CONST feature is always included and added to the environment of the snippets
-- a TEST feature is always discarded and is a posibility to add test code in the end of the file (see snippets to get an example)
--
--[[ DEFAULTS
binary = true
strip_binary = true
strip_comment = true
-- check_all test run all snippets / only the ones in the choosen features
check_all = false
-- feature is a comma/space separated list of features to add
feature = ""
-- license can be a file or string input
in_file =
-- is the out_file, if not given the name will be created from the in_file:
-- in_file is the master source file and is REQUIRED
out_file = string.gsub(in_file, ".lua", binary and "_build.luac" or "_build.lua")
license = "license.txt"
-- verbose runs build in verbose mode - snippets can use the _ENV var "_BUILD_VERBOSE"
verbose = false
--]]

feature = "LOG_WARN,LOG_INFO,LOG_DEBUG,getLicense, stripComment"
in_file = "build._main.lua"

-- we want a non binary build to build itself
binary = false
out_file = "_self.build.lua"

-- examples
bin = {
  binary = true,
  out_file = "_self.build.luac",
}

no_strip = {
  -- keeps the debug information (bigger)
  binary = true,
  strip_binary = false,
  out_file = "_self.build_debug.luac",
}

v = {
  verbose = true,
}

comment = {
  strip_comment = false,
  out_file = "_self.build_comment.lua",
}

only_getLicense_feature = {
  -- only for testing purpose
  feature = "getLicense",
  out_file = "_self.build_license_only.lua",
}

check_all_will_fail = {
  -- only for testing purpose - there is one feature in build that should fail
  -- but it's helpful to test every feature
  check_all = true,
}