You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by to...@apache.org on 2010/04/10 20:02:44 UTC

svn commit: r932775 - in /buildr/trunk: CHANGELOG lib/buildr/packaging/archive.rb spec/java/packaging_spec.rb

Author: toulmean
Date: Sat Apr 10 18:02:44 2010
New Revision: 932775

URL: http://svn.apache.org/viewvc?rev=932775&view=rev
Log:
fix for BUILDR-419 Exclusion patterns only work if they contain a wildcard

Modified:
    buildr/trunk/CHANGELOG
    buildr/trunk/lib/buildr/packaging/archive.rb
    buildr/trunk/spec/java/packaging_spec.rb

Modified: buildr/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/buildr/trunk/CHANGELOG?rev=932775&r1=932774&r2=932775&view=diff
==============================================================================
--- buildr/trunk/CHANGELOG (original)
+++ buildr/trunk/CHANGELOG Sat Apr 10 18:02:44 2010
@@ -123,9 +123,9 @@
 * Fixed:  BUILDR-411 fix for RDoc generation
 * Fixed:  BUILDR-417 package_as_javadoc calls deprecated method  
           (Pepijn Van Eeckhoudt)
-
-* Fixed:  BUILDR-414: Provide tag_name method on GitRelease as part of API
-* Fixed:  BUILDR-421: The MANIFEST.MF file packaged by Buildr as permissions set to 600
+* Fixed:  BUILDR-414 Provide tag_name method on GitRelease as part of API
+* Fixed:  BUILDR-419 Exclusion patterns only work if they contain a wildcard
+* Fixed:  BUILDR-421 The MANIFEST.MF file packaged by Buildr as permissions set to 600
 1.3.5 (2009-10-05)
 * Added:  Interactive shell (REPL) support
 * Added:  BeanShell as default shell for java projects, bsh is small and it's

Modified: buildr/trunk/lib/buildr/packaging/archive.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/packaging/archive.rb?rev=932775&r1=932774&r2=932775&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/packaging/archive.rb (original)
+++ buildr/trunk/lib/buildr/packaging/archive.rb Sat Apr 10 18:02:44 2010
@@ -41,8 +41,10 @@ module Buildr
               if File.directory?(path)
                 in_directory path do |file, rel_path|
                   dest = "#{@path}#{rel_path}"
-                  trace "Adding #{dest}"
-                  file_map[dest] = file
+                  unless excluded?(dest)
+                    trace "Adding #{dest}"
+                    file_map[dest] = file
+                  end
                 end
               else
                 trace "Adding #{@path}#{File.basename(path)}"
@@ -208,8 +210,10 @@ module Buildr
                 path = rel_path.split('/')[1..-1]
                 path.unshift as unless as == '.'
                 dest = "#{@path}#{path.join('/')}"
-                trace "Adding #{dest}"
-                file_map[dest] = file
+                unless excluded?(dest) 
+                  trace "Adding #{dest}"
+                  file_map[dest] = file
+                end
               end
             else
               trace "Adding #{@path}#{as}"

Modified: buildr/trunk/spec/java/packaging_spec.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/java/packaging_spec.rb?rev=932775&r1=932774&r2=932775&view=diff
==============================================================================
--- buildr/trunk/spec/java/packaging_spec.rb (original)
+++ buildr/trunk/spec/java/packaging_spec.rb Sat Apr 10 18:02:44 2010
@@ -479,6 +479,16 @@ describe Packaging, 'jar' do
       define('foo', :version=>'1.0') { package(:jar).with(nil) }
     }.should raise_error
   end
+  
+  it 'should exclude resources when ordered to do so' do
+    write 'src/main/resources/foo.xml', ''
+    foo = define('foo', :version => '1.0') { package(:jar).exclude('foo.xml')}
+    foo.package(:jar).invoke
+    Zip::ZipFile.open(foo.package(:jar).to_s) do |jar|
+      jar.entries.map(&:to_s).sort.should_not include('foo.xml')
+    end
+  end
+    
 end