SquidDev-CC / Howl

A CC build system
http://www.computercraft.info/forums2/index.php?/topic/21254-
MIT License
16 stars 4 forks source link

File dependencies within tasks #3

Closed SquidDev closed 9 years ago

SquidDev commented 9 years ago

A task should be able to depend on a file being generated, like Rake.

Something like:

aTask:Produces('myFile.lua') -- Produces a file

anotherTask:Requires('myFile.lua`) -- Calls aTask first

Using patterns and wildcards would be nice

-- Anything that looks like {name}.lua is replaced with {name}.min.lua. 
-- What we actually do is when {name}.min.lua is requested we pass in {name}.lua {name}.min.lua
-- This isn't as intuitive, but from a code position, makes more sense
aTask:Maps('ptrn:%1%.lua', 'ptrn:.+%.min%.lua') 

-- Wildcards are just replaced at runtime. '*' is replaced with '(.*)' or '%1'.
aTask:Maps('wild:src/*.lua', 'wild:build/*.lua')

-- Runs aTask with `something.lua` as an argument.
anotherTask:Requires('something.min.lua') 
SquidDev commented 9 years ago

Implemented as of 800fec78de4b148968c9ede2385b99ae16371438. Released in 0.1pr4