Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 62005 invoked from network); 1 Mar 2004 09:01:52 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 1 Mar 2004 09:01:52 -0000 Received: (qmail 88142 invoked by uid 500); 1 Mar 2004 09:01:27 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 87837 invoked by uid 500); 1 Mar 2004 09:01:25 -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 87811 invoked from network); 1 Mar 2004 09:01:24 -0000 Received: from unknown (HELO corvil.com) (213.94.219.177) by daedalus.apache.org with SMTP; 1 Mar 2004 09:01:24 -0000 Received: from corvil.com (preilly.local.corvil.com [172.18.1.173]) by corvil.com (8.12.9/8.12.5) with ESMTP id i2191ZjD050544 for ; Mon, 1 Mar 2004 09:01:35 GMT (envelope-from peter.reilly@corvil.com) Message-ID: <4042FBA3.3000804@corvil.com> Date: Mon, 01 Mar 2004 09:00:19 +0000 From: Peter Reilly User-Agent: Mozilla Thunderbird 0.5 (X11/20040208) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ant Developers List Subject: Re: cvs commit: ant WHATSNEW build.xml References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Jose, You are right, the check is just for the main build file. Peter Jose Alberto Fernandez wrote: >Peter, > >Maybe I do not understand the fix completely, >but shouldn't the check be that a target cannot appear >ON THE SAME FILE (imported or main) more than once? >I.e., I should not be able to duplicate a target on a file >and get away with it by importing it instead of executing it >directly. > >Does your fix covers this case? > >Jose Alberto > > > >>-----Original Message----- >>From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de] >>Sent: 27 February 2004 12:14 >>To: dev@ant.apache.org >>Subject: RE: cvs commit: ant WHATSNEW build.xml >> >> >>Fast resolved, Peter :) >> >>Jan >> >> >> >>>-----Original Message----- >>>From: peterreilly@apache.org [mailto:peterreilly@apache.org] >>>Sent: Friday, February 27, 2004 12:45 PM >>>To: ant-cvs@apache.org >>>Subject: cvs commit: ant WHATSNEW build.xml >>> >>> >>>peterreilly 2004/02/27 03:45:15 >>> >>> Modified: src/main/org/apache/tools/ant/helper >>>ProjectHelper2.java >>> src/testcases/org/apache/tools/ant ProjectTest.java >>> . WHATSNEW build.xml >>> Log: >>> Fix for duplicate targets in the build file. >>> In ant 1.5 these were not allowed. >>> In ant 1.6, with import file's targets being allowed to >>> be overridden, duplicate targets where incorrectly allowed >>> in normal build files. >>> The fix just checks if the duplicate target is defined >>> in an imported file or in a "main" file. >>> Reported by: Dominique Devienne >>> See: http://marc.theaimsgroup.com/?t=107705039100004&r=1&w=2 >>> >>> Revision Changes Path >>> 1.42 +8 -0 >>>ant/src/main/org/apache/tools/ant/helper/ProjectHelper2.java >>> >>> Index: ProjectHelper2.java >>> >>> >>> >>=================================================================== >> >> >>> RCS file: >>>/home/cvs/ant/src/main/org/apache/tools/ant/helper/ProjectHelp >>>er2.java,v >>> retrieving revision 1.41 >>> retrieving revision 1.42 >>> diff -u -r1.41 -r1.42 >>> --- ProjectHelper2.java 9 Feb 2004 21:05:18 -0000 1.41 >>> +++ ProjectHelper2.java 27 Feb 2004 11:45:14 -0000 1.42 >>> @@ -804,6 +804,14 @@ >>> >>> // If the name has already been defined ( >>>import for example ) >>> if (currentTargets.containsKey(name)) { >>> + if (!context.isIgnoringProjectTag()) { >>> + // not in an import'ed file >>> + throw new BuildException( >>> + "Duplicate target '" + name + "'", >>> + new >>>Location(context.getLocator().getSystemId(), >>> + >>>context.getLocator().getLineNumber(), >>> + >>>context.getLocator().getColumnNumber())); >>> + } >>> // Alter the name. >>> if (context.getCurrentProjectName() != null) { >>> String newName = >>>context.getCurrentProjectName() >>> >>> >>> >>> 1.24 +10 -3 >>>ant/src/testcases/org/apache/tools/ant/ProjectTest.java >>> >>> Index: ProjectTest.java >>> >>> >>> >>=================================================================== >> >> >>> RCS file: >>>/home/cvs/ant/src/testcases/org/apache/tools/ant/ProjectTest.java,v >>> retrieving revision 1.23 >>> retrieving revision 1.24 >>> diff -u -r1.23 -r1.24 >>> --- ProjectTest.java 20 Feb 2004 12:24:04 -0000 1.23 >>> +++ ProjectTest.java 27 Feb 2004 11:45:14 -0000 1.24 >>> @@ -206,8 +206,15 @@ >>> >>> public void testDuplicateTargets() { >>> // fail, because buildfile contains two targets >>>with the same name >>> - BFT bft = new BFT("", "core/duplicate-target.xml"); >>> - bft.expectBuildException("twice", "Duplicate target"); >>> + try { >>> + BFT bft = new BFT("", "core/duplicate-target.xml"); >>> + } catch (BuildException ex) { >>> + assertEquals("specific message", >>> + "Duplicate target 'twice'", >>> + ex.getMessage()); >>> + return; >>> + } >>> + fail("Should throw BuildException about >>> >>> >>duplicate target"); >> >> >>> } >>> >>> public void testDuplicateTargetsImport() { >>> @@ -265,4 +272,4 @@ >>> class DummyTaskPackage extends Task { >>> public DummyTaskPackage() {} >>> public void execute() {} >>> -} >>> \ No newline at end of file >>> +} >>> >>> >>> >>> 1.556 +5 -1 ant/WHATSNEW >>> >>> Index: WHATSNEW >>> >>> >>> >>=================================================================== >> >> >>> RCS file: /home/cvs/ant/WHATSNEW,v >>> retrieving revision 1.555 >>> retrieving revision 1.556 >>> diff -u -r1.555 -r1.556 >>> --- WHATSNEW 25 Feb 2004 13:02:52 -0000 1.555 >>> +++ WHATSNEW 27 Feb 2004 11:45:15 -0000 1.556 >>> @@ -53,7 +53,11 @@ >>> >>> * MacroDef did not allow attributes named 'description'. >>>Bugzilla Report 27175. >>> >>> -* Throw build exception if name attribute missing from >>>patternset. Bugzilla Report 25982. >>> +* Throw build exception if name attribute missing from >>>patternset#NameEntry. >>> + Bugzilla Report 25982. >>> + >>> +* Throw build exception if target repeated in build file, >>>but allow targets >>> + to be repeated in imported files. >>> >>> Other changes: >>> -------------- >>> >>> >>> >>> 1.412 +1 -8 ant/build.xml >>> >>> Index: build.xml >>> >>> >>> >>=================================================================== >> >> >>> RCS file: /home/cvs/ant/build.xml,v >>> retrieving revision 1.411 >>> retrieving revision 1.412 >>> diff -u -r1.411 -r1.412 >>> --- build.xml 26 Feb 2004 16:35:26 -0000 1.411 >>> +++ build.xml 27 Feb 2004 11:45:15 -0000 1.412 >>> @@ -329,13 +329,6 @@ >>> >>> >> >>> >>name="${optional.package}/BeanShellScriptTest.java"/> >> >> >>> >> >>> >>name="${optional.package}/jdepend/JDependTest.java"/> >> >> >>> - >> - >> >> >> creates a minimum distribution >>in ./dist" >> depends="dist-lite"/> >> >> - >> \ No newline at end of file >> + >> >> >> >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org >>For additional commands, e-mail: dev-help@ant.apache.org >> >> >> > >--------------------------------------------------------------------- >To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org >For additional commands, e-mail: dev-help@ant.apache.org > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org