-
-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathRakefile
More file actions
60 lines (48 loc) · 1.59 KB
/
Rakefile
File metadata and controls
60 lines (48 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
require 'bundler/gem_tasks'
require 'rake/clean'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new
RSpec::Core::RakeTask.new(:rcov) do |task|
task.rcov = true
end
task :default => %w(compile spec)
require 'rdoc/task'
Rake::RDocTask.new do |rdoc|
version = File.exist?('VERSION') ? File.read('VERSION') : ""
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "cool.io #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
require 'rake/extensiontask'
spec = Gem::Specification.load("cool.io.gemspec")
def configure_cross_compilation(ext)
unless RUBY_PLATFORM =~ /mswin|mingw/
ext.cross_compile = true
ext.cross_platform = ['x86-mingw32', 'x64-mingw32']
end
end
Rake::ExtensionTask.new('cool.io_ext', spec) do |ext|
ext.ext_dir = 'ext/cool.io'
configure_cross_compilation(ext)
end
# Note that this rake-compiler-dock rake task dose not support bundle install(1) --path option.
# Please use bundle install instead when you execute this rake task.
namespace :build do
desc 'Build gems for Windows per rake-compiler-dock'
task :windows do
require 'rake_compiler_dock'
RakeCompilerDock.sh <<-CROSS
bundle && bundle exec rake cross native gem RUBY_CC_VERSION='3.0.0:2.7.0:2.6.0:2.5.0:2.4.0'
CROSS
end
end
if RUBY_PLATFORM.include?('linux')
require 'ruby_memcheck'
require 'ruby_memcheck/rspec/rake_task'
namespace :spec do
RubyMemcheck::RSpec::RakeTask.new(valgrind: :compile)
end
end
CLEAN.include "**/*.rbc", "**/*.o", "**/*.so", "**/*.bundle"
CLEAN.exclude "vendor/**/*.rbc", "vendor/**/*.o", "vendor/**/*.so", "vendor/**/*.bundle"