Build/Public/api.lua

141 lines
3.0 KiB
Lua

-- private
local buildAction = auRequire("Core/Actions")
local target = auRequire("Core/Target")
local main = auRequire("Core/Main")
-- executes inline under iprocessor::process
function auAddBuildAction(...)
buildAction(...)
end
function auAddBuildAction(...)
local type = {
-- stage: pre, post
-- filter: ...
-- lua/bin/targetName/command: relative path - lua script; relative path - executable; project name; command line
-- args: lua private passthrough; binary or target name command args
-- cwd: sln(default),prj
}
end
function auStart()
if (_auStart) then return end
_auStart = true
auRequire("Core/base")
end
function auStartSolution(sln)
auStart()
auRequire("Core").solution.start(sln)
end
function auStartProject(project)
auStart()
auRequire("Core").project.startProject(project)
end
function auProcessSolution()
main.processSolution()
end
function auFilterForPlatforms(callback, ...)
target.auFilterForPlatforms(callback, ...)
end
function auFilterForConfigs(callback, ...)
target.auFilterForConfigs(callback, ...)
end
function auFilterForConfigPlatforms(callback, ...)
target.auFilterForConfigPlatforms(callback, ...)
end
function auAddVisit(...)
main.addVisit(...)
end
-- Returns an array of filter tables where each optional table is checked against the current combination of config/platform/arch
-- Varargs are logical anded with the final filter table
-- in object -> defer to objects.lua
function auFilterOf(obj, ...)
return target.auFilterOf(obj, ...)
end
function auFilterConfig(configs)
return auFilterOf({
configs = configs
})
end
function auFilterArch(arch)
return auFilterOf({
archs = arch
})
end
function auFilterPlatform(platform)
return auFilterOf({
platforms = platform
})
end
function auGetSetting(name)
return Aurora.Settings[name]
end
_G.filterStack = {}
function auFilter(filter)
local tbl = _G.filterStack;
if (not filter or #filter == 0) then
table.remove(tbl, #tbl)
else
table.insert(tbl, filter)
end
--print("FILTERING ", json.encode(tbl), json.encode(filter))
_G.filter(tbl)
end
function auLinkProject(...)
main.linkAuProject(...)
end
function auIncludeProject(...)
main.includeAuProject(...)
end
function auLinkAndRefProject(...)
main.importAndLinkProject(...)
end
function auAddFeature(...)
main.addFeature(...)
end
function auGetCurrentProject()
return main.getCurrentProjectName()
end
function auGetProjectProcessor(name)
return main.getProjectProcessor(name)
end
function auGetProjectMeta(name)
local processor = auGetProjectProcessor(name)
if (not processor) then
return
end
return processor:getMeta()
end
function auGetCurrentProjectProcessor()
return main.getProjectProcessor(auGetCurrentProject())
end
function auGetCurrentProjectMeta()
return auGetCurrentProjectProcessor():getMeta()
end
function auIsProjectIntialized(name)
return main.isProjectLoaded(name)
end