buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Schröder>
Subject AW: buildr + XMLBeans documentation?
Date Tue, 22 Dec 2009 20:22:47 GMT

i have some problem understanding the documentation of packaging:


You can also use :as=>'.' to include all files from the given directory. For example:

package(:zip).include 'target/docs/*'
package(:zip).include 'target/docs', :as=>'.'

These two are almost identical. They both include all the files from the target/docs directory,
but not the directory itself. But they operate differently. The first line expands to include
all the files in target/docs. If you don’t already have files in target/docs, well, then
it won’t do anything interesting. Your ZIP will come up empty. The second file includes
the directory itself, but strips the path during inclusion. You can define it now, create
these files later, and then ZIP them all up.


i couldnt figure out where there is a difference between the two definitions. 

this is what i thought should create zips with different content:

  # this selects all files currently available in the include-directory (and sub-directory)
  package(:file=>_(:target, '')).include('target/resources/*')
  # this selects the same but not at definition-time but at execution-time
  package(:file=>_(:target, '')).include('target/resources', :as=>'.')
  # extend the build-task to write some additional file
  build do
    write('target/resources/additional.txt', 'content')

feel free to bash on my naive approach ;-)

happy christmas to everyone
View raw message