mbenson 2004/04/26 10:49:51 Modified: . WHATSNEW src/main/org/apache/tools/ant Target.java src/main/org/apache/tools/ant/helper AntXMLContext.java ProjectHelper2.java Log: Add a Location member to oata.Target, with the appropriate settor & gettor. PR: 28599 Revision Changes Path 1.600 +2 -0 ant/WHATSNEW Index: WHATSNEW =================================================================== RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.599 retrieving revision 1.600 diff -u -r1.599 -r1.600 --- WHATSNEW 26 Apr 2004 16:15:08 -0000 1.599 +++ WHATSNEW 26 Apr 2004 17:49:51 -0000 1.600 @@ -157,6 +157,8 @@ * New attribute "negate" on <propertyset> to invert selection criteria. +* Target now supports a Location member. Bugzilla Report 28599. + Changes from Ant 1.6.0 to Ant 1.6.1 ============================================= 1.52 +20 -0 ant/src/main/org/apache/tools/ant/Target.java Index: Target.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/Target.java,v retrieving revision 1.51 retrieving revision 1.52 diff -u -r1.51 -r1.52 --- Target.java 15 Mar 2004 17:33:09 -0000 1.51 +++ Target.java 26 Apr 2004 17:49:51 -0000 1.52 @@ -42,6 +42,8 @@ private List dependencies = null; /** Children of this target (tasks and data types). */ private List children = new ArrayList(); + /** Since Ant 1.6.2 */ + private Location location = Location.UNKNOWN_LOCATION; /** Project this target belongs to. */ private Project project; @@ -71,6 +73,24 @@ */ public Project getProject() { return project; + } + + /** + * Sets the location of this target's definition. + * + * @param location <CODE>Location</CODE> + */ + public void setLocation(Location location) { + this.location = location; + } + + /** + * Get the location of this target's definition. + * + * @return <CODE>Location</CODE> + */ + public Location getLocation() { + return location; } /** 1.10 +2 -0 ant/src/main/org/apache/tools/ant/helper/AntXMLContext.java Index: AntXMLContext.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/helper/AntXMLContext.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- AntXMLContext.java 9 Mar 2004 16:48:03 -0000 1.9 +++ AntXMLContext.java 26 Apr 2004 17:49:51 -0000 1.10 @@ -29,6 +29,7 @@ import org.apache.tools.ant.Project; import org.apache.tools.ant.Target; +import org.apache.tools.ant.Location; import org.apache.tools.ant.RuntimeConfigurable; @@ -109,6 +110,7 @@ public void setBuildFile(File buildFile) { this.buildFile = buildFile; this.buildFileParent = new File(buildFile.getParent()); + implicitTarget.setLocation(new Location(buildFile.getAbsolutePath())); } /** 1.46 +2 -4 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/ProjectHelper2.java,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- ProjectHelper2.java 14 Apr 2004 15:42:06 -0000 1.45 +++ ProjectHelper2.java 26 Apr 2004 17:49:51 -0000 1.46 @@ -757,6 +757,7 @@ Project project = context.getProject(); Target target = new Target(); target.setProject(project); + target.setLocation(new Location(context.getLocator())); context.addTarget(target); for (int i = 0; i < attrs.getLength(); i++) { @@ -805,10 +806,7 @@ 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())); + "Duplicate target '" + name + "'", target.getLocation()); } // Alter the name. if (context.getCurrentProjectName() != null) {
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]