added cvs checkout and pmd run
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@983 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -52,6 +52,14 @@ class Job
|
||||
@sourceDirectory = moduleDirectory + '/' + sourceDirectory
|
||||
end
|
||||
|
||||
def checkout_code
|
||||
`cvs -d:#{cvsroot} co #{moduleDirectory}`
|
||||
end
|
||||
|
||||
def run_pmd
|
||||
`java -jar pmd-1.0rc2.jar #{sourceDirectory} html rulesets/unusedcode.xml > reports/#{projectName}.html`
|
||||
end
|
||||
|
||||
def to_s
|
||||
return @projectName +":"+@moduleDirectory+":"+@sourceDirectory
|
||||
end
|
||||
|
@ -3,13 +3,15 @@ require 'c:\data\pmd\pmd-web\src\pmd.rb'
|
||||
|
||||
jobsDir = Dir.new("jobs")
|
||||
jobsDir.each { |candidate|
|
||||
if candidate[".txt"]
|
||||
jobFile=File.new("jobs/#{candidate}")
|
||||
jobData = jobFile.read
|
||||
jobFile.close
|
||||
name,moduleDir,srcDir=jobData.split(":")
|
||||
job = PMD::Job.new(name, moduleDir, srcDir)
|
||||
puts job
|
||||
begin
|
||||
if candidate[".txt"]
|
||||
name,moduleDir,srcDir = File.new("jobs/#{candidate}").read.split(":")
|
||||
job = PMD::Job.new(name,moduleDir,srcDir)
|
||||
job.checkout_code
|
||||
job.run_pmd
|
||||
end
|
||||
rescue
|
||||
puts "Exiting with error: #{$!}"
|
||||
end
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user