buildr 1.4.16 → 1.4.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +8 -8
  2. data/CHANGELOG +20 -0
  3. data/addon/buildr/bnd.rb +158 -158
  4. data/addon/buildr/checkstyle-report.xsl +87 -0
  5. data/addon/buildr/checkstyle.rb +213 -205
  6. data/addon/buildr/css_lint-report.xsl +83 -0
  7. data/addon/buildr/css_lint.rake +196 -0
  8. data/addon/buildr/custom_pom.rb +282 -0
  9. data/addon/buildr/drb.rb +0 -1
  10. data/addon/buildr/git_auto_version.rb +34 -34
  11. data/addon/buildr/gwt.rb +171 -171
  12. data/addon/buildr/hibernate.rb +8 -8
  13. data/addon/buildr/javancss.rb +155 -155
  14. data/addon/buildr/jaxb_xjc.rb +74 -74
  15. data/addon/buildr/jibx.rb +0 -1
  16. data/addon/buildr/org/apache/buildr/BuildrNail.java +2 -2
  17. data/addon/buildr/org/apache/buildr/JettyWrapper.java +3 -3
  18. data/addon/buildr/package_as_nsis.rb +2 -2
  19. data/addon/buildr/pmd.rb +166 -166
  20. data/addon/buildr/scss_lint-report.xsl +79 -0
  21. data/addon/buildr/scss_lint.rb +199 -0
  22. data/addon/buildr/wsgen.rb +4 -0
  23. data/doc/building.textile +3 -3
  24. data/doc/css/default.css +3 -3
  25. data/doc/css/print.css +1 -1
  26. data/doc/download.textile +18 -7
  27. data/doc/index.textile +8 -1
  28. data/doc/installing.textile +3 -3
  29. data/doc/languages.textile +0 -1
  30. data/doc/mailing_lists.textile +0 -4
  31. data/doc/more_stuff.textile +127 -3
  32. data/doc/preface.textile +1 -1
  33. data/doc/projects.textile +6 -6
  34. data/doc/releasing.textile +0 -1
  35. data/lib/buildr/clojure/shell.rb +0 -1
  36. data/lib/buildr/core/build.rb +16 -16
  37. data/lib/buildr/core/filter.rb +3 -3
  38. data/lib/buildr/core/jrebel.rb +0 -1
  39. data/lib/buildr/core/linux.rb +0 -1
  40. data/lib/buildr/core/run.rb +0 -1
  41. data/lib/buildr/core/shell.rb +0 -1
  42. data/lib/buildr/groovy/doc.rb +0 -1
  43. data/lib/buildr/ide/eclipse.rb +0 -2
  44. data/lib/buildr/ide/idea.rb +44 -8
  45. data/lib/buildr/java/bdd.rb +0 -1
  46. data/lib/buildr/java/commands.rb +2 -3
  47. data/lib/buildr/java/jruby.rb +2 -2
  48. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.java +5 -5
  49. data/lib/buildr/java/tests.rb +0 -1
  50. data/lib/buildr/packaging/artifact_namespace.rb +0 -2
  51. data/lib/buildr/resources/icons-license.txt +14 -17
  52. data/lib/buildr/scala/bdd.rb +0 -1
  53. data/lib/buildr/scala/compiler.rb +0 -1
  54. data/lib/buildr/scala/org/apache/buildr/Specs2Runner.class +0 -0
  55. data/lib/buildr/scala/org/apache/buildr/Specs2Runner.java +0 -2
  56. data/lib/buildr/version.rb +1 -1
  57. data/rakelib/metrics.rake +3 -3
  58. data/rakelib/release.rake +8 -2
  59. data/spec/addon/bnd_spec.rb +383 -383
  60. data/spec/addon/custom_pom_spec.rb +149 -0
  61. data/spec/addon/drb_spec.rb +0 -1
  62. data/spec/addon/jaxb_xjc_spec.rb +130 -130
  63. data/spec/core/application_spec.rb +0 -1
  64. data/spec/core/build_spec.rb +1 -1
  65. data/spec/core/console_spec.rb +0 -1
  66. data/spec/core/doc_spec.rb +0 -1
  67. data/spec/core/extension_spec.rb +0 -1
  68. data/spec/core/generate_from_eclipse_spec.rb +9 -9
  69. data/spec/core/run_spec.rb +2 -3
  70. data/spec/core/shell_spec.rb +0 -1
  71. data/spec/ide/idea_spec.rb +1979 -1941
  72. data/spec/java/cobertura_spec.rb +6 -6
  73. data/spec/java/commands_spec.rb +11 -11
  74. data/spec/java/compiler_spec.rb +0 -1
  75. data/spec/java/doc_spec.rb +0 -1
  76. data/spec/java/ecj_spec.rb +1 -3
  77. data/spec/java/external_spec.rb +0 -2
  78. data/spec/java/java_spec.rb +3 -3
  79. data/spec/java/run_spec.rb +0 -1
  80. data/spec/java/tests_spec.rb +15 -0
  81. data/spec/xpath_matchers.rb +121 -120
  82. metadata +10 -2
@@ -55,7 +55,7 @@ describe Buildr::Cobertura do
55
55
  define('foo') { define('bar') }
56
56
  task('foo:bar:cobertura:instrument').invoke
57
57
  end
58
-
58
+
59
59
  it 'should not generate html if projects have no sources' do
60
60
  define('foo') { define('bar') }
61
61
  task('cobertura:html').invoke
@@ -94,21 +94,21 @@ describe Buildr::Cobertura do
94
94
  import static junit.framework.Assert.assertTrue;
95
95
  import org.junit.Test;
96
96
 
97
- public class FooTest {
98
-
97
+ public class FooTest {
98
+
99
99
  @Test
100
- public void testReturnTrue() {
100
+ public void testReturnTrue() {
101
101
  assertTrue(Foo.returnTrue());
102
102
  }
103
103
  }
104
104
  JAVA
105
105
  end
106
-
106
+
107
107
  it 'should not raise errors during execution' do
108
108
  define('foo') { cobertura.include 'Foo' }
109
109
  lambda {task("foo:cobertura:check").invoke}.should_not raise_error
110
110
  end
111
-
111
+
112
112
  end
113
113
  end
114
114
  end
@@ -30,30 +30,30 @@ BUILD
30
30
  lambda { Java::Commands.java("org.apache.tools.ant.Main", :classpath => Buildr::Ant.dependencies) }.should_not show_info(/java/)
31
31
  lambda { Java::Commands.java("org.apache.tools.ant.Main", :classpath => Buildr::Ant.dependencies, :verbose => true) }.should show_info(/java/)
32
32
  end
33
-
33
+
34
34
  describe "Java::Commands.javac" do
35
-
35
+
36
36
  it "should compile java" do
37
37
  write "Foo.java", "public class Foo {}"
38
38
  lambda { Java::Commands.javac("Foo.java") }.should change {File.exist?("Foo.class")}.to(true)
39
39
  end
40
-
40
+
41
41
  it 'should let the user specify an output directory' do
42
42
  write "Foo.java", "public class Foo {}"
43
43
  lambda { Java::Commands.javac("Foo.java", :output => "classes") }.should change {File.exist?("classes/Foo.class")}.to(true)
44
44
  end
45
-
45
+
46
46
  it "should let the user specify a different name" do
47
47
  write "Foo.java", "public class Foo {}"
48
48
  lambda { Java::Commands.javac("Foo.java", :name => "bar") }.should show_info("Compiling 1 source files in bar")
49
49
  end
50
-
50
+
51
51
  it "should let the user specify a source path" do
52
52
  write "ext/org/Bar.java", "package org; public class Bar {}"
53
53
  write "Foo.java", "import org.Bar;\n public class Foo {}"
54
54
  lambda { Java::Commands.javac("Foo.java", :sourcepath => File.expand_path("ext")) }.should change {File.exist?("Foo.class")}.to(true)
55
55
  end
56
-
56
+
57
57
  it "should let the user specify a classpath" do
58
58
  write "ext/org/Bar.java", "package org; public class Bar {}"
59
59
  Java::Commands.javac("ext/org/Bar.java", :output => "lib")
@@ -61,18 +61,18 @@ BUILD
61
61
  lambda { Java::Commands.javac("Foo.java", :classpath => File.expand_path("lib")) }.should change {File.exist?("Foo.class")}.to(true)
62
62
  end
63
63
  end
64
-
64
+
65
65
  describe "Java::Commands.javadoc" do
66
-
66
+
67
67
  it "should fail if no output is defined" do
68
68
  lambda { Java::Commands.javadoc("Foo.java") }.should raise_error(/No output defined for javadoc/)
69
69
  end
70
-
70
+
71
71
  it "should create javadoc" do
72
72
  write "Foo.java", "public class Foo {}"
73
73
  lambda { Java::Commands.javadoc("Foo.java", :output => "doc") }.should change {File.exist?("doc/Foo.html")}.to(true)
74
74
  end
75
-
75
+
76
76
  it "should accept file tasks as arguments" do
77
77
  foo = file("Foo.java") do |file|
78
78
  file.enhance do
@@ -81,7 +81,7 @@ BUILD
81
81
  end
82
82
  lambda { Java::Commands.javadoc(foo, :output => "doc") }.should change {File.exist?("doc/Foo.html")}.to(true)
83
83
  end
84
-
84
+
85
85
  it "should accept projects as arguments" do
86
86
  write "src/main/java/Foo.java", "public class Foo {}"
87
87
  write "src/main/java/bar/Foobar.java", "package bar; public class Foobar {}"
@@ -268,4 +268,3 @@ describe 'javac compiler options' do
268
268
  ENV.delete "DEBUG"
269
269
  end
270
270
  end
271
-
@@ -53,4 +53,3 @@ describe 'Javadoc' do
53
53
  end
54
54
 
55
55
  end
56
-
@@ -43,7 +43,7 @@ describe Buildr::Compiler::Ecj do
43
43
  foo.compile.compiler.should == :ecj
44
44
  end
45
45
 
46
- describe "should compile a Java project just in the same way javac does" do
46
+ describe "should compile a Java project just in the same way javac does" do
47
47
  javac_spec = File.read(File.join(File.dirname(__FILE__), "compiler_spec.rb"))
48
48
  javac_spec = javac_spec.match(Regexp.escape("require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helpers'))\n")).post_match
49
49
  javac_spec.gsub!("javac", "ecj")
@@ -103,5 +103,3 @@ describe Buildr::Compiler::Ecj do
103
103
  end
104
104
  end
105
105
  end
106
-
107
-
@@ -53,5 +53,3 @@ describe Buildr::Compiler::ExternalJavac do
53
53
  end
54
54
 
55
55
  end
56
-
57
-
@@ -63,7 +63,7 @@ describe 'Java.tools_jar' do
63
63
  write 'jdk/lib/tools.jar'
64
64
  ENV['JAVA_HOME'] = File.expand_path('jdk')
65
65
  end
66
-
66
+
67
67
  it 'should return the path to tools.jar' do
68
68
  Java.tools_jar.should point_to_path('jdk/lib/tools.jar')
69
69
  end
@@ -75,7 +75,7 @@ describe 'Java.tools_jar' do
75
75
  write 'jdk/lib/tools.jar'
76
76
  ENV['JAVA_HOME'] = File.expand_path('jdk/jre')
77
77
  end
78
-
78
+
79
79
  it 'should return the path to tools.jar' do
80
80
  Java.tools_jar.should point_to_path('jdk/lib/tools.jar')
81
81
  end
@@ -86,7 +86,7 @@ describe 'Java.tools_jar' do
86
86
  Java.instance_eval { @tools_jar = nil }
87
87
  ENV['JAVA_HOME'] = File.expand_path('jdk')
88
88
  end
89
-
89
+
90
90
  it 'should return nil' do
91
91
  Java.tools_jar.should be_nil
92
92
  end
@@ -75,4 +75,3 @@ describe Run::JavaRunner do
75
75
  end
76
76
 
77
77
  end
78
-
@@ -182,6 +182,13 @@ describe Buildr::JUnit do
182
182
  lambda { define('foo').test.invoke }.should raise_error(RuntimeError, /Tests failed/) rescue nil
183
183
  end
184
184
 
185
+ it 'should fail when JUnit test case fails to compile' do
186
+ write 'src/test/java/FailingTest.java', <<-JAVA
187
+ public class FailingTest e xtends blah blah
188
+ JAVA
189
+ lambda { define('foo').test.invoke }.should raise_error(RuntimeError, /Tests failed/) rescue nil
190
+ end
191
+
185
192
  it 'should report failed test names' do
186
193
  write 'src/test/java/FailingTest.java', <<-JAVA
187
194
  public class FailingTest extends junit.framework.TestCase {
@@ -458,6 +465,14 @@ describe Buildr::TestNG do
458
465
  lambda { project('foo').test.invoke }.should raise_error(RuntimeError, /Tests failed/)
459
466
  end
460
467
 
468
+ it 'should fail when TestNG test case fails to compile' do
469
+ write 'src/test/java/FailingTest.java', <<-JAVA
470
+ public class FailingTest exte lasjw9jc930d;kl;kl
471
+ JAVA
472
+ define('foo') { test.using(:testng) }
473
+ lambda { project('foo').test.invoke }.should raise_error(RuntimeError)
474
+ end
475
+
461
476
  it 'should fail when multiple TestNG test case fail' do
462
477
  write 'src/test/java/FailingTest1.java', <<-JAVA
463
478
  public class FailingTest1 {
@@ -1,121 +1,122 @@
1
- # Licensed to the Apache Software Foundation (ASF) under one or more
2
- # contributor license agreements. See the NOTICE file distributed with this
3
- # work for additional information regarding copyright ownership. The ASF
4
- # licenses this file to you under the Apache License, Version 2.0 (the
5
- # "License"); you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
- # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
- # License for the specific language governing permissions and limitations under
14
- # the License.
15
-
16
- require 'rexml/document'
17
- require 'rexml/element'
18
-
19
- module RSpec
20
- module Matchers
21
-
22
- # check if the xpath exists one or more times
23
- class HaveXpath
24
- def initialize(xpath)
25
- @xpath = xpath
26
- end
27
-
28
- def matches?(response)
29
- @response = response
30
- doc = response.is_a?(REXML::Document) ? response : REXML::Document.new(@response)
31
- match = REXML::XPath.match(doc, @xpath)
32
- not match.empty?
33
- end
34
-
35
- def failure_message
36
- "Did not find expected xpath #{@xpath}"
37
- end
38
-
39
- def negative_failure_message
40
- "Did find unexpected xpath #{@xpath}"
41
- end
42
-
43
- def description
44
- "match the xpath expression #{@xpath}"
45
- end
46
- end
47
-
48
- def have_xpath(xpath)
49
- HaveXpath.new(xpath)
50
- end
51
-
52
- # check if the xpath has the specified value
53
- # value is a string and there must be a single result to match its
54
- # equality against
55
- class MatchXpath
56
- def initialize(xpath, val)
57
- @xpath = xpath
58
- @val= val
59
- end
60
-
61
- def matches?(response)
62
- @response = response
63
- doc = response.is_a?(REXML::Document) ? response : REXML::Document.new(@response)
64
- ok = true
65
- REXML::XPath.each(doc, @xpath) do |e|
66
- @actual_val = case e
67
- when REXML::Attribute
68
- e.to_s
69
- when REXML::Element
70
- e.text
71
- else
72
- e.to_s
73
- end
74
- return false unless @val == @actual_val
75
- end
76
- return ok
77
- end
78
-
79
- def failure_message
80
- "The xpath #{@xpath} did not have the value '#{@val}' It was '#{@actual_val}'"
81
- end
82
-
83
- def description
84
- "match the xpath expression #{@xpath} with #{@val}"
85
- end
86
- end
87
-
88
- def match_xpath(xpath, val)
89
- MatchXpath.new(xpath, val)
90
- end
91
-
92
- # checks if the given xpath occurs num times
93
- class HaveNodes #:nodoc:
94
- def initialize(xpath, num)
95
- @xpath= xpath
96
- @num = num
97
- end
98
-
99
- def matches?(response)
100
- @response = response
101
- doc = response.is_a?(REXML::Document) ? response : REXML::Document.new(@response)
102
- match = REXML::XPath.match(doc, @xpath)
103
- @num_found= match.size
104
- @num_found == @num
105
- end
106
-
107
- def failure_message
108
- "Did not find expected number of nodes #{@num} in xpath #{@xpath} Found #{@num_found}"
109
- end
110
-
111
- def description
112
- "match the number of nodes #{@num}"
113
- end
114
- end
115
-
116
- def have_nodes(xpath, num)
117
- HaveNodes.new(xpath, num)
118
- end
119
-
120
- end
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with this
3
+ # work for additional information regarding copyright ownership. The ASF
4
+ # licenses this file to you under the Apache License, Version 2.0 (the
5
+ # "License"); you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ # License for the specific language governing permissions and limitations under
14
+ # the License.
15
+
16
+ require 'rexml/document'
17
+ require 'rexml/element'
18
+
19
+ module RSpec
20
+ module Matchers
21
+
22
+ # check if the xpath exists one or more times
23
+ class HaveXpath
24
+ def initialize(xpath)
25
+ @xpath = xpath
26
+ end
27
+
28
+ def matches?(response)
29
+ @response = response
30
+ doc = response.is_a?(REXML::Document) ? response : REXML::Document.new(@response)
31
+ match = REXML::XPath.match(doc, @xpath)
32
+ !match.empty?
33
+ end
34
+
35
+ def failure_message
36
+ "Did not find expected xpath #{@xpath}"
37
+ end
38
+
39
+ def negative_failure_message
40
+ "Did find unexpected xpath #{@xpath}"
41
+ end
42
+
43
+ def description
44
+ "match the xpath expression #{@xpath}"
45
+ end
46
+ end
47
+
48
+ def have_xpath(xpath)
49
+ HaveXpath.new(xpath)
50
+ end
51
+
52
+ # check if the xpath has the specified value
53
+ # value is a string and there must be a single result to match its
54
+ # equality against
55
+ class MatchXpath
56
+ def initialize(xpath, val)
57
+ @xpath = xpath
58
+ @val= val
59
+ end
60
+
61
+ def matches?(response)
62
+ @response = response
63
+ doc = response.is_a?(REXML::Document) ? response : REXML::Document.new(@response)
64
+ ok = false
65
+ REXML::XPath.each(doc, @xpath) do |e|
66
+ @actual_val = case e
67
+ when REXML::Attribute
68
+ e.to_s
69
+ when REXML::Element
70
+ e.text
71
+ else
72
+ e.to_s
73
+ end
74
+ ok = true
75
+ return false unless @val == @actual_val
76
+ end
77
+ return ok
78
+ end
79
+
80
+ def failure_message
81
+ "The xpath #{@xpath} did not have the value '#{@val}' It was '#{@actual_val}'"
82
+ end
83
+
84
+ def description
85
+ "match the xpath expression #{@xpath} with #{@val}"
86
+ end
87
+ end
88
+
89
+ def match_xpath(xpath, val)
90
+ MatchXpath.new(xpath, val)
91
+ end
92
+
93
+ # checks if the given xpath occurs num times
94
+ class HaveNodes #:nodoc:
95
+ def initialize(xpath, num)
96
+ @xpath= xpath
97
+ @num = num
98
+ end
99
+
100
+ def matches?(response)
101
+ @response = response
102
+ doc = response.is_a?(REXML::Document) ? response : REXML::Document.new(@response)
103
+ match = REXML::XPath.match(doc, @xpath)
104
+ @num_found= match.size
105
+ @num_found == @num
106
+ end
107
+
108
+ def failure_message
109
+ "Did not find expected number of nodes #{@num} in xpath #{@xpath} Found #{@num_found}"
110
+ end
111
+
112
+ def description
113
+ "match the number of nodes #{@num}"
114
+ end
115
+ end
116
+
117
+ def have_nodes(xpath, num)
118
+ HaveNodes.new(xpath, num)
119
+ end
120
+
121
+ end
121
122
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buildr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.16
4
+ version: 1.4.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Apache Buildr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-03 00:00:00.000000000 Z
11
+ date: 2014-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -426,8 +426,12 @@ extra_rdoc_files:
426
426
  files:
427
427
  - addon/buildr/antlr.rb
428
428
  - addon/buildr/bnd.rb
429
+ - addon/buildr/checkstyle-report.xsl
429
430
  - addon/buildr/checkstyle.rb
430
431
  - addon/buildr/cobertura.rb
432
+ - addon/buildr/css_lint-report.xsl
433
+ - addon/buildr/css_lint.rake
434
+ - addon/buildr/custom_pom.rb
431
435
  - addon/buildr/drb.rb
432
436
  - addon/buildr/emma.rb
433
437
  - addon/buildr/findbugs.rb
@@ -454,6 +458,8 @@ files:
454
458
  - addon/buildr/package_as_nsis.rb
455
459
  - addon/buildr/pmd.rb
456
460
  - addon/buildr/protobuf.rb
461
+ - addon/buildr/scss_lint-report.xsl
462
+ - addon/buildr/scss_lint.rb
457
463
  - addon/buildr/single_intermediate_layout.rb
458
464
  - addon/buildr/sonar.rb
459
465
  - addon/buildr/top_level_generate_dir.rb
@@ -569,6 +575,7 @@ files:
569
575
  - lib/buildr/scala/bdd.rb
570
576
  - lib/buildr/scala/compiler.rb
571
577
  - lib/buildr/scala/doc.rb
578
+ - lib/buildr/scala/org/apache/buildr/Specs2Runner.class
572
579
  - lib/buildr/scala/org/apache/buildr/Specs2Runner.java
573
580
  - lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.class
574
581
  - lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.java
@@ -587,6 +594,7 @@ files:
587
594
  - rakelib/rspec.rake
588
595
  - rakelib/stage.rake
589
596
  - spec/addon/bnd_spec.rb
597
+ - spec/addon/custom_pom_spec.rb
590
598
  - spec/addon/drb_spec.rb
591
599
  - spec/addon/jaxb_xjc_spec.rb
592
600
  - spec/core/application_spec.rb