You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by la...@sungard.com on 2006/05/19 14:40:15 UTC

Fileset

Hello I want to create an Zip file with the zip and fileset tasks. The
problem I'm having is that it puts all files in the root directory.

<?xml version="1.0" encoding="utf-8" ?> 
<project basedir="." default="all" name="name">
 
   <target name="dtCompass-dist"> 
        <zip destfile="Demo.zip">
			<fileset dir="..\..\..\program\bin"/ >
			<fileset dir="..\..\..\program2\bin"/>
f
			<fileset dir="..\bin"/>
			<fileset dir="dir1" />
			<fileset dir="dir2" />
			<fileset dir="test" />
		</zip>
   </target>
   
   <target name="all" depends="dtCompass-dist"/>
   
</project>

The files as said get's at the root of each of the filesets.

I instead would want the each of the included directories be an own
directory and under a other name. Something like this:

ZipFile:
<dir> program   - Removed the \bin as well and replaced it with program
name
<dir> program2  - Removed the \bin and replaced with program2 name
<dir> dir1
<dir> dir2
<dir> test


Is there a target for the fileset I can use or another task?

Lars



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


Re: Fileset

Posted by "Scot P. Floess" <fl...@mindspring.com>.
So, are u saying what you want is if a file is found in your file set, 
disregard the directory as part of the zip - and if its a directory, zip 
everything in the directory?

So, if your file set ended up being
/alpha/beta/foo.txt
/theta/epsilon/bar.txt
/here/there
/over/yonder

You'd want the zip file to contain
foo.txt
bar.txt
/here/there
/over/yonder



lars.mattsson@sungard.com wrote:
> Hello I want to create an Zip file with the zip and fileset tasks. The
> problem I'm having is that it puts all files in the root directory.
>
> <?xml version="1.0" encoding="utf-8" ?> 
> <project basedir="." default="all" name="name">
>  
>    <target name="dtCompass-dist"> 
>         <zip destfile="Demo.zip">
> 			<fileset dir="..\..\..\program\bin"/ >
> 			<fileset dir="..\..\..\program2\bin"/>
> f
> 			<fileset dir="..\bin"/>
> 			<fileset dir="dir1" />
> 			<fileset dir="dir2" />
> 			<fileset dir="test" />
> 		</zip>
>    </target>
>    
>    <target name="all" depends="dtCompass-dist"/>
>    
> </project>
>
> The files as said get's at the root of each of the filesets.
>
> I instead would want the each of the included directories be an own
> directory and under a other name. Something like this:
>
> ZipFile:
> <dir> program   - Removed the \bin as well and replaced it with program
> name
> <dir> program2  - Removed the \bin and replaced with program2 name
> <dir> dir1
> <dir> dir2
> <dir> test
>
>
> Is there a target for the fileset I can use or another task?
>
> Lars
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>   

-- 
Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate  http://sourceforge.net/projects/jplate
Chief Architect JavaPIM http://sourceforge.net/projects/javapim


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


Re: Fileset

Posted by Dominique Devienne <dd...@gmail.com>.
> The files as said get's at the root of each of the filesets.
>
> I instead would want the each of the included directories be an own
> directory and under a other name. Something like this:

Look into <zipfileset>, and its attribute (don't recall the name) to
specify the path into which to place the selected files within the zip
file. --DD

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