buildr 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ 1.1.1 (5/16/2007)
2
+ * Changed: Test case class names must end with Test, TestCase, Suite or TestSuite.
3
+ * Changed: You can now run rake test:{foo,bar} to match against either foo or bar (requires \{..\} on UNIX).
4
+ * Changed: JAVA_HOME now required on all platforms, along with more OS/X fixes. (Credit Paul Brown)
5
+ * Fixed: You can now run rake test:<name> from any directory, and it will find just the right test cases.
6
+
1
7
  1.1.0 (5/13/2007)
2
8
  * Added: Proxy setting for downloading from remote repositories (use repositories.proxy = ...).
3
9
  * Added: projects task to list all the projects you can build.
@@ -32,7 +32,7 @@ end
32
32
 
33
33
 
34
34
  module Buildr
35
- VERSION = "1.1.0"
35
+ VERSION = "1.1.1"
36
36
  end
37
37
 
38
38
  $LOAD_PATH.unshift __DIR__
@@ -71,5 +71,3 @@ Dir["#{Dir.pwd}/tasks/*.rake"].each do |file|
71
71
  $LOADED_FEATURES << file
72
72
  end
73
73
  end
74
-
75
-
@@ -68,8 +68,6 @@ module Buildr
68
68
 
69
69
  end
70
70
 
71
- class Project
72
- include Ant
73
- end
71
+ include Ant
74
72
 
75
73
  end
@@ -92,9 +92,8 @@ module Buildr
92
92
  # :call-seq:
93
93
  # home() => path
94
94
  #
95
- # Returns JAVA_HOME, fails if JAVA_HOME not set. Returns nil for OS/X, we just assume Java is in the path.
95
+ # Returns JAVA_HOME, fails if JAVA_HOME not set.
96
96
  def home()
97
- return nil if darwin?
98
97
  @home ||= ENV["JAVA_HOME"] or fail "Are we forgetting something? JAVA_HOME not set."
99
98
  end
100
99
 
@@ -321,9 +320,8 @@ module Buildr
321
320
  # path_to_bin(cmd?) => path
322
321
  #
323
322
  # Returns the path to the specified Java command (with no argument to java itself).
324
- # Uses JAVA_HOME if set, otherwise assumes the command is accessible from the path.
325
323
  def path_to_bin(name = "java")
326
- home ? File.join(home, "bin", name) : File.join("bin", name)
324
+ File.join(home, "bin", name)
327
325
  end
328
326
 
329
327
  protected
@@ -98,11 +98,15 @@ module Buildr
98
98
 
99
99
  private
100
100
 
101
+ def test_finding_pattern()
102
+ "*{Test,TestCase,Suite,TestSuite}"
103
+ end
104
+
101
105
  def test_cases()
102
106
  unless @cases
103
107
  @cases = @paths.map do |path|
104
108
  base = Pathname.new(path.to_s)
105
- FileList["#{path}/**/*.class"].
109
+ FileList["#{path}/**/#{test_finding_pattern}.class"].
106
110
  map { |file| Pathname.new(file).relative_path_from(base).to_s.ext("").gsub(File::SEPARATOR, ".") }.
107
111
  select { |name| @include.any? { |pattern| File.fnmatch(pattern, name) } }.
108
112
  reject { |name| @exclude.any? { |pattern| File.fnmatch(pattern, name) } }
@@ -318,9 +322,18 @@ module Buildr
318
322
  # will run the test case class com.example.MyTest, if found in the current project.
319
323
  rule /^test:.*$/ do |task|
320
324
  test = task.name.scan(/test:(.*)/)[0][0]
325
+ # Glob if no glob pattern used.
321
326
  test = "*#{test}*" unless test =~ /\*/
322
- Project.local_projects.map { |project| project.test }.
323
- each { |task| task.junit.instance_eval { @include = [test] ; @exclude.clear } }.each(&:invoke)
327
+ if test =~ /\{.+\}/
328
+ # Unfortunately, fnmatch doesn't do {foo,bar}, so we have to expand those ourselves.
329
+ tests = test[/\{.+\}/][1...-1].split(",").map { |name| test.sub(/\{.+\}/, name) }
330
+ else
331
+ tests = [test]
332
+ end
333
+ # Since the test case may reside in a sub-project, we need to set the include/exclude pattern on
334
+ # all sub-projects, but only invoke test on the local project.
335
+ Project.projects.each { |project| project.test.junit.instance_eval { @include = tests ; @exclude.clear } }
336
+ Project.local_projects.each { |project| project.test.invoke }
324
337
  end
325
338
 
326
339
 
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.3
3
3
  specification_version: 1
4
4
  name: buildr
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.1.0
7
- date: 2007-05-13 00:00:00 -07:00
6
+ version: 1.1.1
7
+ date: 2007-05-16 00:00:00 -07:00
8
8
  summary: A build system that doesn't suck
9
9
  require_paths:
10
10
  - lib