buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Boisvert <boisv...@intalio.com>
Subject Re: Generating eclipse files for non-maven dependencies
Date Mon, 14 Sep 2009 05:14:37 GMT
On Sun, Sep 13, 2009 at 8:01 PM, Mat Schaffer <mat@schaffer.me> wrote:

>
> On Sep 13, 2009, at 8:39 PM, Mat Schaffer wrote:
>
>  I'm working on redcar and we have a handful of dependencies that I don't
>> think are available from maven. Specifically the latest versions of the SWT
>> suite and accompanying platform-dependent jars.
>>
>> We have them in a lib folder in the project at the moment, and it builds
>> fine, but when I try to use buildr, it assumes that they should be source
>> dependencies rather than lib dependencies.
>>
>> The problem seems to be this line in eclipse.rb:
>>
>>             # Generated: classpath elements in the project are assumed to
>> be generated
>>             generated, libs = others.partition { |path|
>> path.to_s.index(project.path_to.to_s) == 0 }
>>
>> If I change it to this, it works much better:
>>
>>             # Generated: classpath elements in the project are assumed to
>> be generated
>>             generated, libs = others.partition { |path|
>> path.to_s.index(project.path_to.to_s) == 0 && path.to_s !~ /\.jar\Z/}
>>
>> But it feels hackish it'd be an ugly monkey-patch since I'd have to
>> rewrite a fairly large function. Once I get through all the dependencies and
>> get the eclipse_spec.rb running I'll see if I can come up with something
>> nicer.
>>
>> Does anyone have any advice on this one? I'd rather not have to set up a
>> maven repository just for our project.
>>
>> The code is up on http://github.com/matschaffer/java-mateview/tree/buildr if
>> it helps as a reference.
>>
>> Thanks in advance for the help. Definitely love what I've seen of buildr
>> so far!
>> -Mat
>>
>
> Hope it's not faux pas to pick up on my own post, but I ended up finding a
> monkey patch that wasn't too terrible and seems to work:
> http://gist.github.com/186465
>
> I'd love to get some feedback on this so I could maybe update the
> eclipse_spec.rb and eclipse.rb in buildr. But I can't find anything in the
> svn log or spec that demonstrates the intention of the generated/libs
> separation mentioned above so it's hard to code to. The eclipse spec still
> passes even with the notion of "generated" totally removed.
>

'generated' refers to classes that may be generated from source (e.g.
xmlbeans) prior to compilation.

checking for .jar (your prior patch) or checking for a file (your new file)
seem to be equivalent and both are better, as far as I can tell.

if you want to clean this up and submit a patch, i'll be happy to apply
it.   i'll add a spec for the generated case at the same time.

thanks for your persistence... i should have picked up on this earlier.

alex

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message