2015-03-21 19:24:07 +00:00
|
|
|
require 'bundler'
|
2014-02-26 18:50:16 +00:00
|
|
|
require 'bundler/gem_tasks'
|
|
|
|
require 'digest/sha2'
|
|
|
|
require 'rake/clean'
|
|
|
|
|
2015-03-22 14:26:59 +00:00
|
|
|
if Gem.win_platform?
|
|
|
|
task :devkit do
|
|
|
|
begin
|
|
|
|
require 'devkit'
|
|
|
|
rescue LoadError
|
|
|
|
warn 'Failed to load devkit, installation might fail'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
task :compile => [:devkit]
|
|
|
|
end
|
|
|
|
|
2014-02-26 18:50:16 +00:00
|
|
|
GEMSPEC = Gem::Specification.load('oga.gemspec')
|
|
|
|
|
2014-05-05 22:23:07 +00:00
|
|
|
if RUBY_PLATFORM == 'java'
|
|
|
|
require 'rake/javaextensiontask'
|
|
|
|
|
2014-05-06 22:29:10 +00:00
|
|
|
Rake::JavaExtensionTask.new('liboga', GEMSPEC) do |task|
|
|
|
|
task.ext_dir = 'ext/java'
|
|
|
|
end
|
2014-05-05 22:23:07 +00:00
|
|
|
else
|
|
|
|
require 'rake/extensiontask'
|
|
|
|
|
2014-05-06 22:29:10 +00:00
|
|
|
Rake::ExtensionTask.new('liboga', GEMSPEC) do |task|
|
|
|
|
task.ext_dir = 'ext/c'
|
|
|
|
end
|
2014-05-05 22:23:07 +00:00
|
|
|
end
|
|
|
|
|
2014-04-29 18:39:20 +00:00
|
|
|
CLEAN.include(
|
2014-04-17 18:06:24 +00:00
|
|
|
'coverage',
|
|
|
|
'yardoc',
|
2014-06-01 21:02:28 +00:00
|
|
|
'lib/oga/xml/parser.rb',
|
2014-05-14 06:48:49 +00:00
|
|
|
'lib/oga/xpath/lexer.rb',
|
2014-06-01 21:02:28 +00:00
|
|
|
'lib/oga/xpath/parser.rb',
|
2014-10-21 21:21:23 +00:00
|
|
|
'lib/oga/css/lexer.rb',
|
|
|
|
'lib/oga/css/parser.rb',
|
2014-05-01 18:57:17 +00:00
|
|
|
'benchmark/fixtures/big.xml',
|
2014-05-04 22:25:34 +00:00
|
|
|
'profile/samples/**/*.txt',
|
|
|
|
'lib/liboga.*',
|
|
|
|
'tmp',
|
2014-05-06 22:29:10 +00:00
|
|
|
'ext/c/lexer.c',
|
|
|
|
'ext/java/org/liboga/xml/Lexer.java'
|
2014-04-29 18:39:20 +00:00
|
|
|
)
|
2014-02-26 18:50:16 +00:00
|
|
|
|
|
|
|
Dir['./task/*.rake'].each do |task|
|
|
|
|
import(task)
|
|
|
|
end
|
|
|
|
|
|
|
|
task :default => :test
|