-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
38 lines (30 loc) · 886 Bytes
/
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
# frozen_string_literal: true
require "rake/testtask"
require "rake/extensiontask"
require "bundler/gem_tasks"
gemspec = eval(File.read(Dir.glob("*.gemspec").first))
release_gemspec = eval(File.read(Dir.glob("*.gemspec").first))
release_gemspec.version = gemspec.version.to_s.sub(/\.nonrelease$/, "")
# Build tasks
if RUBY_DESCRIPTION.match(/^jruby/)
task :compile
else
Rake::ExtensionTask.new "geos_c_impl" do |ext|
ext.lib_dir = "lib/rgeo/geos"
end
end
task :clean do
clean_files = %w[pkg tmp] +
Dir.glob("ext/**/Makefile*") +
Dir.glob("ext/**/*.{o,class,log,dSYM}") +
Dir.glob("**/*.{bundle,so,dll,rbc,jar}") +
Dir.glob("**/.rbx")
clean_files.each { |path| rm_rf path }
end
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList["test/**/*_test.rb"]
end
task test: :compile
task default: [:clean, :test]