You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by do...@apache.org on 2013/10/11 10:54:01 UTC

svn commit: r1531232 - in /buildr/trunk: CHANGELOG lib/buildr/core/compile.rb spec/java/compiler_spec.rb

Author: donaldp
Date: Fri Oct 11 08:54:01 2013
New Revision: 1531232

URL: http://svn.apache.org/r1531232
Log:
BUILDR-609 - compile.from should accept Task argument.

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

Modified: buildr/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/buildr/trunk/CHANGELOG?rev=1531232&r1=1531231&r2=1531232&view=diff
==============================================================================
--- buildr/trunk/CHANGELOG (original)
+++ buildr/trunk/CHANGELOG Fri Oct 11 08:54:01 2013
@@ -1,3 +1,6 @@
+1.4.15 (Pending)
+* Fixed:  BUILDR-609 - compile.from should accept Task argument.
+
 1.4.14 (2013-10-11)
 * Change: Remove highline dependency.
 * Fixed:  BUILDR-682 - Fix the documentation for releasing using

Modified: buildr/trunk/lib/buildr/core/compile.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/compile.rb?rev=1531232&r1=1531231&r2=1531232&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/compile.rb (original)
+++ buildr/trunk/lib/buildr/core/compile.rb Fri Oct 11 08:54:01 2013
@@ -92,7 +92,7 @@ module Buildr #:nodoc:
               if (!File.directory?(found)) && found.match(/.*\.#{Array(source_ext).join('|')}/)
                 return true
               end
-              } if File.exist? path
+              } if File.exist? path.to_s
             }
           false
         end

Modified: buildr/trunk/spec/java/compiler_spec.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/java/compiler_spec.rb?rev=1531232&r1=1531231&r2=1531232&view=diff
==============================================================================
--- buildr/trunk/spec/java/compiler_spec.rb (original)
+++ buildr/trunk/spec/java/compiler_spec.rb Fri Oct 11 08:54:01 2013
@@ -61,6 +61,22 @@ describe 'javac compiler' do
     end
   end
 
+  it 'should accept a task to compile from' do
+    p = define 'foo' do
+      project.version = '1'
+      f = file(_(:target, :generated, 'myjava')) do
+        mkdir_p _(:target, :generated, 'myjava')
+        File.open("#{_(:target, :generated, 'myjava')}/Foo.java", "wb") do |f|
+          f.write "public class Foo {}"
+        end
+      end
+
+      compile.from(f)
+      package(:jar)
+    end.compile.invoke
+    file('target/classes/Foo.class').should exist
+  end
+
   it 'should not change existing list of sources' do
     define 'foo' do
       compile.from('sources')