Bug 40058 - [PATCH] add two new options to the <get> task
Summary: [PATCH] add two new options to the <get> task
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.7.0
Hardware: All All
: P2 enhancement with 2 votes (vote)
Target Milestone: 1.8.0
Assignee: Ant Notifications List
Keywords: PatchAvailable
Depends on:
Reported: 2006-07-17 15:29 UTC by David M. Lloyd
Modified: 2009-07-24 07:55 UTC (History)
0 users

Patch to add parameters to the <get> core task (2.96 KB, patch)
2006-07-17 15:30 UTC, David M. Lloyd
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David M. Lloyd 2006-07-17 15:29:14 UTC
I've generated a patch to add two options to the <get> task.  The first is
simply to configure the number times that <get> will retry on failure (it was
hardcoded at 3).  The second is to allow <get> to simply skip over files that
exist locally, rather than trying to download them from the server.

Both options default to the current behavior.

This patch may be applied to trunk, but should also be applicable to the 1.6
branch as well.
Comment 1 David M. Lloyd 2006-07-17 15:30:15 UTC
Created attachment 18612 [details]
Patch to add parameters to the <get> core task
Comment 2 Steve Loughran 2006-07-21 22:07:52 UTC
David, in ant's SVN repository there is an antlib that extends all the http
tasks, get included. We currently envisage these as the future of Ant's
get/post/put support, and, being still unshipped, has room for change. 

would your changes work there? 
Comment 3 David M. Lloyd 2006-07-24 14:48:11 UTC
I guess it's possible.  But I tend to see these two options as pretty basic, and
in addition, I don't see any reason why this couldn't also be applied to the
1.6.x branch as well.

Maybe if this patch were adding some advanced feature, it would make sense to
move out to an optional package.  But the ability to not attempt to download a
file if it already exists locally greatly simplifies dependancy management for
small projects for which complex dependancy management is overkill.  And the
configurable retries should have been in this task from the start; I can only
imagine that it was an oversight on the part of the original author.

I'd hate to see something so simple require an additional package to do.
Comment 4 Stefan Bodewig 2009-07-24 07:55:19 UTC
applied in svn revision 797509