lib/java/test.rb in buildr-1.0.0 vs lib/java/test.rb in buildr-1.1.0
- old
+ new
@@ -287,11 +287,11 @@
resources = Java::ResourcesTask.define_task("test:resources")
resources.filter.from project.path_to("src/test/resources")
# Similar to the regular compile task but using different paths.
compile = Java::CompileTask.define_task("test:compile"=>[project.compile, project.test.prepare, project.test.resources])
project.path_to("src/test/java").tap { |dir| compile.from dir if File.exist?(dir) }
- compile.into project.path_to("target/test-classes")
+ compile.into project.path_to(:target, "test-classes")
resources.filter.into compile.target
# Define the JUnit task here, otherwise we get a normal task.
Java::JUnitTask.define_task("test:junit")
# Define these tasks once, otherwise we may get a namespace error.
project.test.setup ; project.test.teardown
@@ -307,20 +307,21 @@
project.test.junit.options[:properties] ||= {}
project.test.junit.options.tap do |options|
options[:properties] ||= {}
options[:properties]["baseDir"] ||= project.test.compile.target.to_s
end
+ project.clean { verbose(false) { rm_rf project.test.compile.target.to_s } }
end
end
# This rule takes a suffix and runs that test case in the current project. For example;
# rake test:MyTest
# will run the test case class com.example.MyTest, if found in the current project.
rule /^test:.*$/ do |task|
test = task.name.scan(/test:(.*)/)[0][0]
- Project.projects.select { |project| project.base_dir == Rake.application.original_dir }.
- map { |project| project.test }.each { |task| task.junit.instance_eval { @include = ["*#{test}"] ; @exclude.clear } }.
- each(&:invoke)
+ test = "*#{test}*" unless test =~ /\*/
+ Project.local_projects.map { |project| project.test }.
+ each { |task| task.junit.instance_eval { @include = [test] ; @exclude.clear } }.each(&:invoke)
end
class Options