From b4f35402ca2a97708dc46f6e48d60a3f5bf02f5e Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 7 Dec 2018 00:54:03 +0800 Subject: improve set_config --- xmake/core/project/project.lua | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'xmake/core/project/project.lua') 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 {} -- cgit v1.3.1