buildr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toulm...@apache.org
Subject svn commit: r1299410 - in /buildr/trunk: CHANGELOG lib/buildr/core/run.rb lib/buildr/run.rb spec/core/run_spec.rb
Date Sun, 11 Mar 2012 17:54:11 GMT
Author: toulmean
Date: Sun Mar 11 17:54:11 2012
New Revision: 1299410

URL: http://svn.apache.org/viewvc?rev=1299410&view=rev
Log:
BUILDR-629 and BUILDR-630  thanks to Russell Teabault
* Change: BUILDR-630 Run task should not add test dependencies (Russell Teabeault)
* Change: BUILDR-629 JavaRunner should include target/resources in classpath (Russell Teabeault)

Modified:
    buildr/trunk/CHANGELOG
    buildr/trunk/lib/buildr/core/run.rb
    buildr/trunk/lib/buildr/run.rb
    buildr/trunk/spec/core/run_spec.rb

Modified: buildr/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/buildr/trunk/CHANGELOG?rev=1299410&r1=1299409&r2=1299410&view=diff
==============================================================================
--- buildr/trunk/CHANGELOG (original)
+++ buildr/trunk/CHANGELOG Sun Mar 11 17:54:11 2012
@@ -2,10 +2,11 @@
 * Added:  Add several utility methods to IDEA extension for defining artifacts and configurations.
 * Change: Make minimumTokenCount and encoding configurable for the PMD/CPD action
           and default encoding to UTF-8 for compatibility with external tools (i.e. Jenkins)
-* Fixed:  BUILDR-617 pom exclusion does not work (Kafka Liu)
 * Change: BUILDR-615 VersionRequirement.version? now returns true for
           versions following pattern "r9999", e.g. "r09"
-
+* Change: BUILDR-630 Run task should not add test dependencies (Russell Teabeault)
+* Change: BUILDR-629 JavaRunner should include target/resources in classpath (Russell Teabeault)
+* Fixed:  BUILDR-617 pom exclusion does not work (Kafka Liu)
 1.4.7 (2011-11-17)
 * Added:  Add a Findbugs extension.
 * Added:  Add a Checkstyle extension.

Modified: buildr/trunk/lib/buildr/core/run.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/run.rb?rev=1299410&r1=1299409&r2=1299410&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/run.rb (original)
+++ buildr/trunk/lib/buildr/core/run.rb Sun Mar 11 17:54:11 2012
@@ -23,7 +23,7 @@ module Buildr
 
       def run(task)
         fail "Missing :main option" unless task.options[:main]
-        cp = project.compile.dependencies + [project.path_to(:target, :classes)] + task.classpath
+        cp = project.compile.dependencies + [project.path_to(:target, :classes), project.path_to(:target,
:resources)] + task.classpath
         Java::Commands.java(task.options[:main], {
           :properties => jrebel_props(project).merge(task.options[:properties] || {}),
           :classpath => cp,

Modified: buildr/trunk/lib/buildr/run.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/run.rb?rev=1299410&r1=1299409&r2=1299410&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/run.rb (original)
+++ buildr/trunk/lib/buildr/run.rb Sun Mar 11 17:54:11 2012
@@ -171,8 +171,9 @@ module Buildr
     end
 
     after_define(:run => :test) do |project|
-      project.run.with project.test.compile.dependencies
-      project.run.with project.test.compile.target if project.test.compile.target
+      project.run.with project.compile.dependencies
+      project.run.with project.resources.target if project.resources.target
+      project.run.with project.compile.target if project.compile.target
     end
 
     # :call-seq:

Modified: buildr/trunk/spec/core/run_spec.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/core/run_spec.rb?rev=1299410&r1=1299409&r2=1299410&view=diff
==============================================================================
--- buildr/trunk/spec/core/run_spec.rb (original)
+++ buildr/trunk/spec/core/run_spec.rb Sun Mar 11 17:54:11 2012
@@ -27,13 +27,20 @@ describe Project, :run do
     project('foo').run.should be_kind_of(Run::RunTask)
   end
 
-  it 'should include compile and test.compile dependencies' do
+  it 'should include compile dependencies' do
     define('foo') do
       compile.using(:javac).with 'group:compile:jar:1.0'
       test.compile.using(:javac).with 'group:test:jar:1.0'
     end
     project('foo').run.classpath.should include(artifact('group:compile:jar:1.0'))
-    project('foo').run.classpath.should include(artifact('group:test:jar:1.0'))
+  end
+  
+  it 'should not include test dependencies' do
+    define('foo') do
+      compile.using(:javac).with 'group:compile:jar:1.0'
+      test.compile.using(:javac).with 'group:test:jar:1.0'
+    end
+    project('foo').run.classpath.should_not include(artifact('group:test:jar:1.0'))
   end
 
   it 'should respond to using() and return self' do
@@ -63,11 +70,17 @@ describe Project, :run do
     end
     project('foo').run.runner.should be_a(Run::JavaRunner)
   end
+  
+  it "should run with the project resources" do
+    write 'src/main/java/Test.java', 'class Test {}'
+    write 'src/main/resources/test.properties', ''
+    define 'foo'
+    project('foo').run.classpath.should include project('foo').resources.target
+  end
 
-  it 'should depend on project''s compile and test.compile task' do
+  it 'should depend on project''s compile task' do
     define 'foo'
     project('foo').run.prerequisites.should include(project('foo').compile)
-    project('foo').run.prerequisites.should include(project('foo').test)
   end
 
   it 'should be local task' do



Mime
View raw message