I personally always used a constant with the list of dependencies to
package and .include it :)

Is there a better way? It sounds like there is a way to get it done
automatically...
Marc-André LAVERDIÈRE
"Perseverance must finish its work so that you may be mature and complete,
not lacking anything." -James 1:4
http://asimplediscipleslife.blogspot.com/
mlaverd.theunixplace.com





On Sat, Jul 9, 2011 at 9:05 AM, Allen Riddle <[email protected]> wrote:
> The way I've handled this is to create an assembler sub-project that
> iterates over the projects and includes them.  There might be a slicker way,
> but below is essentially what I've done:
>
> define 'eds-assembler' do
>
>  zip_package = package(:zip, :id => 'your-zip.zip)
>
>  projects('eds-client', 'eds-core').each do |p|
>    zip_package.include([p] + p.compile.dependencies), :path => "libs")
>  end
>
> end
>
> On Fri, Jul 8, 2011 at 4:51 PM, Chris Adams <[email protected]>wrote:
>
>> Hi,
>>
>>
>>
>> Please forgive my ignorance, as I am knew to Buildr and having a
>> difficult time figuring out some of the concepts.
>>
>> What I am trying to do is create a zip file that contains all of my
>> applications jar files and the dependent libraries (compile and runtime
>> dependencies). Right now, I have only have 1 sub-project (eds-core) but
>> ultimately there will be many sub-projects that all will have their own
>> set of dependencies and need to get packaged into a single zip file.
>>
>>
>>
>> I'm assuming there's a way to do this without having to duplicate each
>> dependency in the zip package project?
>>
>>
>>
>> Any help is greatly appreciated!
>>
>>
>>
>> Sincerely,
>>
>> Chris Adams
>>
>>
>>
>> Below is my very basic build file I have right now:
>>
>> VERSION_NUMBER = '1.0'
>>
>>
>>
>> repositories.remote << 'http://www.ibiblio.org/maven2'
>>
>> repositories.remote << 'http://repo1.maven.org/maven2'
>>
>>
>>
>> #Define our dependencies
>>
>> LOG4J = 'log4j:log4j:jar:1.2.15'
>>
>> DATABASE = struct(
>>
>>  :pool => 'com.jolbox:bonecp:jar:0.7.1.RELEASE',
>>
>>  :driver => 'mysql:mysql-connector-java:jar:5.1.17'
>>
>> )
>>
>> JAVAMAIL = 'javax.mail:mail:jar:1.4.1'
>>
>>
>>
>> desc 'EDS Analyst Build Project'
>>
>> define 'eds-analyst' do
>>
>>  project.version = VERSION_NUMBER
>>
>>  project.group = 'edatasource'
>>
>>
>>
>>  compile.options.target = '1.6'
>>
>>  manifest['Copyright'] = 'eDataSource (c) 2011'
>>
>>
>>
>>  desc 'The core libraries shared across all the projects'
>>
>>  define 'eds-core' do
>>
>>    compile.with LOG4J, transitive(JAVAMAIL), transitive(DATABASE.pool)
>>
>>    package(:jar)
>>
>>  end
>>
>>
>>
>>  desc 'Packages up the ea-client'
>>
>>  define 'eds-client' do
>>
>>    compile.with project('eds-core').package(:jar)
>>
>>    package(:zip)
>>
>>  end
>>
>> end
>>
>>
>

Reply via email to