Assign Jobs to functions
Closed this issue · 2 comments
It would be nice, in my point of view, that we could define jobs to call a function rather than calling a command sometimes.
Lua is different from makefiles! Lua is a programming language and makefiles are only markup files. In makefiles all functionality need to be done by external programs, in Bam we can do some small stuff with Lua itself!
Bam itself uses a small utility called text2c to convert lua files to c for include in the compilation.
I bet that could be done using Lua without need an external tool.
function Test()
print "test"
end
AddFJob("test",Test)
AddDependency(somecompilejob,"test")
Of course it could be set to accept a list of file and return another list of files like Compile does
also have dependencies on files and other jobs etc...
I hope you understand what i mean! Its really important! Scripting is welcome to Bam!
I've thought about this and there is a bit of problems with parallelism when it comes to lua. I've thought about adding a way to invoke bam as a lua interpreter only which would solve the parallelism issues.
You can now at least invoke bam to run a lua script. I can't really add this functionally in a good manner that makes sense.