Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 212 invoked from network); 27 Jan 2005 11:52:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 27 Jan 2005 11:52:34 -0000 Received: (qmail 86171 invoked by uid 500); 27 Jan 2005 11:52:29 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 86072 invoked by uid 500); 27 Jan 2005 11:52:28 -0000 Mailing-List: contact dev-help@ant.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 dev@ant.apache.org Received: (qmail 86006 invoked by uid 99); 27 Jan 2005 11:52:27 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mail.elca.ch (HELO mail.elca.ch) (193.72.144.2) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 27 Jan 2005 03:52:25 -0800 Received: from exchange.elca.ch (unverified) by mail.elca.ch (Content Technologies SMTPRS 4.3.17) with ESMTP id for ; Thu, 27 Jan 2005 12:52:20 +0100 Received: from pcyma.elca.ch.elca.ch (pcyma.elca.ch [10.10.10.112]) by exchange.elca.ch with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id DGK054JP; Thu, 27 Jan 2005 12:52:20 +0100 From: Yves Martin To: "Ant Developers List" Subject: Patch proposal for 1.6.3: parse a Ant project from a resource References: Organization: ELCA Informatique Date: Thu, 27 Jan 2005 12:53:06 +0100 In-Reply-To: (Yves Martin's message of "Thu, 27 Jan 2005 10:52:56 +0100") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Yves Martin writes: > Hello, > > I'm writing a task which aim is to parse a Ant Project with 'helper.parse(p, > myURL)' > > It works well when myURL is a File on disk - but it failed with "Source not > supported by this plugin" when it is a URL... whereas I saw some parts of > ProjectHelper2 designed to load a URL resource. > > I would like to avoid to inherit from ProjectHelper2 to work-around the check > that failed. I would like to understand why a BuildException is thrown when trying to parse a URL ? I disabled that exception throwing and in fact, I just use helper.parse(project, URL) with a URL and it works perfectly well. If there is no "good" reason or constraint about that exception, I would be pleased to see that part of code removed. Or simply disabled by a project property, why not. What do you think about it ? Is it possible to get it for release 1.6.3 (it will be a great help for me to release my build system) ? Thanks in advance for your help public void parse(Project project, Object source, RootHandler handler) throws BuildException { AntXMLContext context = handler.context; File buildFile = null; URL url = null; String buildFileName = null; if (source instanceof File) { buildFile = (File) source; buildFile = fu.normalize(buildFile.getAbsolutePath()); context.setBuildFile(buildFile); buildFileName = buildFile.toString(); // } else if (source instanceof InputStream ) { } else if (source instanceof URL) { // if (handler.getCurrentAntHandler() != elementHandler) { // throw new BuildException( // "Source " + source.getClass().getName() // + " not supported by this plugin for " // + " non task xml"); // } url = (URL) source; buildFileName = url.toString(); // } else if (source instanceof InputSource ) { } else { throw new BuildException("Source " + source.getClass().getName() + " not supported by this plugin"); } -- Yves Martin --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org