diff options
author | tduehr <tduehr@gmail.com> | 2015-07-07 12:21:19 -0500 |
---|---|---|
committer | tduehr <tduehr@gmail.com> | 2015-07-07 12:21:19 -0500 |
commit | 198f3ac484f2df4e33eba2707b384c9a2d4b4614 (patch) | |
tree | ea9fade3a86d657b8dc426e993bcb735ab22df52 | |
parent | c60a190d6b05881bdacb8bfda6c88ccea3a2c7e9 (diff) | |
download | ffi-198f3ac484f2df4e33eba2707b384c9a2d4b4614.tar.gz |
tweak Rakefile
add types.conf generation stuff to main Rakefile
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Gemfile | 4 | ||||
-rw-r--r-- | Rakefile | 25 |
3 files changed, 28 insertions, 2 deletions
@@ -18,3 +18,4 @@ lib/ffi_c.so vendor .bundle Gemfile.lock +types_log @@ -8,3 +8,7 @@ group :development do gem 'rubygems-tasks', '~> 0.2.4', :require => 'rubygems/tasks' gem "rubysl", "~> 2.0", :platforms => 'rbx' end + +group :doc do + gem 'yard', "~> 0.8.7" +end @@ -93,13 +93,13 @@ task :package => 'gem:package' CLOBBER.include 'lib/ffi/types.conf' CLOBBER.include 'pkg' +CLOBBER.include 'log' CLEAN.include 'build' CLEAN.include 'conftest.dSYM' CLEAN.include 'spec/ffi/fixtures/libtest.{dylib,so,dll}' CLEAN.include 'spec/ffi/fixtures/*.o' -CLEAN.include "pkg/ffi-#{FFI::VERSION}-*-mingw32" -CLEAN.include "pkg/ffi-#{FFI::VERSION}-java" +CLEAN.include "pkg/ffi-*-{mingw32,java}" CLEAN.include 'lib/1.*' CLEAN.include 'lib/2.*' CLEAN.include 'bin' @@ -194,6 +194,27 @@ if USE_RAKE_COMPILER end end +$LOAD_PATH.unshift File.join(File.dirname(__FILE__), 'lib') +require 'ffi/platform' +types_conf = File.expand_path(File.join(FFI::Platform::CONF_DIR, 'types.conf')) +logfile = File.join(File.dirname(__FILE__), 'types_log') + +file types_conf => File.join("lib", "ffi", "version.rb") do |task| + require 'fileutils' + require 'ffi/tools/types_generator' + 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 :types_conf => types_conf do +end + Gem::Tasks.new do |t| t.scm.tag.format = '%s' end |