Skip to content
This repository
Newer
Older
100644 123 lines (109 sloc) 3.476 kb
eea37575 »
2008-09-12 Packaging
1 require 'rubygems'
7d838f24 »
2009-03-16 Add support for MrBones
2
e1bfea54 »
2009-01-01 Add 'gem rake-compiler'
3 USE_RAKE_COMPILER = (RUBY_VERSION =~ /1\.9.*/ || RUBY_PLATFORM =~ /java/) ? false : true
4 if USE_RAKE_COMPILER
5 gem 'rake-compiler', '>=0.3.0'
6 require 'rake/extensiontask'
7 end
7d838f24 »
2009-03-16 Add support for MrBones
8
eea37575 »
2008-09-12 Packaging
9 require 'date'
c1912005 »
2008-10-30 Add Rubinius license to LICENSE, and switch to the BSD license
10 require 'fileutils'
547209c6 »
2008-11-06 Hook in libtest build
11 require 'rbconfig'
eea37575 »
2008-09-12 Packaging
12
7d838f24 »
2009-03-16 Add support for MrBones
13 begin
14 require 'bones'
15 Bones.setup
16 rescue LoadError
17 begin
18 load 'tasks/setup.rb'
19 rescue LoadError
20 raise RuntimeError, '### please install the "bones" gem ###'
21 end
22 end
23
c7515362 »
2008-11-19 Add more benchmarks
24 LIBEXT = Config::CONFIG['host_os'].downcase =~ /darwin/ ? "dylib" : "so"
25 GMAKE = Config::CONFIG['host_os'].downcase =~ /bsd/ ? "gmake" : "make"
26 LIBTEST = "build/libtest.#{LIBEXT}"
2575195b »
2008-12-26 Build the extension lib in build/#{RUBY_VERSION} so multiple versions…
27 BUILD_DIR = "build/#{RUBY_VERSION}"
31d20fc7 »
2008-12-10 Convert compilation to use rake-compiler
28
7d838f24 »
2009-03-16 Add support for MrBones
29 # Project general information
30 PROJ.name = 'ffi'
31 PROJ.authors = 'Wayne Meissner'
32 PROJ.email = 'wmeissner@gmail.com'
33 PROJ.url = 'http://kenai.com/projects/ruby-ffi'
34 PROJ.version = '0.3.0'
35 PROJ.rubyforge.name = 'ffi'
36
37 PROJ.readme_file = 'README.rdoc'
38
39 # Annoucement
40 PROJ.ann.paragraphs
41 PROJ.ann.email[:from] = 'wmeissner@gmail.com'
42 PROJ.ann.email[:to] << 'dev@ruby-ffi.kenai.com' << 'users@ruby-ffi.kenai.com'
43 PROJ.ann.email[:server] = 'smtp.gmail.com'
44
45 # Gem specifications
46 PROJ.gem.need_tar = false
47 PROJ.gem.files = %w(LICENSE README.rdoc Rakefile) + Dir.glob("{ext,lib,nbproject,samples,spec}/**/*")
48 PROJ.gem.platform = Gem::Platform::RUBY
49 PROJ.gem.extensions = %w(ext/ffi_c/extconf.rb gen/Rakefile)
50
51 # RDoc
52 PROJ.rdoc.exclude << '^ext/'
31d20fc7 »
2008-12-10 Convert compilation to use rake-compiler
53
fa43165b »
2008-12-01 Make specs and rbx specs depend on just libtest if running under jrub…
54 TEST_DEPS = [ LIBTEST ]
68da8703 »
2008-09-13 rake specs works right on jruby and mri
55 if RUBY_PLATFORM == "java"
78926189 »
2008-11-10 Fix specs and rbxspecs tasks for ruby1.8/ruby1.9
56 desc "Run all specs"
fa43165b »
2008-12-01 Make specs and rbx specs depend on just libtest if running under jrub…
57 task :specs => TEST_DEPS do
f2387bad »
2008-12-12 Another raft of win32 fixes
58 sh %{#{Gem.ruby} -S spec #{Dir["spec/ffi/*_spec.rb"].join(" ")} -fs --color}
68da8703 »
2008-09-13 rake specs works right on jruby and mri
59 end
78926189 »
2008-11-10 Fix specs and rbxspecs tasks for ruby1.8/ruby1.9
60 desc "Run rubinius specs"
fa43165b »
2008-12-01 Make specs and rbx specs depend on just libtest if running under jrub…
61 task :rbxspecs => TEST_DEPS do
f2387bad »
2008-12-12 Another raft of win32 fixes
62 sh %{#{Gem.ruby} -S spec #{Dir["spec/ffi/rbx/*_spec.rb"].join(" ")} -fs --color}
e6e35184 »
2008-09-19 Add FFI::Buffer specs
63 end
68da8703 »
2008-09-13 rake specs works right on jruby and mri
64 else
fa43165b »
2008-12-01 Make specs and rbx specs depend on just libtest if running under jrub…
65 TEST_DEPS.unshift :compile
78926189 »
2008-11-10 Fix specs and rbxspecs tasks for ruby1.8/ruby1.9
66 desc "Run all specs"
fa43165b »
2008-12-01 Make specs and rbx specs depend on just libtest if running under jrub…
67 task :specs => TEST_DEPS do
68da8703 »
2008-09-13 rake specs works right on jruby and mri
68 ENV["MRI_FFI"] = "1"
2575195b »
2008-12-26 Build the extension lib in build/#{RUBY_VERSION} so multiple versions…
69 sh %{#{Gem.ruby} -Ilib -I#{BUILD_DIR} -S spec #{Dir["spec/ffi/*_spec.rb"].join(" ")} -fs --color}
68da8703 »
2008-09-13 rake specs works right on jruby and mri
70 end
78926189 »
2008-11-10 Fix specs and rbxspecs tasks for ruby1.8/ruby1.9
71 desc "Run rubinius specs"
fa43165b »
2008-12-01 Make specs and rbx specs depend on just libtest if running under jrub…
72 task :rbxspecs => TEST_DEPS do
e6e35184 »
2008-09-19 Add FFI::Buffer specs
73 ENV["MRI_FFI"] = "1"
2575195b »
2008-12-26 Build the extension lib in build/#{RUBY_VERSION} so multiple versions…
74 sh %{#{Gem.ruby} -Ilib -I#{BUILD_DIR} -S spec #{Dir["spec/ffi/rbx/*_spec.rb"].join(" ")} -fs --color}
e6e35184 »
2008-09-19 Add FFI::Buffer specs
75 end
348eda3f »
2008-09-13 specs
76 end
77
7d838f24 »
2009-03-16 Add support for MrBones
78 desc "Build all packages"
79 task :package => 'gem:package'
eea37575 »
2008-09-12 Packaging
80
7d838f24 »
2009-03-16 Add support for MrBones
81 desc "Install the gem locally"
82 task :install => 'gem:install'
eea37575 »
2008-09-12 Packaging
83
492c1b24 »
2008-12-26 Add back hand-rolled compilation rules for ruby 1.9 - I can't get rak…
84 unless USE_RAKE_COMPILER
2575195b »
2008-12-26 Build the extension lib in build/#{RUBY_VERSION} so multiple versions…
85 file "#{BUILD_DIR}/Makefile" do
86 FileUtils.mkdir_p(BUILD_DIR) unless File.directory?(BUILD_DIR)
9b6df2b1 »
2009-03-07 quote BUILD_DIR on the compile line
87 sh %{cd "#{BUILD_DIR}" && #{Gem.ruby} #{Dir.pwd}/ext/ffi_c/extconf.rb}
492c1b24 »
2008-12-26 Add back hand-rolled compilation rules for ruby 1.9 - I can't get rak…
88 end
89 desc "Compile the native module"
2575195b »
2008-12-26 Build the extension lib in build/#{RUBY_VERSION} so multiple versions…
90 task :compile => "#{BUILD_DIR}/Makefile" do
9b6df2b1 »
2009-03-07 quote BUILD_DIR on the compile line
91 sh %{cd "#{BUILD_DIR}"; make}
492c1b24 »
2008-12-26 Add back hand-rolled compilation rules for ruby 1.9 - I can't get rak…
92 end
93 end
94 desc "Clean all built files"
c1912005 »
2008-10-30 Add Rubinius license to LICENSE, and switch to the BSD license
95 task :clean do
96 FileUtils.rm_rf("build")
cb1df039 »
2008-11-08 Remove conftest.dSYM
97 FileUtils.rm_rf("conftest.dSYM")
a074a741 »
2008-11-16 Fix build on ubuntu 6.06
98 FileUtils.rm_f(Dir["pkg/*.gem"])
c1912005 »
2008-10-30 Add Rubinius license to LICENSE, and switch to the BSD license
99 end
470fea4d »
2008-11-16 Add some primitive argument packing tests. These test a combination o…
100 task "build/libtest.#{LIBEXT}" do
3bb83aea »
2008-11-12 Fix build+test on OpenBSD
101 sh %{#{GMAKE} -f libtest/GNUmakefile}
547209c6 »
2008-11-06 Hook in libtest build
102 end
2575195b »
2008-12-26 Build the extension lib in build/#{RUBY_VERSION} so multiple versions…
103 desc "Build test helper lib"
104 task :libtest => "build/libtest.#{LIBEXT}"
547209c6 »
2008-11-06 Hook in libtest build
105 desc "Test the extension"
fa43165b »
2008-12-01 Make specs and rbx specs depend on just libtest if running under jrub…
106 task :test => [ :specs, :rbxspecs ] do
547209c6 »
2008-11-06 Hook in libtest build
107 end
c7515362 »
2008-11-19 Add more benchmarks
108 namespace :bench do
109 ITER = ENV['ITER'] ? ENV['ITER'].to_i : 100000
2575195b »
2008-12-26 Build the extension lib in build/#{RUBY_VERSION} so multiple versions…
110 bench_libs = "-Ilib -I#{BUILD_DIR}" unless RUBY_PLATFORM == "java"
fa43165b »
2008-12-01 Make specs and rbx specs depend on just libtest if running under jrub…
111 bench_files = Dir["bench/bench_*.rb"].reject { |f| f == "bench_helper.rb" }
112 bench_files.each do |bench|
113 task File.basename(bench, ".rb")[6..-1] => TEST_DEPS do
114 sh %{#{Gem.ruby} #{bench_libs} #{bench} #{ITER}}
c7515362 »
2008-11-19 Add more benchmarks
115 end
116 end
fa43165b »
2008-12-01 Make specs and rbx specs depend on just libtest if running under jrub…
117 task :all => TEST_DEPS do
118 bench_files.each do |bench|
119 sh %{#{Gem.ruby} #{bench_libs} #{bench}}
c7515362 »
2008-11-19 Add more benchmarks
120 end
121 end
0288ab67 »
2008-12-05 Rename specs to spec/ffi
122 end
Something went wrong with that request. Please try again.