Build/Public/api.lua

172 lines
3.7 KiB
Lua
Raw Normal View History

-- private
local buildAction = auRequire("Core/Actions")
local target = auRequire("Core/Target")
local main = auRequire("Core/main")
2022-03-05 19:34:41 +00:00
local resourceCompiler = auRequire("Core/ResourceCompiler")
2022-03-06 15:17:50 +00:00
local protobuf = auRequire("Core/Protobuf")
local vala = auRequire("Core/Vala")
-- executes inline under iprocessor::process
function auAddBuildAction(...)
buildAction(...)
end
function auAddBuildActionO(...)
2021-11-21 17:23:31 +00:00
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)
auRequire("Core").solution.start(sln)
end
function auStartProject(project)
2021-11-21 17:23:31 +00:00
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;
2022-01-18 21:06:27 +00:00
if (not filter or #filter == 0) then
table.remove(tbl, #tbl)
else
table.insert(tbl, filter)
end
local filterArray = {}
auForEach(tbl, function(val)
filterArray = auMergeArray(filterArray, val)
end)
--print("FILTERING ", json.encode(filterArray), json.encode(filter))
_G.filter(filterArray)
end
function auLinkProject(...)
main.linkAuProject(...)
end
function auIncludeProject(...)
main.includeAuProject(...)
end
function auLinkAndRefProject(...)
main.importAndLinkProject(...)
end
function auAddFeature(...)
main.addFeature(...)
end
function auGetBaseProjectName()
return main.getBaseProjectName()
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()
local temp = auGetCurrentProjectProcessor()
2022-03-05 19:34:41 +00:00
if (not temp) then return end
return auGetCurrentProjectProcessor():getMeta()
end
function auIsProjectIntialized(name)
return main.isProjectLoaded(name)
end
2022-03-05 19:34:41 +00:00
function auAddResource(...)
resourceCompiler(...)
2022-03-06 15:17:50 +00:00
end
2022-06-24 19:12:03 +00:00
function auProtobufFiles(files, extended)
protobuf.addProtobufFiles(files, extended)
end
function auProtobufIncludeProject(projectName)
protobuf.linkProject(projectName)
end
function auAddVala(info)
vala(info)
end