buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mat Schaffer <...@schaffer.me>
Subject Re: Generating eclipse files for non-maven dependencies
Date Mon, 14 Sep 2009 03:01:09 GMT

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.

Thanks,
Mat
Mime
View raw message