On Tue, 2009-07-07 at 19:12 -0700, Alex Boisvert wrote: > On Tue, Jul 7, 2009 at 3:11 PM, Martin Grotzke <[email protected] > > wrote: > > > Thanx for the hint! It works, but to me it does not seem like a clean > > solution but rather like a workaround. For one thing my collegues would > > think that buildr needs hacks for such things, on the other hand I'd > > like to learn how to do this the "right" way :) > > > Another approach would be to mimic an existing idiom, e.g., > > compile.options.source = "1.5" > > using the following rough structure, > > module Buildr > module Eclipse > def eclipse > @eclipse || Eclipse.new > end > > class Eclipse > attr_reader :options > > def initialize > @options = Options.new > end > end > > class Options > attr_accessor :m2_repo_var > > def initialize > @m2_repo_var = 'M2_REPO' > end > end Ok, I added this.
> end > > # existing code elided > > include Eclipse The include Eclipse shall go into the same file and belongs to the "module Buildr"? The end of my eclipse.rb then looks like this: --------------------- end include Eclipse end # module Buildr class Buildr::Project include Buildr::Eclipse end --------------------- > end I changed writing the classpath entry from classpathentry.var m2_libs, 'M2_REPO', m2repo to classpathentry.var m2_libs, project.eclipse.options.m2_repo_var, m2repo However, now buildr eclipse no longer creates eclipse artifacts. Probably s.th. is wrong here? Thanx for your help, cheers, Martin > > > which would lead to this in your buildfile: > > eclipse.options.m2_repo_var = 'PROJ_REPO' > > alex
signature.asc
Description: This is a digitally signed message part
