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 ProjectHelperImpl2.java ant-sax2.jar
Date Fri, 19 Jul 2002 18:10:57 GMT
costin      2002/07/19 11:10:57

  Modified:    proposal/sandbox/embed ProjectHelperImpl2.java ant-sax2.jar
  Log:
  Implement the change in handling the top-level target before
  executing other targets ( which is closer to the original
  behavior ).
  
  Import started to work a bit - but it complain about
  circular dep on super.mb2, still investigating.
  
  Revision  Changes    Path
  1.9       +3 -104    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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ProjectHelperImpl2.java	19 Jul 2002 18:02:27 -0000	1.8
  +++ ProjectHelperImpl2.java	19 Jul 2002 18:10:57 -0000	1.9
  @@ -104,6 +104,7 @@
           
           project.addReference( "ant.parsing.context", context );
           parse(project, source,new RootHandler(context));
  +        context.implicitTarget.execute();
       }
   
       /**
  @@ -680,7 +681,8 @@
               Project project=context.project;
               
               target = new Target();
  -            target.addDependency( "" );
  +            // No need - it'll be handled explicitly
  +            // target.addDependency( "" );
               target.setName(name);
               target.setIf(ifCond);
               target.setUnless(unlessCond);
  @@ -1153,107 +1155,4 @@
               return new NestedElementHandler(element, wrapper, target);
           }
       }
  -
  -//     /**
  -//      * Handler for the root element. Its only child must be the "project" element.
  -//      */
  -//     static class ImportHandler extends AntHandler {
  -
  -//         /**
  -//          * Initialisation routine called after handler creation
  -//          * with the element name and attributes. The attributes which
  -//          * this handler can deal with are: <code>"default"</code>,
  -//          * <code>"name"</code>, <code>"id"</code> and <code>"basedir"</code>.
  -//          *
  -//          * @param tag Name of the element which caused this handler
  -//          *            to be created. Should not be <code>null</code>.
  -//          *            Ignored in this implementation.
  -//          * @param attrs Attributes of the element which caused this
  -//          *              handler to be created. Must not be <code>null</code>.
  -//          *
  -//          * @exception SAXParseException if an unexpected attribute is
  -//          *            encountered or if the <code>"default"</code> attribute
  -//          *            is missing.
  -//          */
  -//         public void onStartElement(String uri, String tag, String qname,
  -//                                    Attributes attrs,
  -//                                    AntXmlContext context)
  -//             throws SAXParseException
  -//         {
  -//             context._importlevel++;
  -//             Project project=context.project;
  -//             project.log("importlevel: "+(context._importlevel-1)+" -> "+(context._importlevel),
  -//                         Project.MSG_DEBUG);
  -//             String file = null;
  -//             for (int i = 0; i < attrs.getLength(); i++) {
  -//                 String key = attrs.getQName(i);
  -//                 String value = attrs.getValue(i);
  -//                 if (key.equals("file")) {
  -//                     file = value;
  -//                 } else {
  -//                     throw new SAXParseException("Unexpected attribute \"" + key + "\"",
context.locator);
  -//                 }
  -//             }
  -
  -//             if (file == null) {
  -//                 throw new SAXParseException("import element appears without a file attribute",
  -//                                             context.locator);
  -//             }
  -    
  -//             file=project.replaceProperties(file);
  -//             project.log("Importing file "+file+" from "+
  -//                         context.buildFile.getAbsolutePath(),
  -//                         Project.MSG_VERBOSE);
  -
  -//             // Paths are relative to the build file they're imported from,
  -//             // *not* the current directory (same as entity includes).
  -//             File importedFile = new File(file);
  -//             if (!importedFile.isAbsolute()) {
  -//                 importedFile = new File(context.buildFileParent, file);
  -//             }
  -//             if (!importedFile.exists()) {
  -//                 throw new SAXParseException("Cannot find "+file+" imported from "+
  -//                                             context.buildFile.getAbsolutePath(),
  -//                                             context.locator);
  -//             }
  -
  -//             // Add parent build file to the map to avoid cycles...
  -//             String parentFilename = getPath(context.buildFile);
  -//             if (!context._importedFiles.containsKey(parentFilename)) {
  -//                 context._importedFiles.put(parentFilename, context.buildFile);
  -//             }
  -
  -//             // Make sure we import the file only once
  -//             String importedFilename = getPath(importedFile);
  -//             if (context._importedFiles.containsKey(importedFilename)) {
  -//                 project.log("\nSkipped already imported file:\n   "+importedFilename+"\n",
  -//                             Project.MSG_WARN);
  -//                 return;
  -//             }
  -//             else {
  -//                 context._importedFiles.put(importedFilename, importedFile);
  -//             }
  -    
  -//             org.xml.sax.XMLReader oldparser = context.parser;
  -//             context.ignoreProjectTag=true;
  -//             context.helper.parse(context.project, importedFile, new RootHandler(context));
  -//             context.ignoreProjectTag=false;
  -//             context.parser = oldparser;
  -
  -//             context._importlevel--;
  -//             context.project.log("importlevel: "+context._importlevel+" <- "+
  -//                                 (context._importlevel+1) ,Project.MSG_DEBUG);      
   
  -//         }
  -
  -//         private static String getPath(File file) {
  -//             try {
  -//                 return file.getCanonicalPath();
  -//             }
  -//             catch (IOException e) {
  -//                 return file.getAbsolutePath();
  -//             }
  -//         }
  -//     }
  -    
  -
   }
  
  
  
  1.7       +67 -68    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