Add rake task to generate flog report.

This commit is contained in:
Patrick Mahoney 2012-03-24 13:27:42 -05:00
parent e6ff2ba8d7
commit 0dc83a72aa
2 changed files with 23 additions and 2 deletions

View File

@ -1,10 +1,12 @@
require 'ci/reporter/rake/minitest'
require 'ffi'
require 'fileutils'
require 'flog'
require 'rake/extensiontask'
require 'rake/testtask'
require 'rake/version_task'
require 'rubygems/package_task'
require 'rubygems/gem_runner'
require 'ci/reporter/rake/minitest'
require 'rubygems/package_task'
def gemspec
@gemspec ||= Gem::Specification.load('process_shared.gemspec')
@ -51,3 +53,21 @@ if Version.current.prerelease?
sh %{rake push version:bump:pre}
end
end
desc 'Generate flog reports for all ruby code'
task :flog do
opts = {
:all => true,
:blame => true,
:details => true,
:group => true
}
flog = Flog.new(opts)
flog.flog('lib')
out = 'target/reports/flog.txt'
FileUtils.mkdir_p(File.dirname(out))
File.open('target/reports/flog.txt', 'wb') {|io| flog.report io }
end
desc 'Run test for CI environment with xunit reports and flog'
task :ci_test => ['ci:setup:minitest', :test, :flog]

View File

@ -15,6 +15,7 @@ Gem::Specification.new do |s|
s.add_dependency('ffi', '~> 1.0')
s.add_development_dependency('ci_reporter')
s.add_development_dependency('flog')
s.add_development_dependency('minitest')
s.add_development_dependency('minitest-matchers')
s.add_development_dependency('rake')