You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by jv...@apache.org on 2002/02/24 04:01:40 UTC

cvs commit: jakarta-turbine-maven/src/java/org/apache/maven/jxr CodeTransform.java JXR.java JxrTask.java

jvanzyl     02/02/23 19:01:40

  Modified:    src/java/org/apache/maven/jxr CodeTransform.java JXR.java
                        JxrTask.java
  Log:
  - starting to refactor this beast so i can use the java parser and velocity.
  - fixing the links so that the javadoc link is correct.
  
  Revision  Changes    Path
  1.3       +2 -53     jakarta-turbine-maven/src/java/org/apache/maven/jxr/CodeTransform.java
  
  Index: CodeTransform.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jxr/CodeTransform.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CodeTransform.java	24 Feb 2002 01:32:38 -0000	1.2
  +++ CodeTransform.java	24 Feb 2002 03:01:40 -0000	1.3
  @@ -537,7 +537,6 @@
       public final void transform(String sourcefile,
                                   String destfile,
                                   String revision,
  -                                String sourcedir,
                                   MetaData metadata)
           throws IOException
       {
  @@ -547,7 +546,6 @@
           this.sourcefile = sourcefile;
           this.destfile = destfile;
           this.revision = revision;
  -        this.sourcedir = sourcedir;
           this.metadata = metadata;
   
           //make sure that the parent directories exist...
  @@ -592,10 +590,7 @@
           //get the URI to get Javadoc info.
           StringBuffer javadocURI = new StringBuffer()
               .append(getPackageRoot())
  -            .append("../javadoc/")
  -            .append(this.metadata.getProject().getModule())
  -            .append("/")
  -            .append(this.getRevision());
  +            .append("../apidocs");
   
           try
           {
  @@ -622,54 +617,8 @@
   
           String javadocHREF = "<a href=\"" + javadocURI + "\">View Javadoc</a>";
   
  -        //get the URI to download this file.
  -        /*
  -        StringBuffer sourceURI = new StringBuffer()
  -            .append( this.getPackageRoot() )
  -            .append( "../../cvs/" )
  -            .append( this.metadata.getModule().getCvsModuleName() )
  -            .append( "/" )
  -            .append( this.getRevision() )
  -            .append( "/" )
  -            .append( this.metadata.getModule().getCvsModuleName() )
  -            .append( "/" )
  -            .append( this.getSourceDirectory() )
  -            .append( "/" );
  -        try {
  -            JavaFile jf = FileManager.getInstance().getFile( this.getCurrentFilename() );
  -            javadocURI.append( new StringUtil( jf.getPackageType().getName() ).replace( ".", "/" ).toString() );
  -            javadocURI.append( "/" );
  -            javadocURI.append( jf.getClassType().getName() );
  -            javadocURI.append( ".html" );
  -        } catch ( IOException e ) {
  -            e.printStackTrace();
  -        }
  -        String sourceHREF = "<a href=\"" + sourceURI.toString() + "\">View Source</a>";
  -        */
           //get the generation time...
  -        overview.append(getOverviewEntry("Last generated on: ",
  -            DateFormat.getDateTimeInstance().format(new Date()),
  -            javadocHREF));
  -
  -        String home = "";
  -
  -        if (this.metadata.getProject().getHomePage() != null)
  -        {
  -            home = this.metadata.getProject().getHomePage();
  -        }
  -        else if (this.metadata.getRepository().getHomePage() != null)
  -        {
  -            home = this.metadata.getRepository().getHomePage();
  -        }
  -
  -        home = "<a href=\"" + home + "\">" + home + "</a>";
  -
  -        overview.append(getOverviewEntry("Home: ", home));
  -
  -        overview.append(getOverviewEntry("License: ", this.metadata.getProject().getLicense()));
  -        overview.append(getOverviewEntry("CVSROOT: ", this.metadata.getRepository().getRoot()));
  -        overview.append(getOverviewEntry("Module: ", this.metadata.getProject().getModule()));
  -
  +        overview.append(javadocHREF);
           overview.append("</table>");
           return overview.toString();
       }
  
  
  
  1.4       +7 -18     jakarta-turbine-maven/src/java/org/apache/maven/jxr/JXR.java
  
  Index: JXR.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jxr/JXR.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JXR.java	24 Feb 2002 02:06:24 -0000	1.3
  +++ JXR.java	24 Feb 2002 03:01:40 -0000	1.4
  @@ -1,3 +1,5 @@
  +package org.apache.maven.jxr;
  +
   /*
    *
    * Copyright (c) 1998 The Java Apache Project.  All rights reserved.
  @@ -48,15 +50,11 @@
    * License version 1.0
    *
    */
  -package org.apache.maven.jxr;
   
  -//alexandria stuff
   import org.apache.maven.jxr.util.*;
   
  -//ant stuff
   import org.apache.tools.ant.*;
   
  -//java stuff
   import java.io.*;
   
   /**
  @@ -64,7 +62,7 @@
    * building.
    *
    * @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>
  - * @version $Id: JXR.java,v 1.3 2002/02/24 02:06:24 jvanzyl Exp $
  + * @version $Id: JXR.java,v 1.4 2002/02/24 03:01:40 jvanzyl Exp $
    */
   public class JXR
   {
  @@ -72,9 +70,6 @@
       public final static String NOTICE =
           "This page automatically generated Maven";
   
  -    /** This is a workspace file like workspace.xml  */
  -    private String markup = "";
  -
       /** Path to all source.files  */
       private String source = "";
   
  @@ -92,34 +87,26 @@
       /** The revision of the module currently being processed.  */
       private String revision;
   
  -    /** The source directory for all these files: ./src/java  */
  -    private String sourcedir;
  -
       /**
        * @param revision The CVS revision of this file.
        * @param srcdir The directory that files are being read from (src/java)
        * @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>
  -     * @version $Id: JXR.java,v 1.3 2002/02/24 02:06:24 jvanzyl Exp $
  +     * @version $Id: JXR.java,v 1.4 2002/02/24 03:01:40 jvanzyl Exp $
        * @param source
        * @param dest
        * @param metadata
  -     * @param sourcedir
        */
       public JXR(String source,
                  String dest,
                  MetaData metadata,
  -               String revision,
  -               String sourcedir)
  +               String revision)
       {
  -        this.markup = markup;
           this.source = source;
           this.dest = dest;
           this.metadata = metadata;
           this.revision = revision;
  -        this.sourcedir = sourcedir;
   
           this.process();
  -
       }
   
   
  @@ -127,7 +114,7 @@
        * Now that we have instantiated everythign. Process this JXR task.
        *
        * @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>
  -     * @version $Id: JXR.java,v 1.3 2002/02/24 02:06:24 jvanzyl Exp $
  +     * @version $Id: JXR.java,v 1.4 2002/02/24 03:01:40 jvanzyl Exp $
        */
       private void process()
       {
  @@ -142,7 +129,9 @@
           {
               if (dir.mkdirs() == false)
               {
  -                throw new IllegalStateException("Your source directory does not exist and could not be created:" + this.getSource());
  +                throw new IllegalStateException(
  +                    "Your source directory does not exist and could not be created:" +
  +                        this.getSource());
               }
           }
   
  @@ -183,7 +172,7 @@
   
       /**
        * @author <A HREF="mailto:burton@apache.org">Kevin A. Burton</A>
  -     * @version $Id: JXR.java,v 1.3 2002/02/24 02:06:24 jvanzyl Exp $
  +     * @version $Id: JXR.java,v 1.4 2002/02/24 03:01:40 jvanzyl Exp $
        */
       public static boolean isJavaFile(String filename)
       {
  @@ -192,7 +181,7 @@
   
       /**
        * @author <A HREF="mailto:burton@apache.org">Kevin A. Burton</A>
  -     * @version $Id: JXR.java,v 1.3 2002/02/24 02:06:24 jvanzyl Exp $
  +     * @version $Id: JXR.java,v 1.4 2002/02/24 03:01:40 jvanzyl Exp $
        */
       public static boolean isHtmlFile(String filename)
       {
  @@ -204,7 +193,7 @@
        * the to be generated HTML file. Pay attention to the package name.
        *
        * @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>
  -     * @version $Id: JXR.java,v 1.3 2002/02/24 02:06:24 jvanzyl Exp $
  +     * @version $Id: JXR.java,v 1.4 2002/02/24 03:01:40 jvanzyl Exp $
        */
       private String getDestination(String filename)
       {
  @@ -240,7 +229,7 @@
        *
        * @throws IOException Thrown if the transform can't happen for some reason.
        * @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>
  -     * @version $Id: JXR.java,v 1.3 2002/02/24 02:06:24 jvanzyl Exp $
  +     * @version $Id: JXR.java,v 1.4 2002/02/24 03:01:40 jvanzyl Exp $
        */
       private void transform(String source, String dest)
           throws IOException
  @@ -248,13 +237,13 @@
   
           log(source + " -> " + dest);
   
  -        transformer.transform(source, dest, this.revision, this.sourcedir, this.metadata);
  +        transformer.transform(source, dest, this.revision, this.metadata);
   
       }
   
       /**
        * @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>
  -     * @version $Id: JXR.java,v 1.3 2002/02/24 02:06:24 jvanzyl Exp $
  +     * @version $Id: JXR.java,v 1.4 2002/02/24 03:01:40 jvanzyl Exp $
        */
       private void log(String message)
       {
  @@ -265,7 +254,7 @@
        * Get an array of files that you should act on.
        *
        * @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>
  -     * @version $Id: JXR.java,v 1.3 2002/02/24 02:06:24 jvanzyl Exp $
  +     * @version $Id: JXR.java,v 1.4 2002/02/24 03:01:40 jvanzyl Exp $
        */
       private String[] getFiles()
       {
  @@ -285,7 +274,7 @@
        *
        *
        * @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>
  -     * @version $Id: JXR.java,v 1.3 2002/02/24 02:06:24 jvanzyl Exp $
  +     * @version $Id: JXR.java,v 1.4 2002/02/24 03:01:40 jvanzyl Exp $
        */
       private boolean updated(String file)
       {
  @@ -294,7 +283,7 @@
   
       /**
        * @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>
  -     * @version $Id: JXR.java,v 1.3 2002/02/24 02:06:24 jvanzyl Exp $
  +     * @version $Id: JXR.java,v 1.4 2002/02/24 03:01:40 jvanzyl Exp $
        */
       public String getSource()
       {
  @@ -303,7 +292,7 @@
   
       /**
        * @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>
  -     * @version $Id: JXR.java,v 1.3 2002/02/24 02:06:24 jvanzyl Exp $
  +     * @version $Id: JXR.java,v 1.4 2002/02/24 03:01:40 jvanzyl Exp $
        */
       public String getDest()
       {
  
  
  
  1.3       +5 -6      jakarta-turbine-maven/src/java/org/apache/maven/jxr/JxrTask.java
  
  Index: JxrTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jxr/JxrTask.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JxrTask.java	24 Feb 2002 01:32:38 -0000	1.2
  +++ JxrTask.java	24 Feb 2002 03:01:40 -0000	1.3
  @@ -1,5 +1,4 @@
   package org.apache.maven.jxr;
  -
   /*
    *
    * Copyright (c) 1998 The Java Apache Project.  All rights reserved.
  @@ -87,15 +86,15 @@
               PackageManager pkgmgr = PackageManager.getInstance();
               pkgmgr.setTask(this);
               pkgmgr.process(startDir);
  +            MetaData meta = new MetaData(new Repository(), new Project());
   
  -            // markup -> global.xml
  -            // source
  -            // dest
  +            // source file
  +            // destination directory
               // metadata
               // revision -> cvs tag ???
               // sourcedir -> null ???
  -            MetaData meta = new MetaData(new Repository(), new Project());
  -            new JXR(startDir, destDir, meta, "HEAD", null);
  +
  +            new JXR(startDir, destDir, meta, "HEAD");
               new DirectoryIndexer(destDir, destDir, imageFolder,
                   imageFile, DirectoryIndexer.MODE_JAVA);
           }
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>