A compromise between the speed of make and the ease of use of a build script
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
moonbuild/bin/task.moon

24 lines
744 B

-- load everything we need
import loadfile from require 'moonscript.base'
Context = require 'moonbuild.context'
DepGraph = require 'moonbuild.core.DAG'
tasks:
moonbuild: =>
args = {
nparallel: @parallel or @j
quiet: @quiet or @q
buildfile: @buildfile or @b
force: @force or @f
}
ctx = Context!
ctx\load (loadfile args.buildfile or 'Build.moon'), @
ctx\init!
dag = DepGraph ctx, #@ == 0 and ctx.defaulttargets or @
executor = do
Executor = do
ok, Executor = pcall -> require 'moonbuild.core.multiprocessexecutor'
ok and Executor or require 'moonbuild.core.singleprocessexecutor'
args.nparallel = Executor\getmaxparallel! if args.nparallel == true
Executor dag, args.nparallel
executor\execute args