Modified to use new -shortnames thing
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@2109 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -17,30 +17,26 @@ class MyThread < Thread
|
||||
end
|
||||
|
||||
class Job
|
||||
attr_reader :unixName
|
||||
def initialize(location, title, unixName, moduleDirectory, sourceDirectory )
|
||||
@location = location
|
||||
@title = title
|
||||
@unixName = unixName
|
||||
if (@location == "Sourceforge")
|
||||
@cvsroot = ':pserver:anonymous@cvs1:/cvsroot/' + unixName
|
||||
else
|
||||
@cvsroot = ':pserver:anoncvs@cvs.apache.org:/home/cvspublic'
|
||||
end
|
||||
@moduleDirectory = moduleDirectory
|
||||
@sourceDirectory = sourceDirectory.strip
|
||||
end
|
||||
def checkout_code
|
||||
# note that we just export the source directory - we don't need all the other stuff
|
||||
# this saves time/bandwidth/processing load. All good.
|
||||
#
|
||||
# use the Thread.ttl gizmo to end it after 2 minutes
|
||||
t = MyThread.new {
|
||||
MyThread.ttl = 120
|
||||
`cvs -Q -d#{@cvsroot} export -D tomorrow "#{@sourceDirectory}"`
|
||||
}
|
||||
t.join
|
||||
end
|
||||
attr_reader :unixName
|
||||
def initialize(location, title, unixName, moduleDirectory, sourceDirectory )
|
||||
@location = location
|
||||
@title = title
|
||||
@unixName = unixName
|
||||
@cvsroot = ':pserver:anonymous@cvs1:/cvsroot/' + unixName
|
||||
@moduleDirectory = moduleDirectory
|
||||
@sourceDirectory = sourceDirectory.strip
|
||||
end
|
||||
def checkout_code
|
||||
# note that we just export the source directory - we don't need all the other stuff
|
||||
# this saves time/bandwidth/processing load. All good.
|
||||
#
|
||||
# use the Thread.ttl gizmo to end it after 2 minutes
|
||||
t = MyThread.new {
|
||||
MyThread.ttl = 120
|
||||
`cvs -Q -d#{@cvsroot} export -D tomorrow "#{@sourceDirectory}"`
|
||||
}
|
||||
t.join
|
||||
end
|
||||
def checkOutOK
|
||||
return File.exists?(@sourceDirectory)
|
||||
end
|
||||
@ -49,7 +45,7 @@ class Job
|
||||
`#{cmd}`
|
||||
end
|
||||
def run_pmd
|
||||
cmd="java -jar pmd-1.1.jar \"#{@sourceDirectory}\" html rulesets/unusedcode.xml > \"#{reportFile}\""
|
||||
cmd="java -jar pmd-1.1.jar \"/home/users/t/to/tomcopeland/pmdweb/#{@sourceDirectory}\" html rulesets/unusedcode.xml -shortnames > \"#{reportFile}\""
|
||||
`#{cmd}`
|
||||
arr = IO.readlines(reportFile())
|
||||
newFile=File.open(reportFile(), "w")
|
||||
@ -64,21 +60,21 @@ class Job
|
||||
cmd="java -cp pmd-1.1.jar net.sourceforge.pmd.cpd.CPD 100 \"#{@sourceDirectory}\" > \"#{cpdReportFile}\""
|
||||
`#{cmd}`
|
||||
end
|
||||
def reportFile
|
||||
return "/home/groups/p/pm/pmd/htdocs/reports/#{@unixName}_#{@moduleDirectory.sub(" ", "")}.html"
|
||||
end
|
||||
def cpdReportFile
|
||||
return "/home/groups/p/pm/pmd/htdocs/reports/cpd_#{@unixName}_#{@moduleDirectory.sub(" ", "")}.txt"
|
||||
end
|
||||
def ncssReportFile
|
||||
return "/home/groups/p/pm/pmd/htdocs/reports/#{@unixName}_#{@moduleDirectory.sub(" ", "")}_ncss.txt"
|
||||
end
|
||||
def clear
|
||||
`rm -rf "#{@moduleDirectory}"`
|
||||
end
|
||||
def to_s
|
||||
return @location + ":" + @title + ":" + @unixName +":"+@moduleDirectory+":"+@sourceDirectory
|
||||
end
|
||||
def reportFile
|
||||
return "/home/groups/p/pm/pmd/htdocs/reports/#{@unixName}_#{@moduleDirectory.sub(" ", "")}.html"
|
||||
end
|
||||
def cpdReportFile
|
||||
return "/home/groups/p/pm/pmd/htdocs/reports/cpd_#{@unixName}_#{@moduleDirectory.sub(" ", "")}.txt"
|
||||
end
|
||||
def ncssReportFile
|
||||
return "/home/groups/p/pm/pmd/htdocs/reports/#{@unixName}_#{@moduleDirectory.sub(" ", "")}_ncss.txt"
|
||||
end
|
||||
def clear
|
||||
`rm -rf "#{@moduleDirectory}"`
|
||||
end
|
||||
def to_s
|
||||
return @location + ":" + @title + ":" + @unixName +":"+@moduleDirectory+":"+@sourceDirectory
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user