summaryrefslogtreecommitdiff
path: root/xmake/core/project/project.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2019-07-26 22:25:12 +0800
committerruki <[email protected]>2019-07-26 08:31:15 +0800
commitb03883547d69d2173ffc46f2c8b9e4d579247a60 (patch)
treef32ffc69484a9c2ef3da2fd7e7e9278b114217d3 /xmake/core/project/project.lua
parentc16826e5756f35aecac2323bf7c210fdbf9ba537 (diff)
improve project lock
Diffstat (limited to 'xmake/core/project/project.lua')
-rw-r--r--xmake/core/project/project.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua
index 581d16e1e..a673513ef 100644
--- a/xmake/core/project/project.lua
+++ b/xmake/core/project/project.lua
@@ -296,6 +296,16 @@ function project.directory()
return os.projectdir()
end
+-- get the filelock of the whole project directory
+function project.filelock()
+ local filelock = project._FILELOCK
+ if filelock == nil then
+ filelock = io.openlock(path.join(config.directory(), "project.lock"))
+ project._FILELOCK = filelock
+ end
+ return filelock
+end
+
-- get the project info from the given name
function project.get(name)
return project._INFO and project._INFO:get(name) or nil