[*] Transplanting new logic
This commit is contained in:
parent
7206d2f4a3
commit
3e2f123f66
@ -110,56 +110,12 @@ function JsonProcessor(info)
|
||||
end
|
||||
end
|
||||
|
||||
local processJsonBlockForLinks = function(object, this)
|
||||
auForEach(object.links, links)
|
||||
auForEach(object.depends, handleDependsShort, this, false)
|
||||
--auForEach(object["soft-depends"], handleDependsShort, this, true)
|
||||
end
|
||||
|
||||
function handleEvalForLinks(object, this)
|
||||
if (auIsArray(object)) then
|
||||
auForEach(object, handleEvalForLinks, this)
|
||||
return
|
||||
end
|
||||
|
||||
if (type(object) == "string") then
|
||||
return
|
||||
end
|
||||
|
||||
processJsonBlockForLinks(object, this)
|
||||
end
|
||||
|
||||
local handleActionCommon = function(action, cb, ...)
|
||||
local _if = action["if"]
|
||||
local _then = action["then"]
|
||||
|
||||
_G["info"] = info
|
||||
|
||||
if (_if) then
|
||||
local val = auEval("return " .. _if)
|
||||
if (not val) then
|
||||
return
|
||||
end
|
||||
|
||||
if (_then) then
|
||||
cb(_then, ...)
|
||||
end
|
||||
else
|
||||
if (action.eval) then
|
||||
cb(action.eval, ...)
|
||||
end
|
||||
end
|
||||
|
||||
_G["info"] = nil
|
||||
end
|
||||
|
||||
local handleActionsForLinks = function(action, this)
|
||||
handleActionCommon(action, handleEvalForLinks, this)
|
||||
end
|
||||
|
||||
local processSubLinks = function(this)
|
||||
processJsonBlockForLinks(result, this)
|
||||
auForEach(result.actions, handleActionsForLinks, this)
|
||||
|
||||
auRequire("Core/JSON/JSON").projectHandlers.runProjectLink(this, result, function(dep, soft)
|
||||
print("LINK-> ", dep, soft)
|
||||
handleDependsShort(dep, this, soft)
|
||||
end)
|
||||
end
|
||||
|
||||
local handleSourcesRel = function(source, path)
|
||||
@ -350,7 +306,7 @@ function JsonProcessor(info)
|
||||
processor:handleLink()
|
||||
end
|
||||
else
|
||||
defines(macro .. "=0")
|
||||
--defines(macro .. "=0")
|
||||
if (not soft) then
|
||||
fatal("missing project: ", dep)
|
||||
end
|
||||
@ -393,10 +349,6 @@ function JsonProcessor(info)
|
||||
processJsonBlock(object)
|
||||
end
|
||||
|
||||
local handleAction = function(action)
|
||||
handleActionCommon(action, handleEval)
|
||||
end
|
||||
|
||||
if (not isUtility) then
|
||||
processJsonBlock(result)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user