Package jdiff

Class JDiffAntTask


  • public class JDiffAntTask
    extends java.lang.Object
    An Ant task to produce a simple JDiff report. More complex reports still need parameters that are controlled by the Ant Javadoc task.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  JDiffAntTask.ProjectInfo
      This class handles the information about a project, whether it is the older or newer version.
    • Constructor Summary

      Constructors 
      Constructor Description
      JDiffAntTask()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addConfiguredNew​(JDiffAntTask.ProjectInfo projInfo)
      Used to store the child element named "new", which is under the JDiff task XML element.
      void addConfiguredOld​(JDiffAntTask.ProjectInfo projInfo)
      Used to store the child element named "old", which is under the JDiff task XML element.
      protected void addSourcePaths​(org.apache.tools.ant.taskdefs.Javadoc jd, JDiffAntTask.ProjectInfo proj)
      Add the root directories for the given project to the Javadoc sourcepath.
      protected void compareXML​(java.lang.String oldapiname, java.lang.String newapiname)
      Convenient method to create a Javadoc task, configure it and run it to compare the XML representations of two instances of a project's source files, and generate an HTML report summarizing the differences.
      protected void copyFile​(java.lang.String src, java.lang.String dst)
      Copy a file from src to dst.
      void execute()  
      protected void generateJavadoc​(JDiffAntTask.ProjectInfo proj)
      Generate the Javadoc for the project.
      protected void generateXML​(JDiffAntTask.ProjectInfo proj)
      Convenient method to create a Javadoc task, configure it and run it to generate the XML representation of a project's source files.
      java.io.File getDestdir()  
      boolean getDocchanges()  
      protected java.lang.String getPackageList​(JDiffAntTask.ProjectInfo proj)
      Return the comma-separated list of packages.
      java.lang.String getSource()  
      boolean getStats()  
      boolean getVerbose()  
      protected org.apache.tools.ant.taskdefs.Javadoc initJavadoc​(java.lang.String logMsg)
      Create a fresh new Javadoc task object and initialize it.
      void setDestdir​(java.io.File value)
      Used to store the destdir attribute of the JDiff task XML element.
      void setDocchanges​(boolean value)  
      void setProject​(org.apache.tools.ant.Project proj)
      Used as part of Ant's startup.
      void setSource​(java.lang.String source)  
      void setStats​(boolean value)  
      void setVerbose​(boolean value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JDiffAntTask

        public JDiffAntTask()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.tools.ant.BuildException
        Throws:
        org.apache.tools.ant.BuildException
      • generateXML

        protected void generateXML​(JDiffAntTask.ProjectInfo proj)
        Convenient method to create a Javadoc task, configure it and run it to generate the XML representation of a project's source files.
        Parameters:
        proj - The current Project
      • compareXML

        protected void compareXML​(java.lang.String oldapiname,
                                  java.lang.String newapiname)
        Convenient method to create a Javadoc task, configure it and run it to compare the XML representations of two instances of a project's source files, and generate an HTML report summarizing the differences.
        Parameters:
        oldapiname - The name of the older version of the project
        newapiname - The name of the newer version of the project
      • generateJavadoc

        protected void generateJavadoc​(JDiffAntTask.ProjectInfo proj)
        Generate the Javadoc for the project. If you want to generate the Javadoc report for the project with different parameters from the simple ones used here, then use the Javadoc Ant task directly, and set the javadoc attribute to the "old" or "new" element.
        Parameters:
        proj - The current Project
      • initJavadoc

        protected org.apache.tools.ant.taskdefs.Javadoc initJavadoc​(java.lang.String logMsg)
        Create a fresh new Javadoc task object and initialize it.
        Parameters:
        logMsg - String which appears as a prefix in the Ant log
        Returns:
        The new task.Javadoc object
      • addSourcePaths

        protected void addSourcePaths​(org.apache.tools.ant.taskdefs.Javadoc jd,
                                      JDiffAntTask.ProjectInfo proj)
        Add the root directories for the given project to the Javadoc sourcepath.
      • getPackageList

        protected java.lang.String getPackageList​(JDiffAntTask.ProjectInfo proj)
                                           throws org.apache.tools.ant.BuildException
        Return the comma-separated list of packages. The list is generated from Ant DirSet tasks, and includes all directories in a hierarchy, e.g. com, com/acme. com/acme/foo. Duplicates are ignored.
        Throws:
        org.apache.tools.ant.BuildException
      • copyFile

        protected void copyFile​(java.lang.String src,
                                java.lang.String dst)
        Copy a file from src to dst. Also checks that "destdir/changes" exists
      • setProject

        public void setProject​(org.apache.tools.ant.Project proj)
        Used as part of Ant's startup.
      • setDestdir

        public void setDestdir​(java.io.File value)
        Used to store the destdir attribute of the JDiff task XML element.
      • getDestdir

        public java.io.File getDestdir()
      • setVerbose

        public void setVerbose​(boolean value)
      • getVerbose

        public boolean getVerbose()
      • setDocchanges

        public void setDocchanges​(boolean value)
      • getDocchanges

        public boolean getDocchanges()
      • setStats

        public void setStats​(boolean value)
      • getStats

        public boolean getStats()
      • setSource

        public void setSource​(java.lang.String source)
      • getSource

        public java.lang.String getSource()
      • addConfiguredOld

        public void addConfiguredOld​(JDiffAntTask.ProjectInfo projInfo)
        Used to store the child element named "old", which is under the JDiff task XML element.
      • addConfiguredNew

        public void addConfiguredNew​(JDiffAntTask.ProjectInfo projInfo)
        Used to store the child element named "new", which is under the JDiff task XML element.