lib/java/eclipse.rb in buildr-1.2.3 vs lib/java/eclipse.rb in buildr-1.2.4

- old
+ new

@@ -17,12 +17,11 @@ root_path = lambda { |p| f = lambda { |p| p.parent ? f[p.parent] : p.base_dir } ; f[p] }[project] # We want the Eclipse files changed every time the Buildfile changes, but also anything loaded by # the Buildfile (buildr.rb, separate file listing dependencies, etc), so we add anything required # after the Buildfile. So which don't know where Buildr shows up exactly, ignore files that show # in $LOADED_FEATURES that we cannot resolve. - sources = ($LOADED_FEATURES - Buildr.instance_eval("@loaded_features_to_ignore")). - map { |file| File.expand_path(file) }.select { |file| File.exist?(file) } + sources = Buildr.build_files.map { |file| File.expand_path(file) }.select { |file| File.exist?(file) } sources << File.expand_path(Rake.application.rakefile, root_path) if Rake.application.rakefile # Only for projects that are Eclipse packagable. if project.packages.detect { |pkg| pkg.type.to_s =~ /(jar)|(war)|(rar)|(mar)|(aar)/ } eclipse.enhance [ file(project.path_to(".classpath")), file(project.path_to(".project")) ] @@ -33,10 +32,10 @@ # Find a path relative to the project's root directory. relative = lambda do |path| msg = [:to_path, :to_str, :to_s].find { |msg| path.respond_to? msg } path = path.__send__(msg) - Pathname.new(path).relative_path_from(Pathname.new(project.path_to)).to_s + Pathname.new(File.expand_path(path)).relative_path_from(Pathname.new(project.path_to)).to_s end m2repo = Buildr::Repositories.instance.local excludes = [ '**/.svn/', '**/CVS/' ].join('|')