ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <jakarta-...@ehatchersolutions.com>
Subject custom selector problem
Date Fri, 17 May 2002 23:35:52 GMT
 [ sorry for the duplication - my first attempt was from an unsubscribed
address, so sending again just in case ]

Bruce or others,

I'm writing a custom selector and have come across a couple of issues:

1) It won't work unless the custom selector is in the system classpath.  I'm
getting this error and I'm using the <custom classname="..."
classpath="..."/> construct with the right classpath.

    "Selector org.example.MySelector not initialized, no such class"

    In ExtendSelector I see this:

    public void selectorCreate() {
        if (classname != null && classname.length() > 0) {
            try {
                dynselector = (ExtendFileSelector)
                        Class.forName(classname).newInstance();
            }

    So its not even using the 'classpath' variable in ExtendSelector.
 Bruce - could you fix this up using the AntClassLoader tricks that is used
in other places?  Most appreciated!  I'll do it (eventually) if you don't.
But this really needs to get into Ant 1.5 to make custom selectors useful.

2) Shouldn't I be allowed to create a selector that simply implements
FileSelector?  I can't according to the code above - I must extend
ExtendFileSelector... but what if I don't need parameters?  No big deal
here, just thought I'd toss it out there

3) My selector works great when not nested, but I tried inverting my
selection by using:

    <not>
        <custom.../>
    </not>

    and I got this error:
        "Internal Error: The dynamic selector is not set"

    I looked around a little but have not found the cause of this yet -
perhaps its due to lazy initialization somewhere?  (maybe need addConfigured
instead of create?)

Thanks for having a look at these - I'll add this to my ever-growing to-do
list that I hope to start whittling away in the next couple of weeks.

    Erik




--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message