diff options
author | Ryan Davis <ryand@zenspider.com> | 2010-12-07 20:24:41 -0800 |
---|---|---|
committer | Ryan Davis <ryand@zenspider.com> | 2010-12-07 20:24:41 -0800 |
commit | d37e32a2254457dd40a1113781678ca501fc621e (patch) | |
tree | 5fad7becb64dc6f0b58915a3e7772917c1eea684 | |
parent | c16831d377cae4aed028ee8a722768efb4a9012c (diff) | |
download | hoe-d37e32a2254457dd40a1113781678ca501fc621e.tar.gz |
Added doco and parameterized the compile tasks
[git-p4: depot-paths = "//src/hoe/dev/": change = 6042]
-rw-r--r-- | lib/hoe/compiler.rb | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/lib/hoe/compiler.rb b/lib/hoe/compiler.rb index ac873e4..e6e4c82 100644 --- a/lib/hoe/compiler.rb +++ b/lib/hoe/compiler.rb @@ -1,11 +1,30 @@ ## # rake-compiler plugin for hoe c-extensions. +# +# This plugin is for extconf.rb based projects that want to use +# rake-compiler to deal with packaging binary gems. It expects a +# standard extconf setup, namely that your extconf.rb and c source is +# located in: ext/project-name. +# +# === Tasks Provided: +# +# compile:: Compile your c-extension. module Hoe::Compiler + + ## + # Optional: Defines what tasks need to be compile first. [default: test] + + attr_accessor :compile_tasks + + ## + # Initialize variables for compiler plugin. + def initialize_compiler - extra_dev_deps << ["rake-compiler", "~> 0.7"] + self.compile_tasks = [:multi, :test] + self.spec_extras = { :extensions => ["ext/#{self.name}/extconf.rb"] } - self.spec_extras = { :extensions => ["ext/#{self.name}/extconf.rb"] } + extra_dev_deps << ["rake-compiler", "~> 0.7"] end ## @@ -17,5 +36,9 @@ module Hoe::Compiler Rake::ExtensionTask.new self.name, spec do |ext| ext.lib_dir = File.join(*["lib", self.name, ENV["FAT_DIR"]].compact) end + + compile_tasks.each do |t| + task t => :compile + end end end |