diff options
| author | ruki <[email protected]> | 2021-12-08 17:49:34 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-12-08 17:49:34 +0800 |
| commit | 23494057ededc3a8ae786c751c781de9c2c50564 (patch) | |
| tree | 37d5d3fce39d0fbd860aec64045f47efe098352a | |
| parent | 86eaab2842abf6570895da359ed484805bf759a5 (diff) | |
Update vsxmake.lua
| -rw-r--r-- | xmake/plugins/project/vsxmake/vsxmake.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/xmake/plugins/project/vsxmake/vsxmake.lua b/xmake/plugins/project/vsxmake/vsxmake.lua index cc50cb2d3..894a1895b 100644 --- a/xmake/plugins/project/vsxmake/vsxmake.lua +++ b/xmake/plugins/project/vsxmake/vsxmake.lua @@ -19,6 +19,7 @@ -- -- imports +import("core.base.option") import("core.base.hashset") import("vstudio.impl.vsinfo", { rootdir = path.directory(os.scriptdir()) }) import("render") @@ -172,6 +173,17 @@ function _writefileifneeded(file, content) io.writefile(file, content, {encoding = "utf8bom"}) end +-- save plugin arguments for `plugin.vsxmake.autoupdate` +-- @see https://github.com/xmake-io/xmake/issues/1895 +function _save_plugin_arguments() + local vsxmake_cache = localcache.cache("vsxmake") + for _, name in ipairs({"kind", "modes", "archs", "outputdir"}) do + vsxmake_cache:set(name, option.get(name)) + end + vsxmake_cache:save() +end + +-- clear configuration cache function _clear_cacheconf() config.clear() config.save() @@ -235,5 +247,8 @@ function make(version) -- clear config and local cache _clear_cacheconf() + + -- save plugin arguments for autoupdate + _save_plugin_arguments() end end |
