Build/Public/objects.lua
2022-03-04 17:05:38 +00:00

185 lines
3.6 KiB
Lua

-- This file serves as pseudo-documentation for json schemas and internal object requirements
function auEnum(...)
return nil
end
function auBuildActionO()
return {
stage = "post", -- pre, post,
-- filter: ...,
-- lua/bin/project/cmd: relative path - lua script; relative path - executable; project name; command line
-- args: lua private passthrough; binary or target name command args
cwd = "sln" -- sln, prj
}
end
function auProjectInfoO() -- extends auHeaderProject
return auMergeTable(auHeaderProject(), {})
end
function auBaseProjectO()
return {
info = auProjectInfoO(),
isInitialized = false
}
end
function auAbstractProjectO() -- extends auBaseProject
return auMergeTable(auBaseProject(), {
init = function(info, visit) end,
process = function(info, visit) end,
resolveDependencies = function(this, resolveFunction) end,
handleLink = function(this) end,
handleReference = function(this) end
})
end
function auProjectO() -- extends auAbstractProjectO
-- auAbstractProjectO is implemented by either your projects lua script or the json processor
end
function auSolutionO() -- extends auHeaderPartO
end
function auVisitO() -- extends auProjectInfoO
return {
translations = nil
-- TODO: options
-- TODO: null import shim
}
end
function auFilterInO()
-- When passed to filter, the following applys:
-- in configs (^if not opt), and in platforms (^if not opt), and in archs (^if not opt); and
-- notConfigs (^if not opt) does not contain config, and [...]
--
-- All fields must be string, tables/arrays, or nil
return
{
configs = nil,
platforms = nil,
archs = nil,
notConfigs = nil,
notPlatforms = nil,
notArchs = nil,
notOptions = nil,
options = nil
}
end
function auStartProjectO()
return
{
name = "Unnamed",
projectType = "SharedLibrary",
src = nil,
inc = nil,
dest = "!", -- "!" means default binary export path
root = nil
}
end
-- Root JSON element
function auHeaderProjectO()
return {
projectType = "ConsoleApp",
name = "AuroraProject",
namespace = "",
require = nil -- := auHeaderProjectKeyRequire(...)
}
end
--
local function __pushFilter(obj, key, callback)
if (not obj) then
return
end
local value = obj[key]
if (not value) then
return
end
if (obj.filter) then
filter(auFilterOf(obj.filter))
end
callback(value)
if (obj.filter) then
filter {}
end
end
local function __pushFilterString(obj, key, callback)
if (type(obj) == "string") then
callback(obj)
else
__pushFilter(obj, key, defines)
end
end
function auBlockProjectKeyDefines(obj)
__pushFilterString(obj, "value", defines)
end
function auBlockProjectKeyIncludes()
end
function auBlockProjectKeyFeatures()
end
function auBlockProjectKeyExcludes()
end
function auBlockProjectKeySources()
end
function auBlockProjectKeyLinks(obj)
__pushFilterString(obj, "value", links)
end
function auHeaderProjectKeyIncludeDepends()
end
function auHeaderProjectKeyIncludeSoftDepends()
end
function auHeaderProjectKeyLinkDepends()
end
function auHeaderProjectKeyLinkSoftDepends()
end
function auHeaderProjectKeyRequire(script)
auUserRequire(script)
end
-- Root JSON element and sub-documents
function auBlockProjectO()
end
-- Root JSON element
function auHeaderPartO()
return {
type = "part"
}
end