Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (20 sloc) 578 Bytes
require 'rake'
require 'rake/tasklib'
require 'tempfile'
require 'lib/ffi/struct_generator'
require 'lib/ffi/const_generator'
require 'lib/ffi/generator'
##
# Rake task that calculates C structs for FFI::Struct.
class FFI::Generator::Task < Rake::TaskLib
def initialize(rb_names)
task :clean do rm_f rb_names end
rb_names.each do |rb_name|
ffi_name = "#{rb_name}.ffi"
file rb_name => ffi_name do |t|
puts "Generating #{rb_name}..." if Rake.application.options.trace
FFI::Generator.new ffi_name, rb_name
end
end
end
end
Something went wrong with that request. Please try again.