ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremy Nix" <Jeremy....@sfsltd.com>
Subject RE: Need help including empty directories in WAR task (or Zip/JAR/TAR)
Date Tue, 09 Dec 2003 13:43:31 GMT
Stefan, you brought up an interesting point that I may have to consider.
Notice that you touched a file (which creates a file) in the empty
directory.  The directory now has contents, thus is included in the
fileset.  When you remove that touch command, all directories are empty
(without files), and the war command contains nothing but the web.xml
that you specified.  Is that my only option to include empty
directories...that is, create a dummy file in them so that they aren't
actually empty?


_________________________________
Jeremy Nix
Southwest Financial Services, LTD.
Jeremy.Nix@sfsltd.com
(513) 621-6699 ext.1158



-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@apache.org] 
Sent: Tuesday, December 09, 2003 3:04 AM
To: dev@ant.apache.org
Subject: Re: Need help including empty directories in WAR task (or
Zip/JAR/TAR)


On Mon, 8 Dec 2003, Jeremy Nix <Jeremy.Nix@sfsltd.com> wrote:

> I've been trying to figure out how to include an empty directory into 
> a fileset based task for months now.

I've kept all (now four) of your messages on this subject in order to
look into it.  Sorry, somehow I never manage to get far enough down on
my TODO list.  I know that it works for me.

OK:

[bodewig@bodewig bodewig]$ cat /tmp/war.xml 
<project>
  <mkdir dir="test-setup/a/b/c"/>
  <mkdir dir="test-setup/d"/>
  <touch file="test-setup/a/b/c/e"/>
  <war destfile="test.war" webxml="${ant.file}">
    <fileset dir="test-setup"/>
  </war>
</project>
[bodewig@bodewig bodewig]$ ant -f /tmp/war.xml 
Buildfile: /tmp/war.xml
    [mkdir] Created dir: /tmp/test-setup/a/b/c
    [mkdir] Created dir: /tmp/test-setup/d
    [touch] Creating /tmp/test-setup/a/b/c/e
      [war] Building war: /tmp/test.war

BUILD SUCCESSFUL
Total time: 2 seconds
[bodewig@bodewig bodewig]$ zip -Tv /tmp/test.war 
Archive:  /tmp/test.war
    testing: META-INF/                OK
    testing: META-INF/MANIFEST.MF     OK
    testing: a/                       OK
    testing: a/b/                     OK
    testing: a/b/c/                   OK
    testing: d/                       OK
    testing: a/b/c/e                  OK
    testing: WEB-INF/                 OK
    testing: WEB-INF/web.xml          OK
No errors detected in compressed data of /tmp/test.war.
test of /tmp/test.war OK

You see, d is included even though it is empty.  This is Ant 1.6,
though.

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


Mime
View raw message