You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Greg Roodt <gr...@gmail.com> on 2008/09/25 13:10:05 UTC

Add optional classpath support to FTP task - Bug 45860

Hi

I have raised a bug/enhancement for classpath element support for the
FTP task. https://issues.apache.org/bugzilla/show_bug.cgi?id=45860

I have downloaded the source and am starting to get familiar with it,
but before I go too far I want to know if this is possible/desirable
for Ant. I have searched the archives and there are a few people who
want the ability to run the FTP task without dropping the libs in
ant_home/lib.

Cheers
Greg Roodt

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


Re: Add optional classpath support to FTP task - Bug 45860

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 1 Oct 2008, Greg Roodt <gr...@gmail.com> wrote:

> I have made a very basic attempt at refactoring the FTPTask to
> delegate to an FTPTaskMirror. It compiles fine, except for one
> problem. I am stuck with an elegant solution to the
> getValidLanguageCodes() call in the LanguageCode static class.

I even fail to come up with a not-so-elegant solution, what is yours?

Stefan

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


Re: Add optional classpath support to FTP task - Bug 45860

Posted by Greg Roodt <gr...@gmail.com>.
Hi

I have made a very basic attempt at refactoring the FTPTask to
delegate to an FTPTaskMirror. It compiles fine, except for one
problem. I am stuck with an elegant solution to the
getValidLanguageCodes() call in the LanguageCode static class.

Any ideas, suggestions or offers of help? ;)

Cheers
Greg


On Fri, Sep 26, 2008 at 12:49 PM, Greg Roodt <gr...@gmail.com> wrote:
> Ok, Thanks for the info Stefan.
>
> I will take a look at the JUnitTask refactor, and see if I can do
> something similar for the FTPTask.
>
>
>
> On Thu, Sep 25, 2008 at 12:35 PM, Stefan Bodewig <bo...@apache.org> wrote:
>> On Thu, 25 Sep 2008, Greg Roodt <gr...@gmail.com> wrote:
>>
>>> I have downloaded the source and am starting to get familiar with
>>> it, but before I go too far I want to know if this is
>>> possible/desirable for Ant.
>>
>> Possible, probably, but non trivial.  The FTP class depends strongly
>> on commons-net, so in order to make it work you'd:
>>
>> * have to split the FTP task into two classes (and probably throw in
>>  an interface for good measure)
>>
>> * make sure the class that is loaded via Ant's classloader (the task)
>>  doesn't have any direct reference to either commons-net or the new
>>  class holding the FTP task's implemetation and go from there.
>>
>> Something similar has been done for the JUnit task in Ant 1.7.0.
>> <http://svn.eu.apache.org/viewvc?view=rev&revision=381467> has been
>> the initial commit, which has been refined later.
>>
>>> I have searched the archives and there are a few people who want the
>>> ability to run the FTP task without dropping the libs in
>>> ant_home/lib.
>>
>> It is probably easier to re-<taskdef> the tasks using a <taskdef> that
>> has both ant-commons-net.jar and commons-net.jar in its classpath and
>> remove ant-commons-net.jar from ANT_HOME/lib.
>>
>> <http://ant.apache.org/faq.html#delegating-classloader-1.6>
>>
>> But if you want to modify the FTP task to make things work easier, you
>> are very welcome.  If you wanted to tackle the other commons-net
>> related tasks at the same time, that would be even better.
>>
>> Stefan
>>
>> ---------------------------------------------------------------------
>> 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


Re: Add optional classpath support to FTP task - Bug 45860

Posted by Greg Roodt <gr...@gmail.com>.
Ok, Thanks for the info Stefan.

I will take a look at the JUnitTask refactor, and see if I can do
something similar for the FTPTask.



On Thu, Sep 25, 2008 at 12:35 PM, Stefan Bodewig <bo...@apache.org> wrote:
> On Thu, 25 Sep 2008, Greg Roodt <gr...@gmail.com> wrote:
>
>> I have downloaded the source and am starting to get familiar with
>> it, but before I go too far I want to know if this is
>> possible/desirable for Ant.
>
> Possible, probably, but non trivial.  The FTP class depends strongly
> on commons-net, so in order to make it work you'd:
>
> * have to split the FTP task into two classes (and probably throw in
>  an interface for good measure)
>
> * make sure the class that is loaded via Ant's classloader (the task)
>  doesn't have any direct reference to either commons-net or the new
>  class holding the FTP task's implemetation and go from there.
>
> Something similar has been done for the JUnit task in Ant 1.7.0.
> <http://svn.eu.apache.org/viewvc?view=rev&revision=381467> has been
> the initial commit, which has been refined later.
>
>> I have searched the archives and there are a few people who want the
>> ability to run the FTP task without dropping the libs in
>> ant_home/lib.
>
> It is probably easier to re-<taskdef> the tasks using a <taskdef> that
> has both ant-commons-net.jar and commons-net.jar in its classpath and
> remove ant-commons-net.jar from ANT_HOME/lib.
>
> <http://ant.apache.org/faq.html#delegating-classloader-1.6>
>
> But if you want to modify the FTP task to make things work easier, you
> are very welcome.  If you wanted to tackle the other commons-net
> related tasks at the same time, that would be even better.
>
> Stefan
>
> ---------------------------------------------------------------------
> 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


Re: Add optional classpath support to FTP task - Bug 45860

Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 25 Sep 2008, Greg Roodt <gr...@gmail.com> wrote:

> I have downloaded the source and am starting to get familiar with
> it, but before I go too far I want to know if this is
> possible/desirable for Ant.

Possible, probably, but non trivial.  The FTP class depends strongly
on commons-net, so in order to make it work you'd:

* have to split the FTP task into two classes (and probably throw in
  an interface for good measure)

* make sure the class that is loaded via Ant's classloader (the task)
  doesn't have any direct reference to either commons-net or the new
  class holding the FTP task's implemetation and go from there.

Something similar has been done for the JUnit task in Ant 1.7.0.
<http://svn.eu.apache.org/viewvc?view=rev&revision=381467> has been
the initial commit, which has been refined later.

> I have searched the archives and there are a few people who want the
> ability to run the FTP task without dropping the libs in
> ant_home/lib.

It is probably easier to re-<taskdef> the tasks using a <taskdef> that
has both ant-commons-net.jar and commons-net.jar in its classpath and
remove ant-commons-net.jar from ANT_HOME/lib.

<http://ant.apache.org/faq.html#delegating-classloader-1.6>

But if you want to modify the FTP task to make things work easier, you
are very welcome.  If you wanted to tackle the other commons-net
related tasks at the same time, that would be even better.

Stefan

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