ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John.D.Ca...@mail.sprint.com
Subject RE: need IntrosectionHelper help (was: [PATCH] comma separated PVCS projects)
Date Thu, 19 Apr 2001 20:11:23 GMT
every time I've seen this implemented, the create...() method takes the 
place of an add...() method, and you should handle the 
vector.addElement(proj) within the create() method.

That should do it...

John

-----Original Message-----
From: wierzbickif [mailto:wierzbickif@yahoo.com]
Sent: Thursday, April 19, 2001 2:56 PM
To: ant-dev
Cc: wierzbickif
Subject: need IntrosectionHelper help (was: [PATCH] comma separated PVCS
projects)


Thanks again John, that was almost enough, but:

I implemented a createPvcsproject like this:

    public PvcsProject createPvcsproject() throws BuildException {
        PvcsProject p = new PvcsProject(project);
        return p;
    }

and an inner class PvcsProject like this:

    public class PvcsProject extends DataType {
        Project p;
        String text;

        public PvcsProject(Project p) {
            PvcsProject.this.p = p;
        }
        public void addText(String text) {
            this.text = text;
        }
        public String getText() {
            return text;
        }
    }

but my addPvcsProject method never gets called.  CreatePvcsproject does 
get
called for each <pvcsproject> element, and addText in the inner class 
gets
called with the value "/proj" (in the example below), so I could just 
use that,
but I'm not sure that this would be the Right Thing To Do.  Any 
suggestions
would be appreciated, otherwise I'll just set my values in the inner 
class and
submit when I'm finishded testing.

here is an example task:

    <pvcs repository="Z:/repos">
      <pvcsproject>/proj</pvcsproject>
    </pvcs>


--- John.D.Casey@mail.sprint.com wrote:
> try implementing a createPvcsproject() method in the Pvcs task with 
the 
> following signature:
> 
> public PvcsProject createPvcsproject();
> 
> Then, initialize the PvcsProject and return it within this method.  
The 
> IntrospectionHelper will take care of fleshing out the actual object 
> you return, provided it has the normal add...() and set...() and 
> create...() methods...
> 
> John
> 
> -----Original Message-----
> From: wierzbickif [mailto:wierzbickif@yahoo.com]
> Sent: Thursday, April 19, 2001 10:43 AM
> To: ant-dev
> Cc: wierzbickif
> Subject: Re: [PATCH] comma separated PVCS projects
> 
> 
> Ant Developers,
> 
> I was hoping that implementing an addPvcsproject method would just 
> involve
> creating a vector pvcsProjects and adding these lines:
> 
>     public void addPvcsproject(String prj) {
>         pvcsProjects.addElement(prj);
>     }
> 
> However, when I do this and add a <pvcsproject> subelement to <pvcs> 
I 
> get:
> 
> d:\build.xml:105: Class org.apache.tools.ant.taskdefs.optional.Pvcs 
> doesn't
> support the nested "pvcsproject" element
> 
> From looking at other "add" methods, I was guessing that some sort of
> introspection is being used, and this works at least with various 
types 
> of
> FileSet as well as with Environment.Variable classes.  I'm wondering 
if 
> anyone
> can point me in the right direction as to how to make this add method 
> work...
> 
> Thanks in advance,
> 
> Frank Wierzbicki
> --- Stefan Bodewig <bodewig@apache.org> wrote:
> > Frank Wierzbicki <wierzbickif@yahoo.com> wrote:
> > 
> > > Personally, I'd like something that avoided the comma separated
> > > list,
> > 
> > +1
> > 
> > > I think this can be implemented with an addPvcsproject method.
> > 
> > Yes, this what you'd have to do.
> > 
> > Stefan
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message