summaryrefslogtreecommitdiff
path: root/lib/hoe/compiler.rb
blob: ac873e432cab9383bc45a860c5daff0e96d598fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
##
# rake-compiler plugin for hoe c-extensions.

module Hoe::Compiler
  def initialize_compiler
    extra_dev_deps << ["rake-compiler", "~> 0.7"]

    self.spec_extras = { :extensions => ["ext/#{self.name}/extconf.rb"] }
  end

  ##
  # Define tasks for compiler plugin.

  def define_compiler_tasks
    require "rake/extensiontask"

    Rake::ExtensionTask.new self.name, spec do |ext|
      ext.lib_dir = File.join(*["lib", self.name, ENV["FAT_DIR"]].compact)
    end
  end
end