• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

What is the problem with this build file?

 
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Given



and the command line ant zip, I expect to get a \zip folder containing the contents of \dist. That is, I thought I would get a zip file containing \monkeys\monkey.class. Instead I got

[zip] Warning: skipping zip archive C:\antwork\ex\zip\animals.zip because no files were included.



I suppose there must be something wrong with my pattern, but it looks fine to me. What is the problem?





 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
basedir is "." and includes is "${dist}/**/*.*" = "./dist/**/*.*", which means that the task will look for files under "././dist/**/*.*". This won't work. Instead, I think you should tell the task that the basedir is ${dist} :
 
Thomas Kennedy
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bad:

basedir="."
includes="${dist}/**/*.*"


Good:

basedir="${dist}"
includes="**/*.*"


The manual says that basedir is the directory from which to zip the files. At first I thought that meant it was some kind of temporary working directory. But reading it again I thought it meant that was to be the root of the zip file.

So, becuase I wanted to zip up ${dist}/monkey/monkey.class and whatever else lay inside ${dist}, I set basedir to ${dist} and took ${dist} out of the pattern. Fixed!
 
reply
    Bookmark Topic Watch Topic
  • New Topic