Author: assaf
Date: Fri Jun 27 17:19:01 2008
New Revision: 672440
URL: http://svn.apache.org/viewvc?rev=672440&view=rev
Log:
Changed: BUILDR-88 Test classes/resources should come before compile
classes/resources so they load up earlier in java classpath.
Modified:
incubator/buildr/trunk/CHANGELOG
incubator/buildr/trunk/lib/buildr/core/test.rb
incubator/buildr/trunk/spec/test_spec.rb
Modified: incubator/buildr/trunk/CHANGELOG
URL:
http://svn.apache.org/viewvc/incubator/buildr/trunk/CHANGELOG?rev=672440&r1=672439&r2=672440&view=diff
==============================================================================
--- incubator/buildr/trunk/CHANGELOG (original)
+++ incubator/buildr/trunk/CHANGELOG Fri Jun 27 17:19:01 2008
@@ -1,5 +1,7 @@
1.3.2 (Pending)
* Changed: Upgraded to Rubyforge 1.0.0.
+* Changed: BUILDR-88 Test classes/resources should come before compile
+classes/resources so they load up earlier in java classpath.
* Fixed: BUILDR-77: Layout feature not working.
* Fixed: BUILDR-76: Added more specs and fixes to compile task.
* Fixed: BUILDR-80: Fix reference to Util#timestamp method on nailgun addon.
Modified: incubator/buildr/trunk/lib/buildr/core/test.rb
URL:
http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/buildr/core/test.rb?rev=672440&r1=672439&r2=672440&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/buildr/core/test.rb (original)
+++ incubator/buildr/trunk/lib/buildr/core/test.rb Fri Jun 27 17:19:01 2008
@@ -556,11 +556,11 @@
after_define do |project|
test = project.test
- # Dependency on compiled code, its dependencies and resources.
- test.with project.compile.dependencies
- test.with [project.compile.target, project.resources.target].compact
# Dependency on compiled tests and resources. Dependencies added using
with.
test.dependencies.concat [test.compile.target,
test.resources.target].compact
+ # Dependency on compiled code, its dependencies and resources.
+ test.with [project.compile.target, project.resources.target].compact
+ test.with project.compile.dependencies
# Picking up the test frameworks adds further dependencies.
test.framework
Modified: incubator/buildr/trunk/spec/test_spec.rb
URL:
http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/test_spec.rb?rev=672440&r1=672439&r2=672440&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/test_spec.rb (original)
+++ incubator/buildr/trunk/spec/test_spec.rb Fri Jun 27 17:19:01 2008
@@ -203,11 +203,27 @@
project('foo').test.dependencies.should
include(project('foo').test.compile.target)
end
+ it 'should add test compile target ahead of regular compile target' do
+ write 'src/main/java/Code.java'
+ write 'src/test/java/Test.java'
+ define 'foo'
+ depends = project('foo').test.dependencies
+ depends.index(project('foo').test.compile.target).should <
depends.index(project('foo').compile.target)
+ end
+
it 'should include the test resources target in its dependencies' do
write 'src/test/resources/test'
define('foo').test.dependencies.should
include(project('foo').test.resources.target)
end
+ it 'should add test resource target ahead of regular resource target' do
+ write 'src/main/resources/test'
+ write 'src/test/resources/test'
+ define 'foo'
+ depends = project('foo').test.dependencies
+ depends.index(project('foo').test.resources.target).should <
depends.index(project('foo').resources.target)
+ end
+
it 'should clean after itself (test files)' do
define('foo') { test.compile.using(:javac) }
mkpath project('foo').test.compile.target.to_s