You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by la...@apache.org on 2008/10/25 17:13:57 UTC

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

Author: lacton
Date: Sat Oct 25 08:13:56 2008
New Revision: 707852

URL: http://svn.apache.org/viewvc?rev=707852&view=rev
Log:
BUILDR-164 Renamed 'sources' task to 'artifacts:sources'.

If the task is named 'sources', then compile.from('sources') invokes the 'sources' task instead of using the 'sources' directory.  That would be a breaking change.

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

Modified: incubator/buildr/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/CHANGELOG?rev=707852&r1=707851&r2=707852&view=diff
==============================================================================
--- incubator/buildr/trunk/CHANGELOG (original)
+++ incubator/buildr/trunk/CHANGELOG Sat Oct 25 08:13:56 2008
@@ -1,6 +1,6 @@
 1.3.4 (Pending)
 * Added:  BUILDR-159 Improved 'check' to accept both tar and tgz archives.
-* Added:  BUILDR-164 New 'sources' task to download source code
+* Added:  BUILDR-164 New 'artifacts:sources' task to download source code
           for artifact jars.
 * Change: Introduced new options from Rake 0.8.3: -I (libdir), -R (rakelib),
           --rules, --no-search, --silent.

Modified: incubator/buildr/trunk/lib/buildr/packaging/artifact.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/buildr/packaging/artifact.rb?rev=707852&r1=707851&r2=707852&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/buildr/packaging/artifact.rb (original)
+++ incubator/buildr/trunk/lib/buildr/packaging/artifact.rb Sat Oct 25 08:13:56 2008
@@ -25,7 +25,7 @@
   task 'artifacts'
 
   desc "Download all artifacts' sources"
-  task 'sources'
+  task 'artifacts:sources'
 
   # Mixin with a task to make it behave like an artifact. Implemented by the packaging tasks.
   #
@@ -425,7 +425,7 @@
         sources_spec = spec.merge(:classifier=>'sources')
         sources_task = OptionalArtifact.define_task(Buildr.repositories.locate(sources_spec))
         sources_task.send :apply_spec, sources_spec
-        Rake::Task['sources'].enhance [sources_task]
+        Rake::Task['artifacts:sources'].enhance [sources_task]
       end
       
     end

Modified: incubator/buildr/trunk/spec/core/compile_spec.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/core/compile_spec.rb?rev=707852&r1=707851&r2=707852&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/core/compile_spec.rb (original)
+++ incubator/buildr/trunk/spec/core/compile_spec.rb Sat Oct 25 08:13:56 2008
@@ -379,7 +379,7 @@
   it 'should complain if source directories and no compiler selected' do
     mkpath 'sources'
     define 'bar' do
-      lambda { compile.from(_('sources')).invoke }.should raise_error(RuntimeError, /no compiler selected/i)
+      lambda { compile.from('sources').invoke }.should raise_error(RuntimeError, /no compiler selected/i)
     end
   end
 end

Modified: incubator/buildr/trunk/spec/packaging/artifact_spec.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/packaging/artifact_spec.rb?rev=707852&r1=707851&r2=707852&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/packaging/artifact_spec.rb (original)
+++ incubator/buildr/trunk/spec/packaging/artifact_spec.rb Sat Oct 25 08:13:56 2008
@@ -638,17 +638,17 @@
 end
 
 
-describe Rake::Task, ' sources' do
+describe Rake::Task, ' artifacts:sources' do
 
   before do
-    task('sources').clear
+    task('artifacts:sources').clear
     repositories.remote = 'http://example.com'
     artifact 'group:id:jar:1.0'
   end
   
   it 'should download sources for all specified artifacts' do
     URI.should_receive(:download).any_number_of_times.and_return { |uri, target| write target }
-    lambda { task('sources').invoke }.should change { File.exist?('home/.m2/repository/group/id/1.0/id-1.0-sources.jar') }.to(true)
+    lambda { task('artifacts:sources').invoke }.should change { File.exist?('home/.m2/repository/group/id/1.0/id-1.0-sources.jar') }.to(true)
   end
   
   describe 'when the source artifact does not exist' do
@@ -658,11 +658,11 @@
     end
     
     it 'should not fail' do
-      lambda { task('sources').invoke }.should_not raise_error
+      lambda { task('artifacts:sources').invoke }.should_not raise_error
     end
     
     it 'should inform the user' do
-      lambda { task('sources').invoke }.should show_info('Failed to download group:id:jar:sources:1.0. Skipping it.')
+      lambda { task('artifacts:sources').invoke }.should show_info('Failed to download group:id:jar:sources:1.0. Skipping it.')
     end
   end
 end