Author: toulmean
Date: Thu Jul  8 02:39:18 2010
New Revision: 961561

URL: http://svn.apache.org/viewvc?rev=961561&view=rev
Log:
fix for BUILDR-203

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

Modified: buildr/trunk/CHANGELOG
URL: 
http://svn.apache.org/viewvc/buildr/trunk/CHANGELOG?rev=961561&r1=961560&r2=961561&view=diff
==============================================================================
--- buildr/trunk/CHANGELOG (original)
+++ buildr/trunk/CHANGELOG Thu Jul  8 02:39:18 2010
@@ -3,6 +3,7 @@
 * Fixed: BUILDR-256 Automatically installing gems aborts rspec test runner 
(Rhett Sutphin)
 * Fixed: BUILDR-342 The jruby gem installer invokes the removed 
Gem.manage_gems function (Rhett Sutphin)
 * Fixed: BUILDR-464 Improve the versioning of Buildr (Rhett Sutphin)
+* Fixed: BUILDR-203 Compiler guessing very inefficient
 
 1.4.1 (2010-07-07)
 * Added:  BUILDR-420 Support external compiler

Modified: buildr/trunk/lib/buildr/core/compile.rb
URL: 
http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/compile.rb?rev=961561&r1=961560&r2=961561&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/compile.rb (original)
+++ buildr/trunk/lib/buildr/core/compile.rb Thu Jul  8 02:39:18 2010
@@ -91,7 +91,15 @@ module Buildr
           paths = task.sources + [sources].flatten.map { |src| 
Array(project.path_to(:source, task.usage, src.to_sym)) }
           paths.flatten!
           ext_glob = Array(source_ext).join(',')
-          paths.any? { |path| !Dir["#{path}/**/*.{#{ext_glob}}"].empty? }
+          
+          paths.each { |path| 
+            Find.find(path) {|found|
+              if (!File.directory?(found)) && 
found.match(/.*\.#{Array(source_ext).join('|')}/)
+                return true
+              end
+              } if File.exist? path
+            }
+          false
         end
 
         # Implementations can use this method to specify various compiler 
attributes.


Reply via email to