Class JDependTask
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.optional.jdepend.JDependTask
- All Implemented Interfaces:
- Cloneable
Runs JDepend tests.
 
JDepend is a tool to generate design quality metrics for each Java package. It has been initially created by Mike Clark. JDepend can be found at https://github.com/clarkware/jdepend. The current implementation spawn a new Java VM.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classA class for the enumerated attribute format, values are xml and text.
- 
Field SummaryFields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionAdds a path to class code to analyze.Adds a path to the classpath.add a name entry on the exclude listcreateJvmarg(CommandlineJava commandline) Create a new JVM argument.Deprecated.since 1.6.x.protected ExecuteWatchdogvoidexecute()execute the taskintexecuteAsForked(CommandlineJava commandline, ExecuteWatchdog watchdog) Execute the task by forking a new JVM.intexecuteInVM(CommandlineJava commandline) Execute inside VM.Gets the classespath.Gets the classpath to be used for this compilation.getDir()booleangetFork()booleanDeprecated.since 1.6.x.voidsetClasspath(Path classpath) Set the classpath to be used for this compilation.voidAdds a reference to a classpath defined elsewhere.voidThe directory to invoke the VM in.voidsetFork(boolean value) If true, forks into a new JVM.voidThe format to write the output in, "xml" or "text".voidsetHaltonerror(boolean haltonerror) Whether or not to halt on failure.voidsetIncluderuntime(boolean b) If true, include jdepend.jar in the forked VM.voidThe command used to invoke a forked Java Virtual Machine.voidsetOutputFile(File outputFile) The output file name.voidsetTimeout(Long value) Set the timeout value (in milliseconds).Methods inherited from class org.apache.tools.ant.TaskbindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponentclone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
- 
Constructor Details- 
JDependTaskpublic JDependTask()
 
- 
- 
Method Details- 
setIncluderuntimepublic void setIncluderuntime(boolean b) If true, include jdepend.jar in the forked VM.- Parameters:
- b- include ant run time yes or no
- Since:
- Ant 1.6
 
- 
setTimeoutSet the timeout value (in milliseconds).If the operation is running for more than this value, the jdepend will be canceled. (works only when in 'fork' mode). - Parameters:
- value- the maximum time (in milliseconds) allowed before declaring the test as 'timed-out'
- See Also:
 
- 
getTimeout- Returns:
- the timeout value
 
- 
setOutputFileThe output file name.- Parameters:
- outputFile- the output file name
 
- 
getOutputFile- Returns:
- the output file name
 
- 
setHaltonerrorpublic void setHaltonerror(boolean haltonerror) Whether or not to halt on failure. Default: false.- Parameters:
- haltonerror- the value to set
 
- 
getHaltonerrorpublic boolean getHaltonerror()- Returns:
- the value of the haltonerror attribute
 
- 
setForkpublic void setFork(boolean value) If true, forks into a new JVM. Default: false.- Parameters:
- value-- trueif a JVM should be forked, otherwise- false
 
- 
getForkpublic boolean getFork()- Returns:
- the value of the fork attribute
 
- 
setJvmThe command used to invoke a forked Java Virtual Machine. Default isjava. Ignored if no JVM is forked.- Parameters:
- value- the new VM to use instead of- java
- See Also:
 
- 
createSourcespathDeprecated.since 1.6.x.Adds a path to source code to analyze.- Returns:
- a source path
 
- 
getSourcespathDeprecated.since 1.6.x.Gets the sourcepath.- Returns:
- the sources path
 
- 
createClassespathAdds a path to class code to analyze.- Returns:
- a classes path
 
- 
getClassespathGets the classespath.- Returns:
- the classes path
 
- 
setDirThe directory to invoke the VM in. Ignored if no JVM is forked.- Parameters:
- dir- the directory to invoke the JVM from.
- See Also:
 
- 
getDir- Returns:
- the dir attribute
 
- 
setClasspathSet the classpath to be used for this compilation.- Parameters:
- classpath- a class path to be used
 
- 
getClasspathGets the classpath to be used for this compilation.- Returns:
- the class path used for compilation
 
- 
createClasspathAdds a path to the classpath.- Returns:
- a classpath
 
- 
createJvmargCreate a new JVM argument. Ignored if no JVM is forked.- Parameters:
- commandline- the commandline to create the argument on
- Returns:
- create a new JVM argument so that any argument can be passed to the JVM.
- See Also:
 
- 
setClasspathRefAdds a reference to a classpath defined elsewhere.- Parameters:
- r- a classpath reference
 
- 
createExcludeadd a name entry on the exclude list- Returns:
- a pattern for the excludes
 
- 
getExcludes- Returns:
- the excludes patterns
 
- 
setFormatThe format to write the output in, "xml" or "text".- Parameters:
- ea- xml or text
 
- 
executeexecute the task- Overrides:
- executein class- Task
- Throws:
- BuildException- if an error occurs
 
- 
executeInVMExecute inside VM.- Parameters:
- commandline- the command line
- Returns:
- the return value of the mvm
- Throws:
- BuildException- if an error occurs
 
- 
executeAsForkedpublic int executeAsForked(CommandlineJava commandline, ExecuteWatchdog watchdog) throws BuildException Execute the task by forking a new JVM. The command will block until it finishes. To know if the process was destroyed or not, use thekilledProcess()method of the watchdog class.- Parameters:
- commandline- the commandline for forked jvm
- watchdog- the watchdog in charge of cancelling the test if it exceeds a certain amount of time. Can be- null.
- Returns:
- the result of running the jdepend
- Throws:
- BuildException- in case of error
 
- 
createWatchdog- Returns:
- nullif there is a timeout value, otherwise the watchdog instance.
- Throws:
- BuildException- in case of error
 
 
-