[Rake-devel] Using rules (as opposed to tasks) with multiple dependencies

Dave Thomas dave at pragprog.com
Wed Aug 6 17:12:53 EDT 2008

I'm converting our book production scripts from make to Rake, and seem  
to have bumped into an issue.

Say I want to convert XML to HTML via a couple of xslt scripts. I want  
to make the conversion trigger when the .html file is missing, or when  
it is out-of-date compared to the .xml file or either of the .xslt  
files. So, I have:

rule ".html" => [ ".cited-xml", HTML_XSL, LOCAL_HTML_XSL] do |t|
   xslt("ppb2html.xsl", t.source, t.name)

This rebuilds if the .html is out of date wrt the xml file, but  
ignores the timestamps on the two XSL files.

I guess my option is to synthesize file tasks for each of my possible  
targets, but this is one of many rules, and I have many HTML files-- 
I'd end up with hundreds if not thousands of tasks doing this.

Am I missing something obvious?


More information about the Rake-devel mailing list