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:
Tom Copeland
2002-09-24 20:16:11 +00:00
parent 502ac929ed
commit 0291d6c0f1
2 changed files with 17 additions and 7 deletions

View File

@ -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

View File

@ -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
}