jakejs / jake

JavaScript build tool, similar to Make or Rake. Built to work with Node.js.
http://jakejs.com
Apache License 2.0
1.97k stars 190 forks source link

Feature/rules multi sources #340

Open myklemykle opened 7 years ago

myklemykle commented 7 years ago

With this change, the second argument to rule() can be an array of source file names. That makes rules more powerful, and more orthogonal to how fileTasks already specify their requirements.

This change also extends the functionality when the second argument is a function; that function may return such an array of sources, instead of just a single source. (This is particularly handy for my work, and also seems orthogonal to how rules & fileTasks work generally.)

mde commented 7 years ago

@myklemykle This is a good start -- I've added some comments. Could we pull the function-as-prereq into a different PR that implements it across the board?

CodeLenny commented 6 years ago

@myklemykle @mde I'm interested in using this feature myself - actually, I assumed the feature was included in Jake, and was scratching my head for a while when it didn't work.

What's the status of this MR? I would be willing to attack the remaining comments if needed - making "function-as-prereq" work in all cases might be a little too much work for me right now, but I can definitely take care of the other items.