Add rake task to generate flog report.
This commit is contained in:
parent
e6ff2ba8d7
commit
0dc83a72aa
24
Rakefile
24
Rakefile
|
@ -1,10 +1,12 @@
|
||||||
|
require 'ci/reporter/rake/minitest'
|
||||||
require 'ffi'
|
require 'ffi'
|
||||||
|
require 'fileutils'
|
||||||
|
require 'flog'
|
||||||
require 'rake/extensiontask'
|
require 'rake/extensiontask'
|
||||||
require 'rake/testtask'
|
require 'rake/testtask'
|
||||||
require 'rake/version_task'
|
require 'rake/version_task'
|
||||||
require 'rubygems/package_task'
|
|
||||||
require 'rubygems/gem_runner'
|
require 'rubygems/gem_runner'
|
||||||
require 'ci/reporter/rake/minitest'
|
require 'rubygems/package_task'
|
||||||
|
|
||||||
def gemspec
|
def gemspec
|
||||||
@gemspec ||= Gem::Specification.load('process_shared.gemspec')
|
@gemspec ||= Gem::Specification.load('process_shared.gemspec')
|
||||||
|
@ -51,3 +53,21 @@ if Version.current.prerelease?
|
||||||
sh %{rake push version:bump:pre}
|
sh %{rake push version:bump:pre}
|
||||||
end
|
end
|
||||||
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]
|
||||||
|
|
|
@ -15,6 +15,7 @@ Gem::Specification.new do |s|
|
||||||
s.add_dependency('ffi', '~> 1.0')
|
s.add_dependency('ffi', '~> 1.0')
|
||||||
|
|
||||||
s.add_development_dependency('ci_reporter')
|
s.add_development_dependency('ci_reporter')
|
||||||
|
s.add_development_dependency('flog')
|
||||||
s.add_development_dependency('minitest')
|
s.add_development_dependency('minitest')
|
||||||
s.add_development_dependency('minitest-matchers')
|
s.add_development_dependency('minitest-matchers')
|
||||||
s.add_development_dependency('rake')
|
s.add_development_dependency('rake')
|
||||||
|
|
Loading…
Reference in New Issue