Rake: Looking for shortcut to file targets list from within a rakefile
I have several projects that are growing and I'm using rake to manage
the builds. These are NOT C builds and I cannot use patterns or globs
or suffixes to reliably collect all of the built files and
intermediates. So right now, for every file target that I specify I
have to manually add it to the CLOBBER list if I hope to completely
clean out the build to pristine condition.
I'm looking for a shortcut to all file targets from within a rakefile.
It has to be in there somewhere but looking through the rdoc, it
doesn't seem to be exposed.
I guess it's akin to using the results of "rake -T" but from within the
rakefile and keeping only targets of type "file". That way I can
simply do a "CLOBBER.include(ALL_FILE_TARGETS_ARY_OR_METHO D)" at the
end of the rakefile and be done with it and not have to remember to
push every file target on the clobber list.
Secondary hope: Sometimes I don't want to do a complete clean/clobber
and I'd like to prune all file targets that are in the dependency
"ancestor" tree of a specific target.
file f1 => [f_source1]do ... end
file f2 => [f1,f_source2] do ... end
file f3 => [f2] do ... end
file g1 do ... end
file g2 => [g1,g_source1] do ... end
file g3 => [g2] do ... end
# will clobber g3, g2, g1 but not any of the f's and not g_source1
since it's a dependency but not a file target
# adds f3, f2, f1 only
# end rakefile
then from shell
#removes only g items
> rake clobber
# removes both f and g items
> rake clean_f_also clobber
I know this example hardly motivates the desire but for a large growing
build where I can't rely on globs or suffixes, such a shortcut would be
SCons has some functionality like this but I wish to use Rake.
|All times are GMT. The time now is 10:13 PM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.