summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRyan Davis <ryand@zenspider.com>2010-12-07 20:24:41 -0800
committerRyan Davis <ryand@zenspider.com>2010-12-07 20:24:41 -0800
commitd37e32a2254457dd40a1113781678ca501fc621e (patch)
tree5fad7becb64dc6f0b58915a3e7772917c1eea684 /lib
parentc16831d377cae4aed028ee8a722768efb4a9012c (diff)
downloadhoe-d37e32a2254457dd40a1113781678ca501fc621e.tar.gz
Added doco and parameterized the compile tasks
[git-p4: depot-paths = "//src/hoe/dev/": change = 6042]
Diffstat (limited to 'lib')
-rw-r--r--lib/hoe/compiler.rb27
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