1
0
mirror of https://github.com/natnat-mc/moonbuild synced 2026-05-28 03:59:39 +02:00

4 Commits

Author SHA1 Message Date
Codinget 715aa2ebb7 Producing rockspec 2.5.1-1 2021-01-10 23:24:31 +01:00
Codinget bed119a40c added watcher to Alfons.moon 2021-01-10 22:43:18 +01:00
Codinget 57126a7973 fixed mkdirs sometimes failing due to race condition when multiprocess builds are running 2021-01-10 22:19:10 +01:00
Codinget cd9b0ab159 Producing rockspec 2.5.0-1 2020-12-02 02:49:11 +01:00
5 changed files with 83 additions and 9 deletions
+1
View File
@@ -7,6 +7,7 @@ tasks:
tasks.build!
sh "rockbuild -m -t #{@v} upload"
watch: => watch {'.'}, {'.git'}, 'live', (glob '*.moon'), pcall -> moonbuild j: true
build: => moonbuild j: true
install: => moonbuild 'install', j: true
clean: => moonbuild 'clean'
+9 -3
View File
@@ -166,10 +166,16 @@ mkdir = (dir) ->
clearentry parent dir
mkdirs = (dir) ->
return if isdir dir
error "Can't mkdirs #{dir}: file exists" if exists dir
if attr = attributes normalizepath dir
return if attr.mode == 'directory'
error "Can't mkdirs #{dir}: file exists"
mkdirs parent dir
mkdir dir
unless pcall -> actualmkdir dir
clearentry parent dir
clearentry dir
error "Failed to mkdirs #{dir}: last mkdir failed" unless isdir dir
clearentry parent dir
clearentry dir
-- from the backend
fs = {k, withcache fn for k, fn in pairs fs}
+19 -6
View File
@@ -973,14 +973,27 @@ mkdir = function(dir)
end
local mkdirs
mkdirs = function(dir)
if isdir(dir) then
return
end
if exists(dir) then
error("Can't mkdirs " .. tostring(dir) .. ": file exists")
do
local attr = attributes(normalizepath(dir))
if attr then
if attr.mode == 'directory' then
return
end
error("Can't mkdirs " .. tostring(dir) .. ": file exists")
end
end
mkdirs(parent(dir))
return mkdir(dir)
if not (pcall(function()
return actualmkdir(dir)
end)) then
clearentry(parent(dir))
clearentry(dir)
if not (isdir(dir)) then
error("Failed to mkdirs " .. tostring(dir) .. ": last mkdir failed")
end
end
clearentry(parent(dir))
return clearentry(dir)
end
do
local _tbl_0 = { }
+27
View File
@@ -0,0 +1,27 @@
build = {
install = {
bin = {
moonbuild = "out/moonbuild"
}
},
modules = {
moonbuild = "out/moonbuild.lua"
},
type = "builtin"
}
dependencies = {
"lua >= 5.1",
"argparse >= 0.7.1-1",
"moonscript >= 0.5.0-1"
}
description = {
detailed = "moonbuild is a small build system that simplifies your build definitions by allowing you to use declarative as well as imperative rules. It represents the build as a DAG with explicit ordering, and doesn't give you any default confusing rules (unlike make). If you can, installing luaposix and/or luafilesystem will speed up builds and increase stability.\n",
summary = "Small build system in between make and a build.sh"
}
package = "moonbuild"
rockspec_format = "3.0"
source = {
tag = "v2.5.0",
url = "git://github.com/natnat-mc/moonbuild"
}
version = "2.5.0-1"
+27
View File
@@ -0,0 +1,27 @@
build = {
install = {
bin = {
moonbuild = "out/moonbuild"
}
},
modules = {
moonbuild = "out/moonbuild.lua"
},
type = "builtin"
}
dependencies = {
"lua >= 5.1",
"argparse >= 0.7.1-1",
"moonscript >= 0.5.0-1"
}
description = {
detailed = "moonbuild is a small build system that simplifies your build definitions by allowing you to use declarative as well as imperative rules. It represents the build as a DAG with explicit ordering, and doesn't give you any default confusing rules (unlike make). If you can, installing luaposix and/or luafilesystem will speed up builds and increase stability.\n",
summary = "Small build system in between make and a build.sh"
}
package = "moonbuild"
rockspec_format = "3.0"
source = {
tag = "v2.5.1",
url = "git://github.com/natnat-mc/moonbuild"
}
version = "2.5.1-1"