You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by bo...@apache.org on 2008/08/22 23:03:26 UTC

svn commit: r688192 - in /incubator/buildr/trunk: lib/buildr/ide/eclipse.rb spec/eclipse_spec.rb

Author: boisvert
Date: Fri Aug 22 14:03:26 2008
New Revision: 688192

URL: http://svn.apache.org/viewvc?rev=688192&view=rev
Log:
BUILDR-122: eclipse task should not check for directory existence

Modified:
    incubator/buildr/trunk/lib/buildr/ide/eclipse.rb
    incubator/buildr/trunk/spec/eclipse_spec.rb

Modified: incubator/buildr/trunk/lib/buildr/ide/eclipse.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/buildr/ide/eclipse.rb?rev=688192&r1=688191&r2=688192&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/buildr/ide/eclipse.rb (original)
+++ incubator/buildr/trunk/lib/buildr/ide/eclipse.rb Fri Aug 22 14:03:26 2008
@@ -93,9 +93,7 @@
               srcs = (project.compile.sources + generated + project.resources.sources).map { |src| relative[src] }
 
               srcs.sort.uniq.each do |path|
-                if File.exist? project.path_to(path)
-                  xml.classpathentry :kind=>'src', :path=>path, :excluding=>excludes
-                end
+                xml.classpathentry :kind=>'src', :path=>path, :excluding=>excludes
               end
 
               if project.test.compile.target
@@ -110,9 +108,7 @@
                 # Test resources go in separate output directory as well
                 test_resource_sources = project.test.resources.sources.map { |src| relative[src] }
                 test_resource_sources.each do |path|
-                  if File.exist? project.path_to(path)
-                    xml.classpathentry :kind=>'src', :path=>path, :output => relative[project.test.compile.target], :excluding=>excludes
-                  end
+                  xml.classpathentry :kind=>'src', :path=>path, :output => relative[project.test.compile.target], :excluding=>excludes
                 end
               end
 

Modified: incubator/buildr/trunk/spec/eclipse_spec.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/eclipse_spec.rb?rev=688192&r1=688191&r2=688192&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/eclipse_spec.rb (original)
+++ incubator/buildr/trunk/spec/eclipse_spec.rb Fri Aug 22 14:03:26 2008
@@ -16,6 +16,16 @@
 
 require File.join(File.dirname(__FILE__), 'spec_helpers')
 
+
+module EclipseHelper
+  def classpath_sources attribute='path'
+    task('eclipse').invoke
+    REXML::Document.new(File.open('.classpath')).
+      root.elements.collect("classpathentry[@kind='src']") { |n| n.attributes[attribute] }
+  end
+end
+
+
 describe Buildr::Eclipse do
 
   describe "eclipse's .project file" do
@@ -87,6 +97,7 @@
     end
     
     describe 'source folders' do
+       include EclipseHelper
       
       def classpath_sources attribute='path'
         task('eclipse').invoke
@@ -111,6 +122,11 @@
         classpath_sources.should include('src/java')
       end
       
+      it 'should accept a file task as a main source folder' do
+        define('foo') { compile apt }
+        classpath_sources.should include('target/generated/apt')
+      end
+      
       it 'should accept a default test source folder' do
         define('foo')
         classpath_sources.should include('src/test/java')