[*] Transplanting new logic
This commit is contained in:
parent
7206d2f4a3
commit
3e2f123f66
@ -110,56 +110,12 @@ function JsonProcessor(info)
|
|||||||
end
|
end
|
||||||
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)
|
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
|
end
|
||||||
|
|
||||||
local handleSourcesRel = function(source, path)
|
local handleSourcesRel = function(source, path)
|
||||||
@ -350,7 +306,7 @@ function JsonProcessor(info)
|
|||||||
processor:handleLink()
|
processor:handleLink()
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
defines(macro .. "=0")
|
--defines(macro .. "=0")
|
||||||
if (not soft) then
|
if (not soft) then
|
||||||
fatal("missing project: ", dep)
|
fatal("missing project: ", dep)
|
||||||
end
|
end
|
||||||
@ -393,10 +349,6 @@ function JsonProcessor(info)
|
|||||||
processJsonBlock(object)
|
processJsonBlock(object)
|
||||||
end
|
end
|
||||||
|
|
||||||
local handleAction = function(action)
|
|
||||||
handleActionCommon(action, handleEval)
|
|
||||||
end
|
|
||||||
|
|
||||||
if (not isUtility) then
|
if (not isUtility) then
|
||||||
processJsonBlock(result)
|
processJsonBlock(result)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user