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
@@ -51,4 +51,4 @@ bq. The positive side effect for me as a java user is that I learn a little ruby
51
51
  </div>
52
52
 
53
53
 
54
- p(preface).
54
+ p(preface).
@@ -16,21 +16,21 @@ The remainder of this guide deals with what it takes to build a project. But fi
16
16
  require "buildr/openjpa"
17
17
 
18
18
  include Buildr::OpenJPA
19
-
19
+
20
20
  VERSION_NUMBER = '1.0'
21
-
21
+
22
22
  AXIS2 = 'org.apache.axis2:axis2:jar:1.2'
23
23
  AXIOM = group('axiom-api', 'axiom-impl', 'axiom-dom',
24
24
  :under=>'org.apache.ws.commons.axiom', :version=>'1.2.4')
25
25
  AXIS_OF_WS = [AXIOM, AXIS2]
26
26
  OPENJPA = ['org.apache.openjpa:openjpa:jar:1.2.0',
27
27
  'net.sourceforge.serp:serp:jar:1.12.0']
28
-
28
+
29
29
  repositories.remote << 'http://www.ibiblio.org/maven2/'
30
-
30
+
31
31
  desc 'Code. Build. ??? Profit!'
32
32
  define 'killer-app' do
33
-
33
+
34
34
  project.version = VERSION_NUMBER
35
35
  project.group = 'acme'
36
36
  manifest['Copyright'] = 'Acme Inc (C) 2007'
@@ -124,7 +124,7 @@ To see a list of all projects defined in your Buildfile run @buildr help:project
124
124
 
125
125
  h2(#tasks). Running Project Tasks
126
126
 
127
- Most times, you run tasks like @build@ or @package@ that operate on the current project and recursively on its sub-projects. The "current project" is the one that uses the current working directory. So if you're in the @la-web/src@ directory looking at source files, _la-web_ is the current project. For example:
127
+ Most times, you run tasks like @build@ or @package@ that operate on the current project and recursively on its sub-projects. The "current project" is the one that uses the current working directory. So if you're in the @la-web/src@ directory looking at source files, _la-web_ is the current project. For example:
128
128
 
129
129
  {% highlight sh %}
130
130
  # build killer-app and all its sub-projects
@@ -116,4 +116,3 @@ The environment variable @NEXT_VERSION@ has precedence over Release.next_version
116
116
  h2(#custom_tag_and_msg). How to specify my own tag name and commit message?
117
117
 
118
118
  As explained earlier, Buildr will create two new commits and a new tag in the version control system. Similarly to @Release.next_version@, the commit message and the tag name can be customized with @Release.message@ and @Release.tag_name@. Both could be strings or procs that would receive the released version @THIS_VERSION@ without @-SNAPSHOT@.
119
-
@@ -49,4 +49,3 @@ module Buildr::Shell #:nodoc:
49
49
  end
50
50
 
51
51
  Buildr::Shell.providers << Buildr::Shell::Clojure
52
-
@@ -106,7 +106,7 @@ module Buildr #:nodoc:
106
106
  # :call-seq:
107
107
  # hg(*args)
108
108
  #
109
- # Executes a Mercurial (hg) command passing through the args and returns the output.
109
+ # Executes a Mercurial (hg) command passing through the args and returns the output.
110
110
  # Throws exception if the exit status is not zero. For example:
111
111
  # hg 'commit'
112
112
  # hg 'update', 'default'
@@ -287,13 +287,13 @@ module Buildr #:nodoc:
287
287
  # Use this to specify the next version number to replace VERSION_NUMBER with in the buildfile.
288
288
  # You can set the next version or a proc that will be called with the current version number.
289
289
  # For example, with the following buildfile:
290
- # THIS_VERSION = "1.0.0-rc1"
291
- # Release.next_version = lambda { |version|
290
+ # THIS_VERSION = "1.0.0-rc1"
291
+ # Release.next_version = lambda { |version|
292
292
  # version[-1] = version[-1].to_i + 1
293
293
  # version
294
- # }
295
- #
296
- # Release.next_version will return "1.0.0-rc2", so at the end of the release, the buildfile will contain VERSION_NUMBER = "1.0.0-rc2"
294
+ # }
295
+ #
296
+ # Release.next_version will return "1.0.0-rc2", so at the end of the release, the buildfile will contain VERSION_NUMBER = "1.0.0-rc2"
297
297
  #
298
298
  attr_accessor :next_version
299
299
 
@@ -343,7 +343,7 @@ module Buildr #:nodoc:
343
343
 
344
344
  def check
345
345
  if this_version == resolve_next_version(this_version) && this_version.match(/-SNAPSHOT$/)
346
- fail "The next version can't be equal to the current version #{this_version}.\nUpdate THIS_VERSION/VERSION_NUMBER, specify Release.next_version or use NEXT_VERSION env var"
346
+ fail "The next version can't be equal to the current version #{this_version}.\nUpdate THIS_VERSION/VERSION_NUMBER, specify Release.next_version or use NEXT_VERSION env var"
347
347
  end
348
348
  end
349
349
 
@@ -370,7 +370,7 @@ module Buildr #:nodoc:
370
370
  end
371
371
 
372
372
  protected
373
-
373
+
374
374
  # the initial value of THIS_VERSION
375
375
  attr_accessor :this_version
376
376
 
@@ -391,7 +391,7 @@ module Buildr #:nodoc:
391
391
  # for the release buildfile.
392
392
  def with_release_candidate_version
393
393
  release_candidate_buildfile = Buildr.application.buildfile.to_s + '.next'
394
-
394
+
395
395
  release_candidate_buildfile_contents = change_version { |version|
396
396
  version.gsub(/-SNAPSHOT$/, "")
397
397
  }
@@ -435,20 +435,20 @@ module Buildr #:nodoc:
435
435
  next_version ||= lambda { |v|
436
436
  snapshot = v.match(/-SNAPSHOT$/)
437
437
  version = v.gsub(/-SNAPSHOT$/, "").split(/\./)
438
- if snapshot
438
+ if snapshot
439
439
  version[-1] = sprintf("%0#{version[-1].size}d", version[-1].to_i + 1) + '-SNAPSHOT'
440
- end
440
+ end
441
441
  version.join('.')
442
- }
443
- next_version = ENV['NEXT_VERSION'] if ENV['NEXT_VERSION']
444
- next_version = ENV['next_version'] if ENV['next_version']
442
+ }
443
+ next_version = ENV['NEXT_VERSION'] if ENV['NEXT_VERSION']
444
+ next_version = ENV['next_version'] if ENV['next_version']
445
445
  next_version = next_version.call(current_version) if Proc === next_version
446
446
  next_version
447
447
  end
448
448
 
449
449
  # Move the version to next and save the updated buildfile
450
450
  def update_buildfile
451
- buildfile = change_version { |version| # THIS_VERSION minus SNAPSHOT
451
+ buildfile = change_version { |version| # THIS_VERSION minus SNAPSHOT
452
452
  resolve_next_version(this_version) # THIS_VERSION
453
453
  }
454
454
  File.open(Buildr.application.buildfile.to_s, 'w') { |file| file.write buildfile }
@@ -512,7 +512,7 @@ module Buildr #:nodoc:
512
512
  info "Current version is now #{extract_version}"
513
513
  Hg.commit File.basename(Buildr.application.buildfile.to_s), message
514
514
  Hg.push if Hg.remote
515
- end
515
+ end
516
516
  end
517
517
 
518
518
 
@@ -198,10 +198,10 @@ module Buildr #:nodoc:
198
198
  end
199
199
 
200
200
  protected
201
-
201
+
202
202
  # :call-seq:
203
203
  # pattern_match(file, pattern) => boolean
204
- #
204
+ #
205
205
  # This method returns true if the file name matches the pattern.
206
206
  # The pattern may be a String, a Regexp or a Proc.
207
207
  #
@@ -219,7 +219,7 @@ module Buildr #:nodoc:
219
219
  raise "Cannot interpret pattern #{pattern}"
220
220
  end
221
221
  end
222
-
222
+
223
223
  private
224
224
  def copy_map
225
225
  sources.each { |source| raise "Source directory #{source} doesn't exist" unless File.exist?(source.to_s) }
@@ -39,4 +39,3 @@ module Buildr #:nodoc:
39
39
  end
40
40
  end
41
41
  end
42
-
@@ -26,4 +26,3 @@ if $stdout.isatty && verbose
26
26
  Buildr.application.on_failure { |title, message, ex| notify_send(:failed, title, message) if verbose }
27
27
  end
28
28
  end
29
-
@@ -36,4 +36,3 @@ module Buildr #:nodoc:
36
36
  end
37
37
 
38
38
  Buildr::Run.runners << Buildr::Run::JavaRunner
39
-
@@ -128,4 +128,3 @@ end
128
128
 
129
129
  Buildr::Shell.providers << Buildr::Shell::BeanShell
130
130
  Buildr::Shell.providers << Buildr::Shell::JIRB
131
-
@@ -70,4 +70,3 @@ module Buildr #:nodoc:
70
70
  end
71
71
 
72
72
  Buildr::Doc.engines << Buildr::Doc::Groovydoc
73
-
@@ -534,5 +534,3 @@ class Buildr::Project
534
534
  include Buildr::Eclipse::Scala
535
535
  include Buildr::Eclipse::Java
536
536
  end
537
-
538
-
@@ -658,7 +658,9 @@ module Buildr #:nodoc:
658
658
  end
659
659
 
660
660
  def add_default_configuration(type, factory_name)
661
- add_configuration(nil, type, factory_name)
661
+ add_configuration(nil, type, factory_name, true) do |xml|
662
+ yield xml if block_given?
663
+ end
662
664
  end
663
665
 
664
666
  def add_postgres_data_source(name, options = {})
@@ -837,6 +839,40 @@ module Buildr #:nodoc:
837
839
  end
838
840
  end
839
841
 
842
+ def add_default_testng_configuration(options = {})
843
+ jvm_args = options[:jvm_args] || '-ea'
844
+ dir = options[:dir] || '$PROJECT_DIR$'
845
+
846
+ add_default_configuration('TestNG', 'TestNG') do |xml|
847
+ xml.extension(:name => 'coverage', :enabled => 'false', :merge => 'false', :sample_coverage => 'true', :runner => 'idea')
848
+ xml.module(:name => '')
849
+ xml.option(:name => 'ALTERNATIVE_JRE_PATH_ENABLED', :value => 'false')
850
+ xml.option(:name => 'ALTERNATIVE_JRE_PATH')
851
+ xml.option(:name => 'SUITE_NAME')
852
+ xml.option(:name => 'PACKAGE_NAME')
853
+ xml.option(:name => 'MAIN_CLASS_NAME')
854
+ xml.option(:name => 'METHOD_NAME')
855
+ xml.option(:name => 'GROUP_NAME')
856
+ xml.option(:name => 'TEST_OBJECT', :value => 'CLASS')
857
+ xml.option(:name => 'VM_PARAMETERS', :value => jvm_args)
858
+ xml.option(:name => 'PARAMETERS')
859
+ xml.option(:name => 'WORKING_DIRECTORY', :value => dir)
860
+ xml.option(:name => 'OUTPUT_DIRECTORY')
861
+ xml.option(:name => 'ANNOTATION_TYPE')
862
+ xml.option(:name => 'ENV_VARIABLES')
863
+ xml.option(:name => 'PASS_PARENT_ENVS', :value => 'true')
864
+ xml.option(:name => 'TEST_SEARCH_SCOPE') do |opt|
865
+ opt.value(:defaultName => 'moduleWithDependencies')
866
+ end
867
+ xml.option(:name => 'USE_DEFAULT_REPORTERS', :value => 'false')
868
+ xml.option(:name => 'PROPERTIES_FILE')
869
+ xml.envs
870
+ xml.properties
871
+ xml.listeners
872
+ xml.method
873
+ end
874
+ end
875
+
840
876
  protected
841
877
 
842
878
  def artifact_content(xml, project, projects, options)
@@ -942,13 +978,13 @@ module Buildr #:nodoc:
942
978
  end
943
979
  end
944
980
 
945
- if mappings.size > 1
946
- create_component("VcsDirectoryMappings") do |xml|
947
- mappings.each_pair do |dir, vcs_type|
948
- resolved_dir = resolve_path(dir)
949
- mapped_dir = resolved_dir == '$PROJECT_DIR$/.' ? buildr_project.base_dir : resolved_dir
950
- xml.mapping :directory => mapped_dir, :vcs => vcs_type
951
- end
981
+ return nil if 0 == mappings.size
982
+
983
+ create_component("VcsDirectoryMappings") do |xml|
984
+ mappings.each_pair do |dir, vcs_type|
985
+ resolved_dir = resolve_path(dir)
986
+ mapped_dir = resolved_dir == '$PROJECT_DIR$/.' ? buildr_project.base_dir : resolved_dir
987
+ xml.mapping :directory => mapped_dir, :vcs => vcs_type
952
988
  end
953
989
  end
954
990
  end
@@ -342,4 +342,3 @@ end
342
342
 
343
343
  Buildr::TestFramework << Buildr::RSpec
344
344
  Buildr::TestFramework << Buildr::JBehave
345
-
@@ -110,7 +110,7 @@ module Java
110
110
  # set new cmd line.
111
111
  cmd_args = [tmp.path]
112
112
  end
113
-
113
+
114
114
  unless Buildr.application.options.dryrun
115
115
  info "Running #{name}" if name && options[:verbose]
116
116
  block = lambda { |ok, res| fail "Failed to execute #{name}, see errors above" unless ok } unless block
@@ -121,7 +121,7 @@ module Java
121
121
  end
122
122
  ensure
123
123
  unless tmp.nil?
124
- tmp.close
124
+ tmp.close
125
125
  tmp.unlink
126
126
  end
127
127
  end
@@ -281,4 +281,3 @@ module Java
281
281
  end
282
282
 
283
283
  end
284
-
@@ -57,10 +57,10 @@ module Java
57
57
  # Since we already have a JVM loaded, we can use it to guess where JAVA_HOME is.
58
58
  # We set JAVA_HOME early so we can use it without calling Java.load first.
59
59
  ENV['JAVA_HOME'] ||= java.lang.System.getProperty("java.home")
60
-
60
+
61
61
  # This version is the minimal version Buildr will support.
62
62
  # Any older version of JRuby will raise an exception.
63
- JRUBY_MIN_VERSION = '1.5.1'
63
+ JRUBY_MIN_VERSION = '1.5.1'
64
64
  raise "JRuby must be at least at version #{JRUBY_MIN_VERSION}" unless JRUBY_VERSION >= JRUBY_MIN_VERSION
65
65
 
66
66
  class << self
@@ -71,7 +71,7 @@ public class JavaTestFilter {
71
71
  }
72
72
  return this;
73
73
  }
74
-
74
+
75
75
  public JavaTestFilter addFields(String[] names) {
76
76
  for (int i = names.length; i -- > 0;) {
77
77
  String name = names[i];
@@ -79,7 +79,7 @@ public class JavaTestFilter {
79
79
  }
80
80
  return this;
81
81
  }
82
-
82
+
83
83
  private boolean isTest(Class cls) {
84
84
  if (Modifier.isAbstract(cls.getModifiers()) || !Modifier.isPublic(cls.getModifiers()))
85
85
  return false;
@@ -89,12 +89,12 @@ public class JavaTestFilter {
89
89
  if (iface.isAssignableFrom(cls)) { return true; }
90
90
  }
91
91
  }
92
- if (classAnnotations != null) {
92
+ if (classAnnotations != null) {
93
93
  for (Iterator it = classAnnotations.iterator(); it.hasNext(); ) {
94
94
  Class annotation = (Class) it.next();
95
95
  if (cls.isAnnotationPresent(annotation)) { return true; }
96
96
  }
97
- }
97
+ }
98
98
  if (methodAnnotations != null) {
99
99
  Method[] methods = cls.getMethods();
100
100
  for (int j = methods.length ; j-- > 0 ;) {
@@ -134,7 +134,7 @@ public class JavaTestFilter {
134
134
 
135
135
  }
136
136
 
137
- /*
137
+ /*
138
138
  * Local Variables:
139
139
  * indent-tabs-mode: nil
140
140
  * c-basic-offset: 2
@@ -428,4 +428,3 @@ end # Buildr
428
428
  Buildr::TestFramework << Buildr::JUnit
429
429
  Buildr::TestFramework << Buildr::TestNG
430
430
  Buildr::TestFramework << Buildr::MultiTest
431
-
@@ -1007,5 +1007,3 @@ module Buildr #:nodoc:
1007
1007
  end
1008
1008
 
1009
1009
  end
1010
-
1011
-
@@ -1,17 +1,14 @@
1
-
2
- MouseRunner.com Green/Red icons
3
- -------------------------------
4
-
5
- The graphics contained in the 'completed.png' and 'failed.png' files are
6
- licensed under the Creative Commons Attribution-ShareAlike 2.5 License
7
-
8
- Furthermore,
9
- You may not claim the works as your own.
10
- You must provide a link back to www.MouseRunner.com when using on a website,
11
- for commercial purposes, and for applications.
12
-
13
- Visit the address below to learn more about the Creative Commons license.
14
- http://creativecommons.org/licenses/by-nc-sa/2.5/legalcode
15
-
16
-
17
-
1
+
2
+ MouseRunner.com Green/Red icons
3
+ -------------------------------
4
+
5
+ The graphics contained in the 'completed.png' and 'failed.png' files are
6
+ licensed under the Creative Commons Attribution-ShareAlike 2.5 License
7
+
8
+ Furthermore,
9
+ You may not claim the works as your own.
10
+ You must provide a link back to www.MouseRunner.com when using on a website,
11
+ for commercial purposes, and for applications.
12
+
13
+ Visit the address below to learn more about the Creative Commons license.
14
+ http://creativecommons.org/licenses/by-nc-sa/2.5/legalcode
@@ -253,4 +253,3 @@ end
253
253
 
254
254
  Buildr::TestFramework << Buildr::Scala::Specs
255
255
  Buildr::TestFramework << Buildr::Scala::Specs2
256
-
@@ -385,4 +385,3 @@ Buildr::Compiler.compilers.unshift Buildr::Scala::Scalac
385
385
  class Buildr::Project #:nodoc:
386
386
  include Buildr::Scala::ProjectExtension
387
387
  end
388
-
@@ -34,5 +34,3 @@ public class Specs2Runner {
34
34
  }
35
35
 
36
36
  }
37
-
38
-
@@ -14,5 +14,5 @@
14
14
  # the License.
15
15
 
16
16
  module Buildr #:nodoc:
17
- VERSION = '1.4.16'.freeze
17
+ VERSION = '1.4.17'.freeze
18
18
  end
@@ -22,12 +22,12 @@ namespace 'metrics' do
22
22
  base_dir = Pathname.new(File.expand_path(File.join(File.dirname(__FILE__), '..')))
23
23
  rb_files = %w(lib addon).collect { |folder|
24
24
  FileList[File.expand_path(File.join(File.dirname(__FILE__), '..', folder, '**', '*.rb'))]
25
- }.flatten.collect {|path|
25
+ }.flatten.collect {|path|
26
26
  Pathname.new(path).relative_path_from(base_dir).to_s
27
27
  }
28
28
  SaikuroRunner.new.run(rb_files, output_dir)
29
29
  end
30
-
30
+
31
31
  desc 'generate ccn treemap'
32
32
  task 'ccn_treemap' do
33
33
  require 'saikuro_treemap'
@@ -36,4 +36,4 @@ namespace 'metrics' do
36
36
  end
37
37
 
38
38
  desc 'Run all metrics tools'
39
- task 'metrics' => %w(metrics:saikuro metrics:ccn_treemap)
39
+ task 'metrics' => %w(metrics:saikuro metrics:ccn_treemap)