You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by as...@apache.org on 2008/01/28 19:48:44 UTC

svn commit: r615988 - /incubator/buildr/trunk/lib/core/compile.rb

Author: assaf
Date: Mon Jan 28 10:48:43 2008
New Revision: 615988

URL: http://svn.apache.org/viewvc?rev=615988&view=rev
Log:
Added compiler dependencies

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

Modified: incubator/buildr/trunk/lib/core/compile.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/core/compile.rb?rev=615988&r1=615987&r2=615988&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/core/compile.rb (original)
+++ incubator/buildr/trunk/lib/core/compile.rb Mon Jan 28 10:48:43 2008
@@ -77,6 +77,13 @@
           attrs.each { |name, value| instance_variable_set("@#{name}", value) }
         end
 
+        # Returns additional dependencies required by this language.  For example, since the
+        # test framework picks on these, you can use the JUnit framework with Scala.
+        # Defaults to obtaining a list of artifact specifications from the REQUIRES constant.
+        def dependencies
+          @dependencies ||= FileList[*(const_get('REQUIRES') rescue [])]
+        end
+
       end
 
       # Construct a new compiler with the specified options.  Note that options may
@@ -105,6 +112,12 @@
         raise 'Not implemented'
       end
 
+      # Returns additional dependencies required by this language.  For example, since the
+      # test framework picks on these, you can use the JUnit framework with Scala.
+      def dependencies
+        self.class.dependencies
+      end
+
     private
 
       # Use this to complain about CompileTask options not supported by this compiler.
@@ -320,6 +333,7 @@
       from Array(cls.sources).map { |path| @project.path_to(:source, @usage, path) }.
         select { |path| File.exist?(path) } if sources.empty?
       into @project.path_to(:target, @usage, cls.target) unless target
+      with @compiler.dependencies
       self
     end