Skip to content
Newer
Older
100644 67 lines (50 sloc) 1.48 KB
e7f98b6 @tenderlove initial checkin
tenderlove authored
1 # -*- ruby -*-
2
3 require 'rubygems'
4 require 'hoe'
5
9246422 @tenderlove adding tokenizer and parser
tenderlove authored
6 kind = Config::CONFIG['DLEXT']
7
08450f3 @tenderlove auto generating the IDL interface
tenderlove authored
8 LIB_DIR = File.expand_path(File.join(File.dirname(__FILE__), 'lib'))
9 $LOAD_PATH << LIB_DIR
10
9246422 @tenderlove adding tokenizer and parser
tenderlove authored
11 GENERATED_PARSER = "lib/nokogiri/css/generated_parser.rb"
12 GENERATED_TOKENIZER = "lib/nokogiri/css/generated_tokenizer.rb"
e7f98b6 @tenderlove initial checkin
tenderlove authored
13
9246422 @tenderlove adding tokenizer and parser
tenderlove authored
14 EXT = "ext/nokogiri/native.#{kind}"
15
16 require 'nokogiri/version'
85b1f6d @tenderlove starting the move to C
tenderlove authored
17
c40736a @tenderlove bumping version and adding a gem spec task
tenderlove authored
18 HOE = Hoe.new('nokogiri', Nokogiri::VERSION) do |p|
e7f98b6 @tenderlove initial checkin
tenderlove authored
19 p.developer('Aaron Patterson', 'aaronp@rubyforge.org')
43686d6 @tenderlove updating rakefile to build before testing
tenderlove authored
20 p.clean_globs = [
21 'ext/nokogiri/Makefile',
22 'ext/nokogiri/*.{o,so,bundle,a,log}',
9246422 @tenderlove adding tokenizer and parser
tenderlove authored
23 GENERATED_PARSER,
43686d6 @tenderlove updating rakefile to build before testing
tenderlove authored
24 ]
08450f3 @tenderlove auto generating the IDL interface
tenderlove authored
25 end
26
c40736a @tenderlove bumping version and adding a gem spec task
tenderlove authored
27 namespace :gem do
28 task :spec do
29 File.open("#{HOE.name}.gemspec", 'w') do |f|
30 HOE.spec.version = "#{HOE.version}.#{Time.now.strftime("%Y%m%d%H%M%S")}"
31 f.write(HOE.spec.to_ruby)
32 end
33 end
34 end
08450f3 @tenderlove auto generating the IDL interface
tenderlove authored
35
0799dd7 @flavorjones added rcov task
flavorjones authored
36 desc "Run code-coverage analysis"
37 task :coverage do
38 rm_rf "coverage"
39 sh "rcov -x Library -I lib:test #{Dir[*HOE.test_globs].join(' ')}"
40 end
85b1f6d @tenderlove starting the move to C
tenderlove authored
41
9246422 @tenderlove adding tokenizer and parser
tenderlove authored
42 file GENERATED_PARSER => "lib/nokogiri/css/parser.y" do |t|
43 sh "racc -o #{t.name} #{t.prerequisites.first}"
44 end
45
46 file GENERATED_TOKENIZER => "lib/nokogiri/css/tokenizer.rex" do |t|
47 sh "frex --independent -o #{t.name} #{t.prerequisites.first}"
48 end
85b1f6d @tenderlove starting the move to C
tenderlove authored
49
50 task 'ext/nokogiri/Makefile' do
51 Dir.chdir('ext/nokogiri') do
52 ruby 'extconf.rb'
53 end
54 end
55
56 task EXT => 'ext/nokogiri/Makefile' do
57 Dir.chdir('ext/nokogiri') do
58 sh 'make'
59 end
60 end
61
9246422 @tenderlove adding tokenizer and parser
tenderlove authored
62 task :build => [EXT, GENERATED_PARSER, GENERATED_TOKENIZER]
85b1f6d @tenderlove starting the move to C
tenderlove authored
63
43686d6 @tenderlove updating rakefile to build before testing
tenderlove authored
64 Rake::Task[:test].prerequisites << :build
65
e7f98b6 @tenderlove initial checkin
tenderlove authored
66 # vim: syntax=Ruby
Something went wrong with that request. Please try again.