Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 91 lines (82 sloc) 2.349 kb
eea3757 Packaging
wycats@localhost authored
1 require 'rubygems'
2 require 'rake/gempackagetask'
3 require 'rubygems/specification'
348eda3 @wycats specs
wycats authored
4 require "spec/rake/spectask"
eea3757 Packaging
wycats@localhost authored
5 require 'date'
c191200 Add Rubinius license to LICENSE, and switch to the BSD license
Wayne Meissner authored
6 require 'fileutils'
eea3757 Packaging
wycats@localhost authored
7
8 GEM = "ffi"
c191200 Add Rubinius license to LICENSE, and switch to the BSD license
Wayne Meissner authored
9 GEM_VERSION = "0.1.0"
eea3757 Packaging
wycats@localhost authored
10 AUTHOR = "Wayne Meissner"
11 EMAIL = "wmeissner@gmail.com"
12 HOMEPAGE = "http://kenai.com/projects/ruby-ffi"
379e9dd Fixup SUMMARY
Wayne Meissner authored
13 SUMMARY = "A Ruby foreign function interface (compatible with Rubinius and JRuby FFI)"
eea3757 Packaging
wycats@localhost authored
14
15 spec = Gem::Specification.new do |s|
16 s.name = GEM
17 s.version = GEM_VERSION
18 s.platform = Gem::Platform::RUBY
19 s.has_rdoc = true
20 s.extra_rdoc_files = ["README", "LICENSE"]
21 s.summary = SUMMARY
22 s.description = s.summary
23 s.author = AUTHOR
24 s.email = EMAIL
25 s.homepage = HOMEPAGE
c2be701 Add rubyforge_project
Wayne Meissner authored
26 s.rubyforge_project = 'ffi'
eea3757 Packaging
wycats@localhost authored
27 s.extensions = %w(ext/extconf.rb)
28
29 s.require_path = 'lib'
30 s.autorequire = GEM
31 s.files = %w(LICENSE README Rakefile) + Dir.glob("{ext,lib,nbproject,samples,specs}/**/*")
32 end
33
348eda3 @wycats specs
wycats authored
34 desc "Run all specs"
35 Spec::Rake::SpecTask.new("specs") do |t|
36 t.spec_opts = ["--format", "specdoc", "--colour"]
37 t.spec_files = Dir["spec/**/*_spec.rb"].sort
38 end
9ad1bb6 Move rubinius-api-only specs into specs/rbx
Wayne Meissner authored
39 desc "Run rubinius specs"
40 Spec::Rake::SpecTask.new("rbxspecs") do |t|
41 t.spec_opts = ["--format", "specdoc", "--colour"]
42 t.spec_files = Dir["spec/rbx/*_spec.rb"].sort
43 end
348eda3 @wycats specs
wycats authored
44
68da870 @wycats rake specs works right on jruby and mri
wycats authored
45 if RUBY_PLATFORM == "java"
46 desc "Run specs"
47 task :specs do
9ad1bb6 Move rubinius-api-only specs into specs/rbx
Wayne Meissner authored
48 sh %{#{Gem.ruby} -S spec #{Dir["specs/**/*_spec.rb"].join(" ")} -fs --color}
68da870 @wycats rake specs works right on jruby and mri
wycats authored
49 end
e6e3518 Add FFI::Buffer specs
Wayne Meissner authored
50 task :rbxspecs do
51 sh %{#{Gem.ruby} -S spec #{Dir["specs/rbx/**/*_spec.rb"].join(" ")} -fs --color}
52 end
68da870 @wycats rake specs works right on jruby and mri
wycats authored
53 else
54 desc "Run specs"
55 task :specs do
56 ENV["MRI_FFI"] = "1"
9ad1bb6 Move rubinius-api-only specs into specs/rbx
Wayne Meissner authored
57 sh %{#{Gem.ruby} -S spec #{Dir["specs/**/*_spec.rb"].join(" ")} -fs --color}
68da870 @wycats rake specs works right on jruby and mri
wycats authored
58 end
e6e3518 Add FFI::Buffer specs
Wayne Meissner authored
59 task :rbxspecs do
60 ENV["MRI_FFI"] = "1"
61 sh %{#{Gem.ruby} -S spec #{Dir["specs/rbx/**/*_spec.rb"].join(" ")} -fs --color}
62 end
348eda3 @wycats specs
wycats authored
63 end
64
eea3757 Packaging
wycats@localhost authored
65 Rake::GemPackageTask.new(spec) do |pkg|
66 pkg.gem_spec = spec
67 end
68
69 desc "install the gem locally"
70 task :install => [:package] do
71 sh %{sudo #{Gem.ruby} -S gem install pkg/#{GEM}-#{GEM_VERSION}}
72 end
73
74 desc "create a gemspec file"
75 task :make_spec do
76 File.open("#{GEM}.gemspec", "w") do |file|
77 file.puts spec.to_ruby
78 end
379e9dd Fixup SUMMARY
Wayne Meissner authored
79 end
c191200 Add Rubinius license to LICENSE, and switch to the BSD license
Wayne Meissner authored
80 file "Makefile" do
81 sh %{#{Gem.ruby} ext/extconf.rb}
82 end
83 task :compile => "Makefile" do
84 sh %{make}
85 end
86 task :clean do
c2be701 Add rubyforge_project
Wayne Meissner authored
87 sh %{make clean} if File.exists?("Makefile")
c191200 Add Rubinius license to LICENSE, and switch to the BSD license
Wayne Meissner authored
88 FileUtils.rm_rf("build")
89 FileUtils.rm_f(Dir["pkg/*.gem", "Makefile"])
90 end
Something went wrong with that request. Please try again.