ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers CompilerAdapter.java CompilerAdapterFactory.java DefaultCompilerAdapter.java JasperC.java
Date Wed, 06 Mar 2002 10:37:58 GMT
donaldp     02/03/06 02:37:58

  Modified:    proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp
                        JspC.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers
                        CompilerAdapter.java CompilerAdapterFactory.java
                        DefaultCompilerAdapter.java JasperC.java
  Log:
  Convert Jspc to using TaskContext to log
  
  Revision  Changes    Path
  1.19      +2 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java
  
  Index: JspC.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- JspC.java	18 Feb 2002 09:02:40 -0000	1.18
  +++ JspC.java	6 Mar 2002 10:37:58 -0000	1.19
  @@ -57,7 +57,7 @@
    *      </a>
    * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
    * @author <a href="mailto:jayglanville@home.com">J D Glanville</a>
  - * @version $Revision: 1.18 $ $Date: 2002/02/18 09:02:40 $
  + * @version $Revision: 1.19 $ $Date: 2002/03/06 10:37:58 $
    */
   public class JspC extends MatchingTask
   {
  @@ -383,7 +383,7 @@
           if( compileList.size() > 0 )
           {
               CompilerAdapter adapter =
  -                CompilerAdapterFactory.getCompiler( compiler.toString(), this );
  +                CompilerAdapterFactory.getCompiler( compiler.toString(), getContext() );
               getLogger().info( "Compiling " + compileList.size() +
                                 " source file"
                                 + ( compileList.size() == 1 ? "" : "s" )
  
  
  
  1.4       +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/CompilerAdapter.java
  
  Index: CompilerAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/CompilerAdapter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CompilerAdapter.java	23 Dec 2001 06:31:58 -0000	1.3
  +++ CompilerAdapter.java	6 Mar 2002 10:37:58 -0000	1.4
  @@ -8,6 +8,7 @@
   package org.apache.tools.ant.taskdefs.optional.jsp.compilers;
   
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.TaskContext;
   import org.apache.tools.ant.taskdefs.optional.jsp.JspC;
   
   /**
  @@ -23,9 +24,9 @@
    *      jayglanville@home.com</a>
    * @author Matthew Watson <a href="mailto:mattw@i3sp.com">mattw@i3sp.com</a>
    */
  -
   public interface CompilerAdapter
   {
  +    void setTaskContext( TaskContext context );
   
       /**
        * Sets the compiler attributes, which are stored in the Jspc task.
  
  
  
  1.5       +10 -3     jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/CompilerAdapterFactory.java
  
  Index: CompilerAdapterFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/CompilerAdapterFactory.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CompilerAdapterFactory.java	21 Feb 2002 09:41:54 -0000	1.4
  +++ CompilerAdapterFactory.java	6 Mar 2002 10:37:58 -0000	1.5
  @@ -9,6 +9,7 @@
   
   import org.apache.myrmidon.api.AbstractTask;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.TaskContext;
   
   /**
    * Creates the necessary compiler adapter, given basic criteria.
  @@ -18,7 +19,6 @@
    */
   public class CompilerAdapterFactory
   {
  -
       /**
        * This is a singlton -- can't create instances!!
        */
  @@ -39,12 +39,19 @@
        *
        * @param compilerType either the name of the desired compiler, or the full
        *      classname of the compiler's adapter.
  -     * @param task a task to log through.
        * @return The Compiler value
        * @throws TaskException if the compiler type could not be resolved into a
        *      compiler adapter.
        */
  -    public static CompilerAdapter getCompiler( String compilerType, AbstractTask task )
  +    public static CompilerAdapter getCompiler( String compilerType, TaskContext context
)
  +        throws TaskException
  +    {
  +        final CompilerAdapter adapter = createAdapter( compilerType );
  +        adapter.setTaskContext( context );
  +        return adapter;
  +    }
  +
  +    private static CompilerAdapter createAdapter( String compilerType )
           throws TaskException
       {
           /*
  
  
  
  1.10      +14 -4     jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/DefaultCompilerAdapter.java
  
  Index: DefaultCompilerAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/DefaultCompilerAdapter.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- DefaultCompilerAdapter.java	20 Jan 2002 02:11:44 -0000	1.9
  +++ DefaultCompilerAdapter.java	6 Mar 2002 10:37:58 -0000	1.10
  @@ -10,7 +10,7 @@
   import java.util.ArrayList;
   import java.util.Iterator;
   import org.apache.avalon.excalibur.util.StringUtil;
  -import org.apache.avalon.framework.logger.AbstractLogEnabled;
  +import org.apache.myrmidon.api.TaskContext;
   import org.apache.tools.ant.taskdefs.optional.jsp.JspC;
   import org.apache.tools.ant.types.Commandline;
   
  @@ -21,10 +21,20 @@
    * @author Matthew Watson <a href="mailto:mattw@i3sp.com">mattw@i3sp.com</a>
    */
   public abstract class DefaultCompilerAdapter
  -    extends AbstractLogEnabled
       implements CompilerAdapter
   {
       private JspC m_attributes;
  +    private TaskContext m_taskContext;
  +
  +    public void setTaskContext( final TaskContext context )
  +    {
  +        m_taskContext = context;
  +    }
  +
  +    protected final TaskContext getTaskContext()
  +    {
  +        return m_taskContext;
  +    }
   
       public void setJspc( final JspC attributes )
       {
  @@ -51,7 +61,7 @@
                                               ArrayList compileList,
                                               Commandline cmd )
       {
  -        getLogger().debug( "Compilation args: " + cmd.toString() );
  +        getTaskContext().debug( "Compilation args: " + cmd.toString() );
   
           StringBuffer niceSourceList = new StringBuffer( "File" );
           if( compileList.size() != 1 )
  @@ -70,7 +80,7 @@
               niceSourceList.append( "    " + arg + StringUtil.LINE_SEPARATOR );
           }
   
  -        getLogger().debug( niceSourceList.toString() );
  +        getTaskContext().debug( niceSourceList.toString() );
       }
   }
   
  
  
  
  1.13      +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java
  
  Index: JasperC.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- JasperC.java	6 Feb 2002 13:38:01 -0000	1.12
  +++ JasperC.java	6 Mar 2002 10:37:58 -0000	1.13
  @@ -8,6 +8,7 @@
   package org.apache.tools.ant.taskdefs.optional.jsp.compilers;
   
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.TaskContext;
   import org.apache.tools.ant.taskdefs.Java;
   import org.apache.tools.ant.taskdefs.optional.jsp.JspC;
   import org.apache.tools.ant.types.Argument;
  @@ -28,7 +29,7 @@
       public boolean execute()
           throws TaskException
       {
  -        getLogger().debug( "Using jasper compiler" );
  +        getTaskContext().debug( "Using jasper compiler" );
           Commandline cmd = setupJasperCommand();
   
           try
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message