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/07/28 19:15:18 UTC

svn commit: r680402 - in /incubator/buildr/trunk: CHANGELOG lib/buildr/packaging/artifact.rb spec/artifact_spec.rb

Author: assaf
Date: Mon Jul 28 10:15:17 2008
New Revision: 680402

URL: http://svn.apache.org/viewvc?rev=680402&view=rev
Log:
Changed: BUILDR-104 Buildr::group has :under and :version, but not :type.
Now it has :type too (Lacton).

Modified:
    incubator/buildr/trunk/CHANGELOG
    incubator/buildr/trunk/lib/buildr/packaging/artifact.rb
    incubator/buildr/trunk/spec/artifact_spec.rb

Modified: incubator/buildr/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/CHANGELOG?rev=680402&r1=680401&r2=680402&view=diff
==============================================================================
--- incubator/buildr/trunk/CHANGELOG (original)
+++ incubator/buildr/trunk/CHANGELOG Mon Jul 28 10:15:17 2008
@@ -3,6 +3,8 @@
 * Changed: Error reporting now shows 'buildr aborted!' (used to say rake),
 more of the stack trace without running --trace, and when running with
 supported terminal, error message is red.
+* Changed: BUILDR-104 Buildr::group has :under and :version, but not :type.
+Now it has :type too (Lacton).
 * Fixed: BUILDR-106 download(artifact(...)=>url) broken in certain cases
 (Lacton).
 

Modified: incubator/buildr/trunk/lib/buildr/packaging/artifact.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/buildr/packaging/artifact.rb?rev=680402&r1=680401&r2=680402&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/buildr/packaging/artifact.rb (original)
+++ incubator/buildr/trunk/lib/buildr/packaging/artifact.rb Mon Jul 28 10:15:17 2008
@@ -671,10 +671,11 @@
   # :call-seq:
   #   group(ids, :under=>group_name, :version=>number) => artifacts
   #
-  # Convenience method for defining multiple artifacts that belong to the same group and version.
-  # Accepts multiple artifact identifiers follows by two hash values:
+  # Convenience method for defining multiple artifacts that belong to the same group, type and version.
+  # Accepts multiple artifact identifiers followed by two or three hash values:
   # * :under -- The group identifier
   # * :version -- The version number
+  # * :type -- The artifact type (optional)
   #
   # For example:
   #   group 'xbean', 'xbean_xpath', 'xmlpublic', :under=>'xmlbeans', :version=>'2.1.0'
@@ -682,7 +683,7 @@
   #   group %w{xbean xbean_xpath xmlpublic}, :under=>'xmlbeans', :version=>'2.1.0'
   def group(*args)
     hash = args.pop
-    args.flatten.map { |id| artifact :group=>hash[:under], :version=>hash[:version], :id=>id }
+    args.flatten.map { |id| artifact :group=>hash[:under], :type=>hash[:type], :version=>hash[:version], :id=>id }
   end 
 
   # :call-seq:

Modified: incubator/buildr/trunk/spec/artifact_spec.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/artifact_spec.rb?rev=680402&r1=680401&r2=680402&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/artifact_spec.rb (original)
+++ incubator/buildr/trunk/spec/artifact_spec.rb Mon Jul 28 10:15:17 2008
@@ -503,9 +503,16 @@
     list.should include(artifact('saxon:saxon-xpath:jar:8.4'))
     list.size.should be(3)
   end
+  
+  it 'should accept a type' do
+    list = group('struts-bean', 'struts-html', :under=>'struts', :type=>'tld', :version=>'1.1')
+    list.should include(artifact('struts:struts-bean:tld:1.1'))
+    list.should include(artifact('struts:struts-html:tld:1.1'))
+    list.size.should be(2)
+  end
+  
 end
 
-
 describe Builder, '#install' do
   before do
     @spec = 'group:id:jar:1.0'