-
Notifications
You must be signed in to change notification settings - Fork 3
/
Rakefile
37 lines (29 loc) · 1.07 KB
/
Rakefile
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
require 'bundler'
Bundler::GemHelper.install_tasks
require "rake/testtask"
require 'rake_compiler_dock'
require 'rake/clean'
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList["test/**/test_*.rb"]
end
require "rake/extensiontask"
spec = eval File.read("winevt_c.gemspec")
Rake::ExtensionTask.new("winevt", spec) do |ext|
ext.ext_dir = 'ext/winevt'
ext.cross_compile = true
ext.lib_dir = File.join(*['lib', 'winevt', ENV['FAT_DIR']].compact)
# cross_platform names are of MRI's platform name
ext.cross_platform = ['x86-mingw32', 'x64-mingw32']
end
desc 'Build gems for Windows per rake-compiler-dock'
task 'gem:native' do
sh "bundle package"
# See RUBY_CC_VERSION in https://github.com/rake-compiler/rake-compiler-dock/blob/master/Dockerfile.mri
%w[ x86-mingw32 x64-mingw32 ].each do |plat|
RakeCompilerDock.sh "bundle --local && bundle exec rake native:#{plat} gem RUBY_CC_VERSION=2.4.0:2.5.0:2.6.0:2.7.0:3.0.0", platform: plat
end
end
CLEAN.include('lib/winevt/winevt.*')
task :default => [:clobber, :compile, :test]