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 2010/03/05 06:27:26 UTC

svn commit: r919295 - in /buildr/trunk/lib/buildr: packaging/artifact_namespace.rb scala/compiler.rb scala/tests.rb

Author: boisvert
Date: Fri Mar  5 05:27:26 2010
New Revision: 919295

URL: http://svn.apache.org/viewvc?rev=919295&view=rev
Log:
BUILDR-395: artifact_namespace documentation contains some spelling errors
(Pepijn Van Eeckhoudt)

Modified:
    buildr/trunk/lib/buildr/packaging/artifact_namespace.rb
    buildr/trunk/lib/buildr/scala/compiler.rb
    buildr/trunk/lib/buildr/scala/tests.rb

Modified: buildr/trunk/lib/buildr/packaging/artifact_namespace.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/packaging/artifact_namespace.rb?rev=919295&r1=919294&r2=919295&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/packaging/artifact_namespace.rb (original)
+++ buildr/trunk/lib/buildr/packaging/artifact_namespace.rb Fri Mar  5 05:27:26 2010
@@ -31,13 +31,13 @@
   # The method_missing method for instances provides some syntactic sugar to these.
   # See the following examples, and the methods for ArtifactRequirement.
   #
-  # = Avoiding constant polution on buildfile
+  # = Avoiding constant pollution on buildfile
   #
   # Each project has its own ArtifactNamespace inheriting the one from the
   # parent project up to the root namespace.
   #
   # Consider the following snippet, as project grows, each subproject
-  # may need diferent artifact combinations and/or versions. Asigning
+  # may need different artifact combinations and/or versions. Assigning
   # artifact specifications to constants can make it painful to maintain
   # their references even if using structs/hashes.
   #
@@ -67,7 +67,7 @@
   #
   # With ArtifactNamespace you can do some more advanced stuff, the following
   # annotated snipped could still be reduced if default artifact definitions were
-  # loaded from yaml file (see section bellow and ArtifactNamespace.load).
+  # loaded from yaml file (see section below and ArtifactNamespace.load).
   #
   #   -- buildfile --
   #   artifact_ns do |ns| # the current namespace (root if called outside a project)
@@ -136,8 +136,8 @@
   # issues. Another example would be to select the groovy version to use on all our
   # projects so that Buildr modules requiring groovy jars can use user prefered versions.
   #
-  # To meet this goal, an ArtifactNamespace allows to specify ArgumentRequirement objects.
-  # In fact the only diference with the examples you have already seen is that requirements
+  # To meet this goal, an ArtifactNamespace allows to specify ArtifactRequirement objects.
+  # In fact the only difference with the examples you have already seen is that requirements
   # have an associated VersionRequirement, so that each time a user tries to select a version,
   # buildr checks if it satisfies the requirements.
   #

Modified: buildr/trunk/lib/buildr/scala/compiler.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/scala/compiler.rb?rev=919295&r1=919294&r2=919295&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/scala/compiler.rb (original)
+++ buildr/trunk/lib/buildr/scala/compiler.rb Fri Mar  5 05:27:26 2010
@@ -24,8 +24,7 @@
   class << self
 
     # Retrieves the Scala version string from the
-    # standard library or nil if Scala is not
-    # available.
+    # standard library or nil if Scala is not available.
     def version_str
       begin
         # Scala version string normally looks like "version 2.7.3.final"
@@ -36,7 +35,9 @@
     end
 
     def version
-      if version_str
+      if Buildr.settings.build['scala.version']
+        Buildr.settings.build['scala.version']
+      elsif version_str
         # any consecutive sequence of numbers followed by dots
         match = version_str.match(/\d+\.\d[\d\.]*/) or
           fail "Unable to parse Scala version: #{version_str} "
@@ -69,8 +70,9 @@
     # namespace before this file is required.  This is of course, only
     # if SCALA_HOME is not set or invalid.
     REQUIRES = ArtifactNamespace.for(self) do |ns|
-      ns.library!      'org.scala-lang:scala-library:jar:>=' + DEFAULT_VERSION
-      ns.compiler!     'org.scala-lang:scala-compiler:jar:>=' + DEFAULT_VERSION
+      version = Buildr.settings.build['scala.check'] || DEFAULT_VERSION
+      ns.library!      'org.scala-lang:scala-library:jar:>=' + version
+      ns.compiler!     'org.scala-lang:scala-compiler:jar:>=' + version
     end
 
     class << self

Modified: buildr/trunk/lib/buildr/scala/tests.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/scala/tests.rb?rev=919295&r1=919294&r2=919295&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/scala/tests.rb (original)
+++ buildr/trunk/lib/buildr/scala/tests.rb Fri Mar  5 05:27:26 2010
@@ -24,15 +24,19 @@
   # Scala::Check is available when using Scala::Test or Scala::Specs
   module Check
     VERSION = '1.5'
-    
+
     class << self
       def version
         Buildr.settings.build['scala.check'] || VERSION
       end
-      
+
+      def classifier
+        Buildr.settings.build['scala.check.classifier'] || ""
+      end
+
       def dependencies
-        ["org.scala-tools.testing:scalacheck:jar:#{version}"]
-      end  
+        ["org.scala-tools.testing:scalacheck:jar:#{classifier}:#{version}"]
+      end
 
     private
       def const_missing(const)
@@ -42,8 +46,8 @@
       end
     end
   end
-  
-  
+
+
   # ScalaTest framework, the default test framework for Scala tests.
   #
   # Support the following options:
@@ -58,30 +62,30 @@
       def version
         Buildr.settings.build['scala.test'] || VERSION
       end
-      
+
       def dependencies
-        ["org.scalatest:scalatest:jar:#{version}"] + Check.dependencies + 
+        ["org.scalatest:scalatest:jar:#{version}"] + Check.dependencies +
           JMock.dependencies + JUnit.dependencies
-      end  
+      end
 
       def applies_to?(project) #:nodoc:
         !Dir[project.path_to(:source, :test, :scala, '**/*.scala')].empty?
-      end 
-      
+      end
+
     private
       def const_missing(const)
         return super unless const == :REQUIRES # TODO: remove in 1.5
         Buildr.application.deprecated "Please use Scala::Test.dependencies/.version instead of ScalaTest::REQUIRES/VERSION"
         dependencies
       end
-    end          
+    end
 
     # annotation-based group inclusion
     attr_accessor :group_includes
-    
+
     # annotation-based group exclusion
     attr_accessor :group_excludes
-    
+
     def initialize(test_task, options)
       super
       @group_includes = []
@@ -115,11 +119,11 @@
             (options[:properties] || []).each { |name, value| ant.config :name=>name, :value=>value }
           end
         end
-        
+
         # Parse for failures, errors, etc.
         # This is a bit of a pain right now because ScalaTest doesn't flush its
-        # output synchronously before the Ant test finishes so we have to loop 
-        # and wait for an indication that the test run was completed. 
+        # output synchronously before the Ant test finishes so we have to loop
+        # and wait for an indication that the test run was completed.
         failed = false
         completed = false
         wait = 0
@@ -132,19 +136,19 @@
             end
           end
           wait += 1
-          break if (failed || wait > 10) 
+          break if (failed || wait > 10)
           unless completed
             sleep(1)
           end
         end
         success << suite if (completed && !failed)
       end
-      
+
       success
     end # run
 
   end # ScalaTest
-  
+
 end