-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Rakefile
69 lines (51 loc) · 1.54 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
# frozen_string_literal: true
require 'rake/clean'
require 'rake/extensiontask'
Rake::ExtensionTask.new('extralite_ext') do |ext|
ext.ext_dir = 'ext/extralite'
end
task :recompile => [:clean, :compile]
task :default => [:compile, :doc, :test]
task :doc => :yard
task :test do
exec 'ruby test/run.rb'
end
CLEAN.include 'lib/*.o', 'lib/*.so', 'lib/*.so.*', 'lib/*.a', 'lib/*.bundle', 'lib/*.jar', 'pkg', 'tmp'
require 'yard'
YARD_FILES = FileList['ext/extralite/extralite.c', 'lib/extralite.rb', 'lib/sequel/adapters/extralite.rb']
YARD::Rake::YardocTask.new do |t|
t.files = YARD_FILES
t.options = %w(-o doc --readme README.md)
end
task :release do
require_relative './lib/extralite/version'
version = Extralite::VERSION
puts 'Building extralite...'
`gem build extralite.gemspec`
puts 'Building extralite-bundle...'
`gem build extralite-bundle.gemspec`
puts "Pushing extralite #{version}..."
`gem push extralite-#{version}.gem`
puts "Pushing extralite-bundle #{version}..."
`gem push extralite-bundle-#{version}.gem`
puts "Cleaning up..."
`rm *.gem`
end
task :build_bundled do
puts 'Building extralite-bundle...'
`gem build extralite-bundle.gemspec`
end
test_config = lambda do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList["test/**/test_*.rb"]
end
# Rake::TestTask.new(:test, &test_config)
begin
require "ruby_memcheck"
namespace :test do
RubyMemcheck::TestTask.new(:valgrind, &test_config)
end
rescue LoadError => e
warn("NOTE: ruby_memcheck is not available in this environment: #{e}")
end