Add new call includeExternal()

Works like include(), but any containers created by the included scripts (projects, solutions, rules) will be marked as external.
This commit is contained in:
Jason Perkins 2014-10-29 17:43:32 -04:00
parent 920ddcb1f1
commit 71bb1f8079

View File

@ -46,7 +46,9 @@
end
_G[containerName] = function(name)
return api._setContainer(class, name)
local c = api._setContainer(class, name)
c.external = api._isIncludingExternal
return c
end
_G["external" .. containerName:capitalized()] = function(name)
@ -60,6 +62,20 @@
---
-- Register a general-purpose includeExternal() call which works just like
-- include(), but marks any containers created while evaluating the included
-- scripts as external.
---
function includeExternal(fname)
api._isIncludingExternal = true
include(fname)
api._isIncludingExternal = nil
end
---
-- Return the global configuration container. You could just call global()
-- too, but this is much faster.