You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by vb...@apache.org on 2008/02/18 07:39:29 UTC

svn commit: r628632 - /incubator/buildr/trunk/lib/tasks/zip.rb

Author: vborja
Date: Sun Feb 17 22:39:27 2008
New Revision: 628632

URL: http://svn.apache.org/viewvc?rev=628632&view=rev
Log:
BUILDR-47 ArchiveTask#clean

Modified:
    incubator/buildr/trunk/lib/tasks/zip.rb

Modified: incubator/buildr/trunk/lib/tasks/zip.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/tasks/zip.rb?rev=628632&r1=628631&r2=628632&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/tasks/zip.rb (original)
+++ incubator/buildr/trunk/lib/tasks/zip.rb Sun Feb 17 22:39:27 2008
@@ -202,8 +202,7 @@
 
     def initialize(*args) #:nodoc:
       super
-      @paths = { ''=>Path.new(self, '') }
-      @prepares = []
+      clean
 
       # Make sure we're the last enhancements, so other enhancements can add content.
       enhance do
@@ -227,6 +226,22 @@
           end
         end
       end
+    end
+
+    # :call-seq:
+    #   clean => self
+    # 
+    # Removes all previously added content from this archive. 
+    # Use this method if you want to remove default content from a package.
+    # For example, package(:jar) by default includes compiled classes and resources,
+    # using this method, you can create an empty jar and afterwards add the
+    # desired content to it.
+    # 
+    #    package(:jar).clean.include path_to('desired/content')
+    def clean
+      @paths = { '' => Path.new(self, '') }
+      @prepares = []
+      self
     end
 
     # :call-seq: