buildr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vbo...@apache.org
Subject svn commit: r645218 - in /incubator/buildr/trunk: lib/buildr/java/packaging.rb spec/java_packaging_spec.rb
Date Sun, 06 Apr 2008 09:52:23 GMT
Author: vborja
Date: Sun Apr  6 02:52:16 2008
New Revision: 645218

URL: http://svn.apache.org/viewvc?rev=645218&view=rev
Log:
Spec for adding cloned artifacts to an ear

Modified:
    incubator/buildr/trunk/lib/buildr/java/packaging.rb
    incubator/buildr/trunk/spec/java_packaging_spec.rb

Modified: incubator/buildr/trunk/lib/buildr/java/packaging.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/buildr/java/packaging.rb?rev=645218&r1=645217&r2=645218&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/buildr/java/packaging.rb (original)
+++ incubator/buildr/trunk/lib/buildr/java/packaging.rb Sun Apr  6 02:52:16 2008
@@ -377,7 +377,7 @@
 
         def update_classpath(component)
           package = file(component[:artifact].to_s)
-          package.manifest = package.manifest.dup # avoid mofifying parent projects manifest
+          package.manifest = (package.manifest || {}).dup # avoid mofifying parent projects
manifest  
           package.prepare do
             header = case package.manifest
               when Hash then package.manifest

Modified: incubator/buildr/trunk/spec/java_packaging_spec.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/java_packaging_spec.rb?rev=645218&r1=645217&r2=645218&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/java_packaging_spec.rb (original)
+++ incubator/buildr/trunk/spec/java_packaging_spec.rb Sun Apr  6 02:52:16 2008
@@ -637,6 +637,21 @@
     inspect_ear { |files| files.should include('ejb/foo-1.0.jar') }
   end
 
+  it 'should accept an artifact with component type' do
+    define 'foo', :version=>'1.0' do
+      write 'src/main/resources/foo', 'true'
+      artifact("foo:bar:jar:1.0").from(package(:jar, :id => 'muu').to_s)
+      artifact("foo:baz:jar:1.0").from(package(:jar, :id => 'moo').to_s)
+      package(:ear).add 'foo:baz:jar:1.0'
+      package(:jar, :id => :miu).merge(artifact('foo:bar:jar:1.0')).include('**/*')
+      package(:ear).add :ejb=> package(:jar, :id => :miu)
+    end
+    inspect_ear { |files| files.should include('ejb/miu-1.0.jar', 'lib/baz-1.0.jar') }
+    inspect_classpath 'ejb/miu-1.0.jar'do |classpath|
+      classpath.should include('../lib/baz-1.0.jar')
+    end
+  end
+
   it 'should map JARs to /lib directory' do
     define 'foo', :version=>'1.0' do
       package(:ear) << package(:jar)



Mime
View raw message