Return-Path: Delivered-To: apmail-jakarta-ant-dev-archive@apache.org Received: (qmail 24725 invoked from network); 19 Jul 2002 18:11:05 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 19 Jul 2002 18:11:05 -0000 Received: (qmail 3908 invoked by uid 97); 19 Jul 2002 18:11:20 -0000 Delivered-To: qmlist-jakarta-archive-ant-dev@jakarta.apache.org Received: (qmail 3893 invoked by uid 97); 19 Jul 2002 18:11:19 -0000 Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 3882 invoked by uid 97); 19 Jul 2002 18:11:19 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 19 Jul 2002 18:10:57 -0000 Message-ID: <20020719181057.40906.qmail@icarus.apache.org> From: costin@apache.org To: jakarta-ant-cvs@apache.org Subject: cvs commit: jakarta-ant/proposal/sandbox/embed ProjectHelperImpl2.java ant-sax2.jar X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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: "default", -// * "name", "id" and "basedir". -// * -// * @param tag Name of the element which caused this handler -// * to be created. Should not be null. -// * Ignored in this implementation. -// * @param attrs Attributes of the element which caused this -// * handler to be created. Must not be null. -// * -// * @exception SAXParseException if an unexpected attribute is -// * encountered or if the "default" 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 <> -- To unsubscribe, e-mail: For additional commands, e-mail: