Skip to content

Commit

Permalink
Ensure binaries extensions get copied during gem generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
luislavena committed Nov 29, 2008
1 parent 248638a commit b1b1dda
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/rake/extensiontask.rb
Expand Up @@ -161,7 +161,16 @@ def define_native_tasks(for_platform = nil)
spec.extensions.clear

# add the binaries that this task depends on
# ensure the files get properly copied to lib_dir
ext_files = t.prerequisites.map { |ext| "#{@lib_dir}/#{File.basename(ext)}" }
ext_files.each do |ext|
unless Rake::Task.task_defined?("#{@lib_dir}/#{File.basename(ext)}") then
# strip out path and .so/.bundle
file "#{@lib_dir}/#{File.basename(ext)}" => ["copy:#{File.basename(ext).ext('')}:#{platf}"]
end
end

# include the files in the gem specification
spec.files += ext_files

# Generate a package for this gem
Expand Down

0 comments on commit b1b1dda

Please sign in to comment.