Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 75686 invoked from network); 16 Aug 2006 10:22:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Aug 2006 10:22:33 -0000 Received: (qmail 61624 invoked by uid 500); 16 Aug 2006 10:22:29 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 61579 invoked by uid 500); 16 Aug 2006 10:22:29 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 61568 invoked by uid 99); 16 Aug 2006 10:22:29 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Aug 2006 03:22:29 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [17.250.248.174] (HELO smtpout.mac.com) (17.250.248.174) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Aug 2006 03:22:28 -0700 Received: from mac.com (smtpin04-en2 [10.13.10.149]) by smtpout.mac.com (Xserve/8.12.11/smtpout04/MantshX 4.0) with ESMTP id k7GAM8vK006517 for ; Wed, 16 Aug 2006 03:22:08 -0700 (PDT) Received: from [192.2.2.72] (mail.soci.org [193.130.19.189]) (authenticated bits=0) by mac.com (Xserve/smtpin04/MantshX 4.0) with ESMTP id k7GAM3df014827 for ; Wed, 16 Aug 2006 03:22:06 -0700 (PDT) Message-ID: <44E2F2D4.10701@mac.com> Date: Wed, 16 Aug 2006 11:26:28 +0100 From: Gerry Healy User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: Ant Users List Subject: Re: Task doesn't support the nested * element References: <3A1FE9C02EBFEB4E9FE0F7D2AEBBEDE3AF0D9D@esealmw111> <44E08A1C.7090100@mac.com> In-Reply-To: <44E08A1C.7090100@mac.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This may be a repeat as I posted from the wrong address before. I've solved this myself in the end, but it was a little bit tricky. I was creating and instance of ProjectHelperImpl directly, whereas it seems I should have been using the static method ProjectHelper.getProjectHelper(). I only needed an instance of ProjectHelper to avoid the compile warnings for the depracated ProjectHelper.configureProject() method. However there were no docs or code examples I could find on how to use the recommended parse() method. Perhaps the docs of the ProjectHelper class could include a code segment showing how to instansiate the class and use the parse method. e.g. ProjectHelper ph = ProjectHelper.getProjectHelper(); ph.parse(project, buildFile); Thanks, Gerry Gerry Healy wrote: > I have just tried ant 1.6.5, which also fails but with a null pointer > exception > > build.xml:215: java.lang.NullPointerException > > Note: the error only occurs when running ant from the API, when > running ant in command line it works as expected. > > --Gerry > > > David Corley (AT/LMI) wrote: >> Have you tried running the task with ant 1.6.5? >> And are you using the latest ant-contrib version (1.0b2)? >> >> /Dave >> >> -----Original Message----- >> From: Gerry Healy [mailto:nickel_chrome@mac.com] Sent: 14 August 2006 >> 12:53 >> To: user@ant.apache.org >> Subject: Task doesn't support the nested * element >> >> Hi there, >> >> I am having trouble using third party ant tasks with nested elements, >> from the Ant API. For example the ant-contrib IfTask and the svnant >> SvnTask. >> >> I am able to use both of these tasks in build scripts without a problem, >> when running ant from the command line. But I want to use them from the >> Ant API. However when I do this I get an error similar to below, which >> is clearly not correct: >> >> build.xml:215: Class net.sf.antcontrib.logic.IfTask doesn't support >> the nested "equals" element. >> >> I'm running: >> >> RedHat 9 >> Java 1.4.2 (build 1.4.2_03-b02) >> Ant 1.6.0 (compiled on December 18 2003) >> >> Any help would be appreciated. Thanks, >> >> Gerry >> >> >> The section of the build that is failing is trivial: >> >> >> >> >> >> >> >> >> >> >> >> And the taskdef is declared as below: >> >> >> >> >> >> I've also tried the following declarations, which makes no difference >> >> >> >> >> >> >> >> >> >> >> >> The relevent API code is: >> >> String buildFile = "/path/to/build/file"; String buildDir = >> "/path/to/build/dir"; >> >> try { >> >> project.fireBuildStarted(); >> project.init(); >> >> project.setBaseDir( new File( buildDir )); >> project.setUserProperty( "ant.file", buildFile); >> project.setUserProperty( "ant.version", Main.getAntVersion()); >> >> ProjectHelper projHelper = new ProjectHelperImpl(); >> projHelper.parse(project, new File(buildFile)); >> project.executeTarget( target ); >> >> } catch( Throwable ex) { >> >> error = ex; >> } finally { >> >> project.fireBuildFinished(error); >> >> } >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional >> commands, e-mail: user-help@ant.apache.org >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org >> For additional commands, e-mail: user-help@ant.apache.org >> >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org