summaryrefslogtreecommitdiff
path: root/xmake/core/project/project.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2018-12-07 00:54:03 +0800
committerruki <[email protected]>2018-12-06 23:24:51 +0800
commitb4f35402ca2a97708dc46f6e48d60a3f5bf02f5e (patch)
tree2295e9ccea8377ea90b9407edce14bdb443e9970 /xmake/core/project/project.lua
parentb03855d7dbc88bc38c07d7b62ea73de0dbbef9f6 (diff)
improve set_config
Diffstat (limited to 'xmake/core/project/project.lua')
-rw-r--r--xmake/core/project/project.lua18
1 files changed, 7 insertions, 11 deletions
diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua
index c05884590..c9eb33fd9 100644
--- a/xmake/core/project/project.lua
+++ b/xmake/core/project/project.lua
@@ -123,13 +123,6 @@ function project._api_has_package(interp, ...)
end
end
--- set config from the given name
-function project._api_set_config(interp, name, value)
- if not config.readonly(name) then
- config.set(name, value)
- end
-end
-
-- get config from the given name
function project._api_get_config(interp, name)
return config.get(name)
@@ -217,6 +210,10 @@ function project.interpreter()
, "add_requires"
, "add_repositories"
}
+ , keyvalues =
+ {
+ "set_config"
+ }
, custom =
{
-- is_xxx
@@ -227,8 +224,6 @@ function project.interpreter()
, {"is_plat", project._api_is_plat }
, {"is_arch", project._api_is_arch }
, {"is_config", project._api_is_config }
- -- set_xxx
- , {"set_config", project._api_set_config }
-- get_xxx
, {"get_config", project._api_get_config }
-- has_xxx
@@ -308,8 +303,6 @@ function project.get(name)
-- load the global project infos
local infos = project._INFOS
if not infos then
-
- -- load infos
infos = project._load_scope(nil, true, true)
project._INFOS = infos
end
@@ -509,6 +502,9 @@ end
-- load requires
function project._load_requires()
+ -- @note clear the previous cache and reload root configs when call project.get()
+ project._INFOS = nil
+
-- parse requires
local requires = {}
local requires_extra = project.get("__extra_requires") or {}