You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Stefan Bodewig <bo...@apache.org> on 2005/09/26 06:21:44 UTC

my local version of supports filesystem resources now

Hi all,

I was offline for a week but had time to do some coding.  I finished
resources support for <copy> and <batchtest> but don't have the time
to commit it yet.  This is just a heads up so that Matt doesn't start
to work on it (hope I'm not too late).

There've been several reasons to only support filesystem resources,
supporting the old protected method signatures is one of them.

Stefan

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


Re: my local version of supports filesystem resources now

Posted by Matt Benson <gu...@yahoo.com>.
--- Stefan Bodewig <bo...@apache.org> wrote:

> On Wed, 28 Sep 2005, Matt Benson
> <gu...@yahoo.com> wrote:
> 
> > :) I had started working on apply but hadn't
> gotten
> > too far.  I'd like to see what you did.
> 
> I pretty much doubt that it will work for non-file
> resources, but at
> least it works fine for
> 
> <apply executable="ls">
>   <path path="${env.PATH}"/>
> </apply>

Maybe some add'l code for up-to-date checking, but
aside from the fact that the constructed command line
may or may not be valid, which is always an issue,
replace srcfile's getAbsolutePath() with "source
resource".toString() and we should be in business,
IMO.

-Matt
> 
> >> I added a new protected method to Expand for
> non-file resources,
> >> maybe an approach like that will work for other
> tasks as well.
> > 
> > I'll have to see it.
> 
> I'll commit it right now without specific unit tests
> or updating the
> docs.  At least the existing tests still pass.
> 
> Stefan
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> dev-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> dev-help@ant.apache.org
> 
> 



		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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


Re: my local version of supports filesystem resources now

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 28 Sep 2005, Matt Benson <gu...@yahoo.com> wrote:

> :) I had started working on apply but hadn't gotten
> too far.  I'd like to see what you did.

I pretty much doubt that it will work for non-file resources, but at
least it works fine for

<apply executable="ls">
  <path path="${env.PATH}"/>
</apply>

>> I added a new protected method to Expand for non-file resources,
>> maybe an approach like that will work for other tasks as well.
> 
> I'll have to see it.

I'll commit it right now without specific unit tests or updating the
docs.  At least the existing tests still pass.

Stefan

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


Re: my local version of supports filesystem resources now

Posted by Matt Benson <gu...@yahoo.com>.
--- Stefan Bodewig <bo...@apache.org> wrote:
[SNIP]
> I've been in a train again yesterday and finished
> resource collection
> support for subant, apply, xslt and unzip/tar (untar

:) I had started working on apply but hadn't gotten
too far.  I'd like to see what you did.

> should actually
> work for arbitrary resources).  Now I only need to
> find an hour or so
> to rsync my stuff over and start commiting it ,,,

:( !!!

> 
> I added a new protected method to Expand for
> non-file resources, maybe
> an approach like that will work for other tasks as
> well.

I'll have to see it.

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



		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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


Re: my local version of supports filesystem resources now

Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 29 Sep 2005, Matt Benson <gu...@yahoo.com> wrote:
> --- Stefan Bodewig <bo...@apache.org> wrote:
>> On Wed, 28 Sep 2005, Matt Benson
>> <gu...@yahoo.com> wrote:
> [SNIP]
>> > Then we change the copy logic to call some form of
>> > FileUtils.copyResource().
>> 
>> ResourceUtils ...
>> 
> 
> I read this as: we should move all Resource references
> in FileUtils to ResourceUtils (making static as
> everything else there).

Yes.  Cryptic as it may have been, that was what I wanted to say.

Stefan

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


Re: my local version of supports filesystem resources now

Posted by Matt Benson <gu...@yahoo.com>.
--- Stefan Bodewig <bo...@apache.org> wrote:
> On Wed, 28 Sep 2005, Matt Benson
> <gu...@yahoo.com> wrote:
[SNIP]
> > Then we change the copy logic to call some form of
> > FileUtils.copyResource().
> 
> ResourceUtils ...
> 

I read this as: we should move all Resource references
in FileUtils to ResourceUtils (making static as
everything else there).  This makes sense, and won't
break any releases... shouldn't break anything else
either, hopefully.

-Matt

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



	
		
______________________________________________________ 
Yahoo! for Good 
Donate to the Hurricane Katrina relief effort. 
http://store.yahoo.com/redcross-donate3/ 


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


Re: my local version of supports filesystem resources now

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 28 Sep 2005, Matt Benson <gu...@yahoo.com> wrote:
> --- Stefan Bodewig <bo...@apache.org> wrote:
> 
>> On Tue, 27 Sep 2005, Matt Benson
>> <gu...@yahoo.com> wrote:
>> 
>> > I'd like to revisit this after your changes are
>> > committed.
>> 
>> Sure.
> 
> This was RE Copy/filesystem only.  I agree that move should work
> this way.  We don't know how to move non-file resources.  We do know
> how to copy non-file resources.  I would think we could also sync
> them...  but that would be later.

I agree, the way I patched sync should make any change to copy work
transparently for sync as well.

> Now, accepting that we have these protected ( >:( ) members to
> support, I suppose my chosen approach would be to duplicate the file
> maps as private resource maps w/ protected accessors.

Yes, something like this.  If you look into Expand and Untar I've done
something along those lines.  I kept the protected File based
signatures and added new ones for Resource which throws an exception
in Expand but works in Untar.

> Then we change the copy logic to call some form of
> FileUtils.copyResource().

ResourceUtils ...

> Holes?

No, should work.

Stefan

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


Re: my local version of supports filesystem resources now

Posted by Matt Benson <gu...@yahoo.com>.
--- Stefan Bodewig <bo...@apache.org> wrote:

> On Tue, 27 Sep 2005, Matt Benson
> <gu...@yahoo.com> wrote:
> 
> > I'd like to revisit this after your changes are
> > committed.
> 
> Sure.

This was RE Copy/filesystem only.  I agree that move
should work this way.  We don't know how to move
non-file resources.  We do know how to copy non-file
resources.  I would think we could also sync them...
but that would be later.  Now, accepting that we have
these protected ( >:( ) members to support, I suppose
my chosen approach would be to duplicate the file maps
as private resource maps w/ protected accessors. 
Remove the check for filesystem-only, replace in
validateAttributes ONLY as a call to:

protected void validate(ResourceCollection rc) {
    if (getClass().equals(Copy.class)
        || rc.isFilesystemOnly()) {
        return;
    }
    throw new BuildException(
        "Only filesystem resources are supported.");
    }
}

Subclasses can override this when appropriate.

Then we change the copy logic to call some form of
FileUtils.copyResource().

Holes?

-Matt


		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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


Re: my local version of supports filesystem resources now

Posted by Stefan Bodewig <bo...@apache.org>.
On Tue, 27 Sep 2005, Matt Benson <gu...@yahoo.com> wrote:

> I'd like to revisit this after your changes are
> committed.

Sure.

I've been in a train again yesterday and finished resource collection
support for subant, apply, xslt and unzip/tar (untar should actually
work for arbitrary resources).  Now I only need to find an hour or so
to rsync my stuff over and start commiting it ,,,

I added a new protected method to Expand for non-file resources, maybe
an approach like that will work for other tasks as well.

Stefan

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


Re: my local version of supports filesystem resources now

Posted by Matt Benson <gu...@yahoo.com>.
--- Stefan Bodewig <bo...@apache.org> wrote:

> Hi all,
> 
> I was offline for a week but had time to do some
> coding.  I finished
> resources support for <copy> and <batchtest> but
> don't have the time
> to commit it yet.  This is just a heads up so that
> Matt doesn't start
> to work on it (hope I'm not too late).

I had started more than once, actually, but have not
gotten that far yet.  My recent additions re
ResourceUtils were related.  I definitely appreciate
the help.
> 
> There've been several reasons to only support
> filesystem resources,
> supporting the old protected method signatures is
> one of them.

I'd like to revisit this after your changes are
committed.

Thanks again,
Matt
> 
> Stefan
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> dev-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> dev-help@ant.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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