buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "rp.andrew.moore" <rp.andrew.mo...@gmail.com>
Subject Re: Using Include/Exclude when Packaging Jars
Date Wed, 10 Sep 2008 15:33:50 GMT

Yep, that's it! Thanks for your help...

~ Andrew


lacton wrote:
> 
> Hi,
> 
> I think what your looking for is the 'clean' method.
> 
> From http://incubator.apache.org/buildr/packaging.html
> 
> 
> 
>> Other than that, package :jar includes the contents of the compiler's
>> target directory and resources, which most often is exactly what you
>> intend it to do. If you want to include other files in the JAR,
>> instead or in addition, you can do so using the include and exclude
>> methods. If you do not want the target directory included in your JAR,
>> simply call the clean method on it:
>> 
>> package(:jar).clean.include( only_these_files )
>> 
> 
> In your case, that would mean writing
> 
> foo_jar=_('target/foo.jar')
> package(:jar, :file=>foo_jar).clean.include('**/Foo*.class')
> 
> Lacton
> 
> On Tue, Sep 9, 2008 at 10:37 PM, rp.andrew.moore
> <rp.andrew.moore@gmail.com> wrote:
>>
>>
>>
>> rp.andrew.moore wrote:
>>>
>>> Hi, I'm relatively new to ruby and buildr, but I'm running into some
>>> trouble when including or excluding class files for a jar.
>>>
>>> I'm building two jars from the same sub project... one jar has all but a
>>> couple class files, while the other jar needs to exclude all but a
>>> couple
>>> class files.
>>>
>>> It seems like this does what I expect when excluding a few files:
>>>
>>>     package(:jar).exclude('**/Foo*.class')
>>>
>>>
>>
>> I forgot to mention that the result of running the exclude like this is
>> that
>> I get a jar with all the class files that don't start with "Foo". Which
>> is
>> what I expect. It is the "include" part that doesn't behave as I
>> expected.
>>
>> Thanks again for your help.
>>
>> ~ Andrew
>> --
>> View this message in context:
>> http://n2.nabble.com/Using-Include-Exclude-when-Packaging-Jars-tp1078513p1078516.html
>> Sent from the Apache Buildr - User mailing list archive at Nabble.com.
> 
> 

-- 
View this message in context: http://n2.nabble.com/Using-Include-Exclude-when-Packaging-Jars-tp1078513p1080235.html
Sent from the Apache Buildr - User mailing list archive at Nabble.com.


Mime
View raw message