Author: boisvert
Date: Wed Nov 18 23:06:49 2009
New Revision: 881989

URL: http://svn.apache.org/viewvc?rev=881989&view=rev
Log:
BUILDR-347 Compile.from does not work correctly with FileTask when no compiler
is set (Peter Schröder)

Modified:
    buildr/trunk/CHANGELOG
    buildr/trunk/lib/buildr/core/compile.rb
    buildr/trunk/spec/core/compile_spec.rb

Modified: buildr/trunk/CHANGELOG
URL: 
http://svn.apache.org/viewvc/buildr/trunk/CHANGELOG?rev=881989&r1=881988&r2=881989&view=diff
==============================================================================
--- buildr/trunk/CHANGELOG (original)
+++ buildr/trunk/CHANGELOG Wed Nov 18 23:06:49 2009
@@ -25,6 +25,8 @@
 * Fixed:  BUILDR-344 Buildr::TestFramework::TestResult::YamlFormatter uses 
           deprecated form of example_pending (Rhett Sutphin)
 * Fixed:  BUILDR-345 Improve project documentation (Peter Schröder)
+* Fixed:  BUILDR-347 Compile.from does not work correctly with FileTask when
+          no compiler is set (Peter Schröder)
 
 1.3.5 (2009-10-05)
 * Added:  Interactive shell (REPL) support

Modified: buildr/trunk/lib/buildr/core/compile.rb
URL: 
http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/compile.rb?rev=881989&r1=881988&r2=881989&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/compile.rb (original)
+++ buildr/trunk/lib/buildr/core/compile.rb Wed Nov 18 23:06:49 2009
@@ -264,7 +264,7 @@
     #   compile.from('src/java').into('classes').with('module1.jar')
     def from(*sources)
       @sources |= sources.flatten
-      guess_compiler if @compiler.nil? && sources.flatten.any? { |source| 
File.exist?(source) }
+      guess_compiler if @compiler.nil? && sources.flatten.any? { |source| 
File.exist?(source.to_s) }
       self
     end
 

Modified: buildr/trunk/spec/core/compile_spec.rb
URL: 
http://svn.apache.org/viewvc/buildr/trunk/spec/core/compile_spec.rb?rev=881989&r1=881988&r2=881989&view=diff
==============================================================================
--- buildr/trunk/spec/core/compile_spec.rb (original)
+++ buildr/trunk/spec/core/compile_spec.rb Wed Nov 18 23:06:49 2009
@@ -21,6 +21,14 @@
   def compile_task
     @compile_task ||= define('foo').compile.using(:javac)
   end
+  
+  def compile_task_without_compiler
+    @compile_task ||= define('foo').compile
+  end
+  
+  def file_task
+    @file_taks ||= define('bar').file('src')
+  end
 
   def sources
     @sources ||= ['Test1.java', 'Test2.java'].map { |f| 
File.join('src/main/java/thepackage', f) }.
@@ -47,6 +55,10 @@
     compile_task.from(sources).should be(compile_task)
   end
 
+  it 'should respond to from() with FileTask having no compiler set and return 
self' do
+    compile_task_without_compiler.from(file_task).should be(compile_task)
+  end
+
   it 'should respond to from() and add sources' do
     compile_task.from sources, File.dirname(sources.first)
     compile_task.sources.should == sources + [File.dirname(sources.first)]


Reply via email to