You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by ji...@yahoo.com on 2007/10/17 04:16:16 UTC

Re-parenting classpath

Hopefully, someone can point me in the right direction. What I'd like to do is re-parent the elements of a classpath entry in an Ant build script (from netbeans). For example, given classpath property like:

Setting project property: run.test.classpath -> 
../lib/a.jar:../lib/dir1/b.jar:../lib/dir2/c.jar:build/classes:build/test/classes

I'd like to zip up the classpath components from their current locations, but then re-parent them within the zip file so that they get extracted to the following layout:

a.jar
b.jar
c.jar
classes

The jar file names should be unique, so I'm not too worried about name clashes with the jar files. Being new to Ant I don't see an easy way to get this done with the existing Ant tasks (pathconvert, basename, zip, etc.). So, I'm hoping someone can tell if it can be done (and how) or if there's some custom Ant task that already handles this functionality.

TIA


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


Re: Re-parenting classpath

Posted by Dominique Devienne <dd...@gmail.com>.
On 10/16/07, jiniusatwork-antuser@yahoo.com
<ji...@yahoo.com> wrote:
> Hopefully, someone can point me in the right direction. What I'd like to do is re-parent the elements of a classpath entry in an Ant build script (from netbeans). For example, given classpath property like:
>
> Setting project property: run.test.classpath ->
> ../lib/a.jar:../lib/dir1/b.jar:../lib/dir2/c.jar:build/classes:build/test/classes
>
> I'd like to zip up the classpath components from their current locations, but then re-parent them within the zip file so that they get extracted to the following layout:
>
> a.jar
> b.jar
> c.jar
> classes
>
> The jar file names should be unique, so I'm not too worried about name clashes with the jar files. Being new to Ant I don't see an easy way to get this done with the existing Ant tasks (pathconvert, basename, zip, etc.). So, I'm hoping someone can tell if it can be done (and how) or if there's some custom Ant task that already handles this functionality.

<manifestclasspath> can do that, indirectly. You're not saying why the
re-parenting, but the only use-case I know of is having a in-manifest
relative CP in a jar, which is the purpose of this task. You only get
a string out of it though, which may not be what you need. Hard to say
though given your post. --DD

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