summaryrefslogtreecommitdiff
path: root/xmake/core
diff options
context:
space:
mode:
authorruki <[email protected]>2019-07-26 22:19:02 +0800
committerruki <[email protected]>2019-07-26 07:54:17 +0800
commit6ef33a04fafe3a4b2ec757abcffb46ce5e7488ec (patch)
tree68a36f17ca80972fa33e7d90322510fd18067a9e /xmake/core
parentdd488ffd6dc1ec44b3d0c38a9dfd5f0ca99d6d2f (diff)
lock the whole project for some actions
Diffstat (limited to 'xmake/core')
-rw-r--r--xmake/core/sandbox/modules/import/core/project/project.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/xmake/core/sandbox/modules/import/core/project/project.lua b/xmake/core/sandbox/modules/import/core/project/project.lua
index a825f139a..cdd8562a3 100644
--- a/xmake/core/sandbox/modules/import/core/project/project.lua
+++ b/xmake/core/sandbox/modules/import/core/project/project.lua
@@ -148,6 +148,19 @@ function sandbox_core_project.directory()
return project.directory()
end
+-- get the filelock of the whole project directory
+function sandbox_core_project.filelock()
+ local filelock = sandbox_core_project._FILELOCK
+ if filelock == nil then
+ filelock = io.openlock(path.join(config.directory(), "project.lock"))
+ if not filelock then
+ raise("cannot create the project lock!")
+ end
+ sandbox_core_project._FILELOCK = filelock
+ end
+ return filelock
+end
+
-- get the project mtimes
function sandbox_core_project.mtimes()
return project.mtimes()