This repository has been archived by the owner on Nov 29, 2023. It is now read-only.
forked from net-ssh/bcrypt_pbkdf-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
70 lines (60 loc) · 1.6 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
require 'rake/testtask'
require 'rubygems/package_task'
require 'bundler/gem_tasks'
require 'rake/extensiontask'
require 'rake/clean'
require 'rdoc/task'
require 'benchmark'
CLEAN.include(
"tmp",
"lib/2.0",
"lib/2.1",
"lib/2.2",
"lib/2.3",
"lib/2.4",
"lib/2.5",
"lib/2.6",
"lib/2.7",
"lib/bcrypt_pbkdf_ext.so"
)
CLOBBER.include(
"doc",
"pkg"
)
task 'gem:windows' do
require 'rake_compiler_dock'
sh "bundle package" # Avoid repeated downloads of gems by using gem files from the host.
RakeCompilerDock.sh "bundle && rake cross native gem RUBY_CC_VERSION=2.7.0:2.6.0:2.5.0:2.4.0:2.3.0:2.2.2:2.1.6:2.0.0"
end
task 'gem:windows:release' do
version = Gem::Specification::load("bcrypt_pbkdf.gemspec").version
sh "gem push pkg/bcrypt_pbkdf-#{version}-x86-mingw32.gem"
sh "gem push pkg/bcrypt_pbkdf-#{version}-x64-mingw32.gem"
end
GEMSPEC = Gem::Specification.load("bcrypt_pbkdf.gemspec")
task :default => [:compile, :spec]
desc "Run all tests"
Rake::TestTask.new do |t|
#t.pattern =
t.test_files = FileList['test/**/*_test.rb']
t.ruby_opts = ['-w']
t.libs << "test"
t.verbose = true
end
task :spec => :test
desc 'Generate RDoc'
RDoc::Task.new do |rdoc|
rdoc.rdoc_dir = 'doc/rdoc'
rdoc.options += GEMSPEC.rdoc_options
rdoc.template = ENV['TEMPLATE'] if ENV['TEMPLATE']
rdoc.rdoc_files.include(*GEMSPEC.extra_rdoc_files)
end
Gem::PackageTask.new(GEMSPEC) do |pkg|
pkg.need_zip = true
pkg.need_tar = true
end
Rake::ExtensionTask.new("bcrypt_pbkdf_ext", GEMSPEC) do |ext|
ext.ext_dir = 'ext/mri'
ext.cross_compile = true
ext.cross_platform = ['x86-mingw32', 'x64-mingw32']
end