All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gems.ffi-1.9.7.gen.Rakefile Maven / Gradle / Ivy

There is a newer version: 3.7.2
Show newest version
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
require 'fileutils'
require 'ffi'
require 'ffi/platform'
require 'ffi/tools/types_generator'
types_conf = File.expand_path(File.join(FFI::Platform::CONF_DIR, 'types.conf'))

logfile = File.join(File.dirname(__FILE__), 'log')

file types_conf do |task|
  options = {}
  FileUtils.mkdir_p(File.dirname(task.name), { :mode => 0755 })
  File.open(task.name, File::CREAT|File::TRUNC|File::RDWR, 0644) do |f|
    f.puts FFI::TypesGenerator.generate(options)
  end
  File.open(logfile, 'w') do |log|
    log.puts(types_conf)
  end
end

task :default => types_conf do
end

task :clean do
  File.readlines(logfile).each do |file|
    file.strip!
    rm_f file
  end
  rm_f logfile
end




© 2015 - 2025 Weber Informatics LLC | Privacy Policy