ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-ant/proposal/sandbox/embed Import.java ProjectHelperImpl2.java ant-sax2.jar
Date Fri, 19 Jul 2002 19:37:06 GMT
costin      2002/07/19 12:37:06

  Modified:    proposal/sandbox/embed Import.java ProjectHelperImpl2.java
                        ant-sax2.jar
  Log:
  Improve debugging ( to find the super. problems with import ).
  Smaller fixes.
  
  Revision  Changes    Path
  1.2       +3 -0      jakarta-ant/proposal/sandbox/embed/Import.java
  
  Index: Import.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/sandbox/embed/Import.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Import.java	19 Jul 2002 18:02:53 -0000	1.1
  +++ Import.java	19 Jul 2002 19:37:06 -0000	1.2
  @@ -155,6 +155,9 @@
           if (context.importedFiles.containsKey(importedFilename)) {
               project.log("\nSkipped already imported file:\n   "+importedFilename+"\n",
                           Project.MSG_WARN);
  +            context.importlevel--;
  +            project.log("importlevel: "+context.importlevel+" <- "+
  +                        (context.importlevel+1) ,Project.MSG_DEBUG);          
               return;
           } else {
               context.importedFiles.put(importedFilename, importedFile);
  
  
  
  1.10      +26 -8     jakarta-ant/proposal/sandbox/embed/ProjectHelperImpl2.java
  
  Index: ProjectHelperImpl2.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/sandbox/embed/ProjectHelperImpl2.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ProjectHelperImpl2.java	19 Jul 2002 18:10:57 -0000	1.9
  +++ ProjectHelperImpl2.java	19 Jul 2002 19:37:06 -0000	1.10
  @@ -692,14 +692,13 @@
               int timesRedefined = 0;
                   
               Hashtable currentTargets = project.getTargets();
  -            project.log("Defined targets: "+currentTargets ,Project.MSG_VERBOSE);
  -                        
  +
               //currently tracks only one level of super.
               if(currentTargets.containsKey(name)){
  -              timesRedefined++;
  -            }
  -                
  -            if(timesRedefined>0){
  +                project.log("Defined targets: "+
  +                            ProjectHelperImpl2.targetString( currentTargets ) ,Project.MSG_VERBOSE);
  +                        
  +                timesRedefined++;
                              
                   project.log("Redefining target named: \""+name+"\"" ,Project.MSG_VERBOSE);
                   
  @@ -709,7 +708,7 @@
                   
                   String superTargetName = "";
                   for(int i=0; i < timesRedefined; i++){
  -                   superTargetName += "super."; 
  +                    superTargetName += "super."; 
                   }
                   superTargetName = superTargetName + name; 
                   oldTarget.setName(superTargetName);
  @@ -720,7 +719,9 @@
               // if the target is redefined, it redefines it, otherwise just adds it    
        
               project.addOrReplaceTarget(name, target);
   
  -            project.log("targets are now: "+currentTargets.toString() ,Project.MSG_VERBOSE);
  +            project.log("Targets are now: "+
  +                        ProjectHelperImpl2.targetString(currentTargets) ,
  +                        Project.MSG_VERBOSE);
   
               // END IMPORT CHANGE
               // context.project.addTarget(name, target);
  @@ -760,6 +761,23 @@
           }
       }
   
  +    private static String targetString(Hashtable currentTargets) {
  +        Enumeration enum=currentTargets.keys();
  +        StringBuffer sb=new StringBuffer();
  +        while( enum.hasMoreElements() ) {
  +            String tname=(String)enum.nextElement();
  +            Target t=(Target)currentTargets.get( tname );
  +            sb.append( "|" ).append(tname );
  +            Enumeration enum2=t.getDependencies();
  +            if( enum2.hasMoreElements() ) sb.append( "=" );
  +            while(enum2.hasMoreElements() ) {
  +                sb.append(enum2.nextElement());
  +                if( enum2.hasMoreElements()) sb.append(",");
  +            }
  +        }
  +        return sb.toString();
  +    }
  +    
       /**
        * Handler for all task elements.
        */
  
  
  
  1.8       +74 -62    jakarta-ant/proposal/sandbox/embed/ant-sax2.jar
  
  	<<Binary file>>
  
  

--
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