[Rake-devel] Building Ruby extensions with Rake

Tilman Sauerbeck tilman at code-monkey.de
Mon Aug 7 12:13:04 EDT 2006

Tilman Sauerbeck [2006-08-06 21:25]:
> The bigger problem is the following. What if there's another task that
> defines some properties that are to be used in my_ext_task.link_libs
> for example?
> link_libs is set up in the block that's passed to ExtensionTask.new, but
> at that point, the other task that defines these properties isn't run
> yet (even if the order in which the tasks are run is correct).
> Is there some good way around this problem? This isn't a question
> specific to ExtensionTask, but a general one.

The following code shows how to fix that problem:

ext_task = nil

# this one goes first, so pre_ext is the very first prerequisite for the
# ext task
task :ext => [:pre_ext]

task :pre_ext do
	ext_task.more_properties = ...

ext_task = ExtensionTask.new :ext do |t|
	# just the minimal setup here
	t.dir = "ext"
	t.lib_name = ...


A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/rake-devel/attachments/20060807/1a4f1b54/attachment.bin 

More information about the Rake-devel mailing list