~matteo-collina/+junk/ruby2jar

« back to all changes in this revision

Viewing changes to Rakefile

  • Committer: Matteo Collina
  • Date: 2008-09-10 10:22:41 UTC
  • Revision ID: matteo.collina@gmail.com-20080910102241-wrnri5uduxxf3rgh
 * Project created.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- ruby -*-
 
2
 
 
3
require 'rubygems'
 
4
require 'hoe'
 
5
require 'spec/rake/spectask'
 
6
require 'spec/rake/verify_rcov'
 
7
require './lib/ruby2jar.rb'
 
8
 
 
9
Hoe.new('ruby2jar', Ruby2jar::VERSION) do |p|
 
10
  # p.rubyforge_name = 'ruby2jarx' # if different than lowercase project name
 
11
  p.developer('Matteo Collina', 'matteo.collina@gmail.com')
 
12
  p.extra_deps = ["rspec",">= 1.0.0"]
 
13
end
 
14
 
 
15
Rake.application["default"].prerequisites.shift
 
16
 
 
17
task :default => [:spec]
 
18
 
 
19
desc "Run all the specifications"
 
20
Spec::Rake::SpecTask.new('spec') do |t|
 
21
  t.spec_files = FileList['spec/**/*_spec.rb'] - ["specs/spec_helper.rb"]
 
22
  t.spec_opts = ["--diff c"]
 
23
end
 
24
 
 
25
desc "Run all the specifications and generate the output in html"
 
26
Spec::Rake::SpecTask.new('spec:html') do |t|
 
27
  t.spec_files = FileList['spec/**/*.rb'] - ["specs/spec_helper.rb"]
 
28
  t.spec_opts = ["-f html","--diff c","-o","specs.html"]
 
29
end
 
30
 
 
31
desc "Run all the specification with RCov support"
 
32
Spec::Rake::SpecTask.new('rcov') do |t|
 
33
  t.spec_files = FileList['spec/**/*.rb'] - ["specs/spec_helper.rb"]
 
34
  t.spec_opts = ["-c"]
 
35
  t.rcov = true
 
36
  t.rcov_opts = ['--exclude', "rcov,spec,gem"] 
 
37
end
 
38
 
 
39
desc "Run all the specification and checks if the coverage is at the threshold"
 
40
RCov::VerifyTask.new(:verify_rcov => :rcov) do |t|
 
41
  t.threshold = 100.0
 
42
end
 
43
 
 
44
desc "Creates the Manifest" 
 
45
task :create_manifest do
 
46
  files = FileList["{examples,lib,spec,bin}/**/*"] + ["README.txt","Manifest.txt","History.txt","MIT-LICENSE","Rakefile"]
 
47
  files.sort!
 
48
  File.open("Manifest.txt", "w") do |io|
 
49
    io.write(files.join("\n"))
 
50
        io.write("\n")
 
51
  end
 
52
end
 
53
 
 
54
 
 
55
# vim: syntax=Ruby