You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by st...@apache.org on 2002/08/10 09:04:28 UTC

cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp JspC.java

stevel      2002/08/10 00:04:28

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/jsp
                        JspC.java
  Log:
  this patch does not fix the failing of jspc test, it fixes two other bugs in bugzilla -NPE on inclusion of non jsp file, and webapp attr broken.
  
  Revision  Changes    Path
  1.25      +34 -19    jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java
  
  Index: JspC.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- JspC.java	25 Jul 2002 15:21:16 -0000	1.24
  +++ JspC.java	10 Aug 2002 07:04:28 -0000	1.25
  @@ -228,7 +228,12 @@
       public void setIeplugin(String iepluginid_) {
           iepluginid = iepluginid_;
       }
  -    /* ------------------------------------------------------------ */
  +
  +    /**
  +     * If true, generate separate write() calls for each HTML line
  +     * in the JSP.
  +     * @return mapping status
  +     */
       public boolean isMapped() {
           return mapped;
       }
  @@ -270,7 +275,6 @@
       }
   
   
  -    /* ------------------------------------------------------------ */
       /**
        * Set the classpath to be used for this compilation.
        */
  @@ -302,7 +306,6 @@
           return classpath;
       }
   
  -    /* ------------------------------------------------------------ */
       /**
        * Set the classpath to be used to find this compiler adapter
        */
  @@ -340,6 +343,10 @@
           this.webxml = webxml;
       }
   
  +    /**
  +     * Filename for web.xml.
  +     * @return
  +     */
       public File getWebxml() {
           return this.webxml;
       }
  @@ -396,17 +403,6 @@
        */
       public void execute()
           throws BuildException {
  -        // first off, make sure that we've got a srcdir
  -        if (src == null) {
  -            throw new BuildException("srcdir attribute must be set!",
  -                                     getLocation());
  -        }
  -        String [] list = src.list();
  -        if (list.length == 0) {
  -            throw new BuildException("srcdir attribute must be set!",
  -                                     getLocation());
  -        }
  -
           if (destDir != null && !destDir.isDirectory()) {
               throw new
                   BuildException("destination directory \"" + destDir +
  @@ -421,6 +417,24 @@
               JspCompilerAdapterFactory.getCompiler(compilerName, this,
                  new AntClassLoader(getProject(), compilerClasspath));
   
  +        //if we are a webapp, hand off to the compiler, which had better handle it
  +        if(webApp!=null) {
  +            doCompilation(compiler);
  +            return;
  +        }
  +            
  +        // make sure that we've got a srcdir 
  +        if (src == null) {
  +            throw new BuildException("srcdir attribute must be set!",
  +                                     location);
  +        } 
  +        String [] list = src.list();
  +        if (list.length == 0) {
  +            throw new BuildException("srcdir attribute must be set!",
  +                                     location);
  +        }
  +
  +
           // if the compiler does its own dependency stuff, we just call it right now
           if (compiler.implementsOwnDependencyChecking()) {
               doCompilation(compiler);
  @@ -501,7 +515,6 @@
           }
       }
   
  -    /* ------------------------------------------------------------ */
       /**
        * Clear the list of files to be compiled and copied..
        */
  @@ -509,7 +522,6 @@
           compileList.removeAllElements();
       }
   
  -    /* ------------------------------------------------------------ */
       /**
        * Scans the directory looking for source files to be compiled.
        * The results are returned in the class variable compileList
  @@ -522,6 +534,9 @@
               String filename = files[i];
               File srcFile = new File(srcDir, filename);
               File javaFile = mapToJavaFile(mangler, srcFile, srcDir, dest);
  +            if(javaFile==null) {
  +                continue;
  +            }
   
               if (srcFile.lastModified() > now) {
                   log("Warning: file modified in the future: " + filename,
  @@ -628,9 +643,9 @@
               return directory;
           }
   
  -    /**
  -     * set directory; alternate syntax
  -     */
  +        /**
  +         * set directory; alternate syntax
  +         */
           public void setBaseDir(File directory) {
               this.directory = directory;
           }
  
  
  

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