From: Joel VanderWerf Date: 2007-03-21T13:20:08+09:00 Subject: Re: Passing data to rant/rake for a customized build? Phrogz wrote: > On Mar 20, 12:45 pm, "Phrogz" wrote: >> Is the best choice to have our tool write out a text file manifest of >> all the assets of the various types, and have Rant tasks use that? >> [This would sort of match the ability of make (or rant) to derive >> dependencies from files with a known format (like C includes).] >> >> Do I build a folder structure and copy/alias all the resources into >> known buckets and have Rant enumerate the directories? (I'd have to >> copy the rantfile into the right spot to set the context to run with.) >> [This would match the *.c->*.o type mentality.] >> >> Do I use something like ERB and have a rantfile template (editable by >> customers) that our tool can use to dynamically customize the rantfile >> on each preview command? >> >> Is the rant "gen" method (that I don't yet understand) the answer I'm >> looking for? > > I left off one other option I had thought of: setting one or more > environment variables with the data in question before kicking off the > build. It's nice because there's no file I/O needed, but it prevents > the preview from being launched by anything but our tool. Command-line > preview/nightly builds are also desirable. You might not be aware of this, but rake accepts env vars with this syntax: rake e1=v1 e2=v2 ... task ... For example: $ cat rakefile task :bar do p ENV['foo'] end $ rake foo=3 bar (in /tmp) "3" Maybe rant has the same feature? -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407