buildr 1.3.5-java → 1.4.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. data/CHANGELOG +153 -8
  2. data/README.rdoc +1 -1
  3. data/addon/buildr/antlr.rb +5 -5
  4. data/addon/buildr/drb.rb +18 -18
  5. data/addon/buildr/hibernate.rb +18 -14
  6. data/addon/buildr/javacc.rb +4 -4
  7. data/addon/buildr/jetty.rb +5 -5
  8. data/addon/buildr/nailgun.rb +23 -23
  9. data/addon/buildr/openjpa.rb +1 -1
  10. data/addon/buildr/org/apache/buildr/BuildrNail$Main.class +0 -0
  11. data/addon/buildr/org/apache/buildr/BuildrNail.class +0 -0
  12. data/addon/buildr/org/apache/buildr/JettyWrapper$1.class +0 -0
  13. data/addon/buildr/org/apache/buildr/JettyWrapper$BuildrHandler.class +0 -0
  14. data/addon/buildr/org/apache/buildr/JettyWrapper.class +0 -0
  15. data/addon/buildr/protobuf.rb +75 -0
  16. data/addon/buildr/xmlbeans.rb +5 -5
  17. data/buildr.buildfile +2 -2
  18. data/buildr.gemspec +8 -7
  19. data/doc/_layouts/default.html +2 -2
  20. data/doc/artifacts.textile +4 -4
  21. data/doc/building.textile +35 -3
  22. data/doc/contributing.textile +5 -0
  23. data/doc/download.textile +16 -5
  24. data/doc/extending.textile +38 -12
  25. data/doc/installing.textile +6 -5
  26. data/doc/languages.textile +182 -42
  27. data/doc/more_stuff.textile +2 -2
  28. data/doc/packaging.textile +14 -15
  29. data/doc/projects.textile +7 -2
  30. data/doc/quick_start.textile +4 -4
  31. data/doc/scripts/buildr-git.rb +63 -63
  32. data/doc/scripts/gitflow.rb +21 -21
  33. data/doc/settings_profiles.textile +9 -2
  34. data/doc/testing.textile +16 -5
  35. data/etc/KEYS +38 -0
  36. data/lib/buildr.rb +1 -1
  37. data/lib/buildr/core.rb +1 -0
  38. data/lib/buildr/core/application.rb +33 -27
  39. data/lib/buildr/core/build.rb +41 -28
  40. data/lib/buildr/core/cc.rb +172 -0
  41. data/lib/buildr/core/checks.rb +1 -1
  42. data/lib/buildr/core/common.rb +7 -6
  43. data/lib/buildr/core/compile.rb +7 -8
  44. data/lib/buildr/core/doc.rb +263 -0
  45. data/lib/buildr/core/environment.rb +6 -6
  46. data/lib/buildr/core/filter.rb +77 -35
  47. data/lib/buildr/core/generate.rb +7 -7
  48. data/lib/buildr/core/help.rb +1 -1
  49. data/lib/buildr/core/osx.rb +6 -6
  50. data/lib/buildr/core/progressbar.rb +4 -4
  51. data/lib/buildr/core/project.rb +144 -36
  52. data/lib/buildr/core/shell.rb +34 -34
  53. data/lib/buildr/core/test.rb +89 -20
  54. data/lib/buildr/core/transports.rb +8 -7
  55. data/lib/buildr/core/util.rb +77 -23
  56. data/lib/buildr/groovy/bdd.rb +5 -5
  57. data/lib/buildr/groovy/compiler.rb +19 -15
  58. data/lib/buildr/groovy/shell.rb +6 -6
  59. data/lib/buildr/ide/eclipse.rb +148 -75
  60. data/lib/buildr/ide/eclipse/java.rb +3 -3
  61. data/lib/buildr/ide/eclipse/plugin.rb +8 -5
  62. data/lib/buildr/ide/eclipse/scala.rb +4 -2
  63. data/lib/buildr/ide/idea.rb +2 -2
  64. data/lib/buildr/ide/idea7x.rb +23 -4
  65. data/lib/buildr/java.rb +1 -0
  66. data/lib/buildr/java/ant.rb +4 -4
  67. data/lib/buildr/java/bdd.rb +51 -54
  68. data/lib/buildr/java/cobertura.rb +57 -35
  69. data/lib/buildr/java/commands.rb +14 -5
  70. data/lib/buildr/java/compiler.rb +3 -217
  71. data/lib/buildr/java/deprecated.rb +4 -4
  72. data/lib/buildr/java/doc.rb +70 -0
  73. data/lib/buildr/java/emma.rb +22 -22
  74. data/lib/buildr/java/jruby.rb +4 -4
  75. data/lib/buildr/java/jtestr_runner.rb.erb +27 -25
  76. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.class +0 -0
  77. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.java +8 -3
  78. data/lib/buildr/java/packaging.rb +30 -29
  79. data/lib/buildr/java/pom.rb +4 -4
  80. data/lib/buildr/java/rjb.rb +6 -6
  81. data/lib/buildr/java/test_result.rb +61 -85
  82. data/lib/buildr/java/tests.rb +44 -27
  83. data/lib/buildr/java/version_requirement.rb +8 -8
  84. data/lib/buildr/packaging/archive.rb +55 -22
  85. data/lib/buildr/packaging/artifact.rb +75 -36
  86. data/lib/buildr/packaging/artifact_namespace.rb +90 -78
  87. data/lib/buildr/packaging/artifact_search.rb +5 -5
  88. data/lib/buildr/packaging/gems.rb +11 -7
  89. data/lib/buildr/packaging/package.rb +10 -7
  90. data/lib/buildr/packaging/tar.rb +14 -14
  91. data/lib/buildr/packaging/version_requirement.rb +30 -10
  92. data/lib/buildr/packaging/ziptask.rb +51 -13
  93. data/lib/buildr/scala.rb +1 -0
  94. data/lib/buildr/scala/bdd.rb +25 -20
  95. data/lib/buildr/scala/compiler.rb +87 -40
  96. data/lib/buildr/scala/doc.rb +106 -0
  97. data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.class +0 -0
  98. data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.java +57 -0
  99. data/lib/buildr/scala/shell.rb +14 -9
  100. data/lib/buildr/scala/tests.rb +33 -26
  101. data/lib/buildr/shell.rb +33 -33
  102. data/rakelib/all-in-one.rake +113 -0
  103. data/rakelib/checks.rake +1 -1
  104. data/rakelib/doc.rake +7 -0
  105. data/rakelib/package.rake +1 -1
  106. data/rakelib/release.rake +9 -6
  107. data/rakelib/rspec.rake +26 -7
  108. data/rakelib/setup.rake +15 -3
  109. data/rakelib/stage.rake +18 -11
  110. data/spec/addon/drb_spec.rb +25 -25
  111. data/spec/core/application_spec.rb +111 -21
  112. data/spec/core/build_spec.rb +16 -15
  113. data/spec/core/cc_spec.rb +174 -0
  114. data/spec/core/checks_spec.rb +34 -34
  115. data/spec/core/common_spec.rb +51 -5
  116. data/spec/core/compile_spec.rb +89 -14
  117. data/spec/core/extension_spec.rb +127 -19
  118. data/spec/core/generate_spec.rb +2 -2
  119. data/spec/core/project_spec.rb +10 -10
  120. data/spec/core/test_spec.rb +144 -35
  121. data/spec/core/transport_spec.rb +8 -8
  122. data/spec/core/util_spec.rb +63 -5
  123. data/spec/groovy/bdd_spec.rb +5 -5
  124. data/spec/groovy/compiler_spec.rb +29 -18
  125. data/spec/ide/eclipse_spec.rb +185 -9
  126. data/spec/ide/idea7x_spec.rb +22 -10
  127. data/spec/java/ant_spec.rb +9 -5
  128. data/spec/java/bdd_spec.rb +29 -37
  129. data/spec/java/cobertura_spec.rb +12 -12
  130. data/spec/java/commands_spec.rb +34 -0
  131. data/spec/java/compiler_spec.rb +53 -53
  132. data/spec/java/emma_spec.rb +11 -11
  133. data/spec/java/java_spec.rb +10 -10
  134. data/spec/java/packaging_spec.rb +67 -20
  135. data/spec/java/test_coverage_helper.rb +18 -18
  136. data/spec/java/tests_spec.rb +13 -9
  137. data/spec/packaging/archive_spec.rb +187 -20
  138. data/spec/packaging/artifact_namespace_spec.rb +172 -83
  139. data/spec/packaging/artifact_spec.rb +83 -18
  140. data/spec/packaging/packaging_spec.rb +41 -14
  141. data/spec/sandbox.rb +23 -12
  142. data/spec/scala/bdd_spec.rb +13 -8
  143. data/spec/scala/compiler_spec.rb +18 -13
  144. data/spec/scala/scala.rb +3 -3
  145. data/spec/scala/tests_spec.rb +46 -24
  146. data/spec/spec_helpers.rb +28 -10
  147. data/spec/version_requirement_spec.rb +25 -11
  148. metadata +148 -132
  149. data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner$.class +0 -0
  150. data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.scala +0 -35
  151. data/rakelib/stage.rake~ +0 -213
@@ -71,7 +71,7 @@ module Java
71
71
  def classpath
72
72
  @classpath ||= []
73
73
  end
74
-
74
+
75
75
  # Most platforms requires tools.jar to be on the classpath, tools.jar contains the
76
76
  # Java compiler (OS X and AIX are two exceptions we know about, may be more).
77
77
  # Guess where tools.jar is from JAVA_HOME, which hopefully points to the JDK,
@@ -101,13 +101,13 @@ module Java
101
101
 
102
102
  # Most platforms requires tools.jar to be on the classpath.
103
103
  add_path[tools_jar] if tools_jar
104
-
105
- classpath.map! { |path| Proc === path ? path.call : path }
104
+
105
+ classpath.map! { |path| Proc === path ? path.call : path }
106
106
  Buildr.artifacts(classpath).map(&:to_s).each do |path|
107
107
  file(path).invoke
108
108
  add_path[path]
109
109
  end
110
-
110
+
111
111
  @loaded = true
112
112
  self
113
113
  end
@@ -13,12 +13,12 @@
13
13
  # License for the specific language governing permissions and limitations under
14
14
  # the License.
15
15
 
16
- # ___ ___ _ _ ___ _____ ___ ___ ___ _____ _____ _ _ ___ ___
16
+ # ___ ___ _ _ ___ _____ ___ ___ ___ _____ _____ _ _ ___ ___
17
17
  # | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _| |_ _| || |_ _/ __|
18
18
  # | |) | (_) | | .` | (_) || | | _|| |) | | | | | | | __ || |\__ \
19
19
  # |___/ \___/ |_|\_|\___/ |_| |___|___/___| |_| |_| |_||_|___|___/
20
- #
21
- # ___ ___ _ ___
20
+ #
21
+ # ___ ___ _ ___
22
22
  # | __|_ _| | | __| CHANGES TO THIS FILE WILL BE LOST
23
23
  # | _| | || |__| _| AUTO-GENERATED BY BUILDR on <%= Time.now %>
24
24
  # |_| |___|____|___| PREFER TO EDIT JtestR CONFIGURATION FILE:
@@ -31,46 +31,46 @@ begin
31
31
  <%= dependencies.map(&:to_s).inspect %>.each { |dep| $CLASSPATH << dep }
32
32
  <%= runner.gems.inspect %>.each { |ary| JRuby.gem(*ary.flatten) }
33
33
  <%= runner.requires.inspect %>.each { |rb| Kernel.require rb }
34
-
34
+
35
35
  jtestr = JtestR::TestRunner.new
36
-
36
+
37
37
  class << jtestr
38
38
  def config(&block)
39
39
  @config_blocks ||= []
40
40
  @config_blocks << block if block
41
41
  @config_blocks
42
42
  end
43
-
43
+
44
44
  def load_configuration
45
45
  super
46
46
  config.each { |block| @configuration.instance_eval(&block) }
47
47
  end
48
48
  end
49
-
50
- jtestr.config do
49
+
50
+ jtestr.config do
51
51
  classpath [] # already loaded
52
52
  add_common_classpath false
53
-
53
+
54
54
  <% ts = ( @jtestr_tests[:junit] & tests ).map { |c| 'Java.' + c } %>
55
55
  junit [<%= ts.join(', ') %>]
56
-
56
+
57
57
  <% ts = ( @jtestr_tests[:testng] & tests ).map { |c| 'Java.' + c } %>
58
58
  testng [<%= ts.join(', ') %>]
59
-
59
+
60
60
  <% ts = @jtestr_tests[:testunit] & tests %>
61
61
  test_unit <%= ts.inspect %>
62
-
62
+
63
63
  <% ts = @jtestr_tests[:story] & tests %>
64
64
  story <%= ts.inspect %>
65
-
65
+
66
66
  <% ts = @jtestr_tests[:rspec] & tests %>
67
67
  rspec <%= ts.inspect %>
68
-
68
+
69
69
  <% ts = @jtestr_tests[:expect] & tests %>
70
70
  expectations <%= ts.inspect %>
71
-
71
+
72
72
  ignore __FILE__
73
-
73
+
74
74
  if File.file?(<%= user_config.inspect %>)
75
75
  ignore <%= user_config.inspect %>
76
76
  load <%= user_config.inspect %>
@@ -86,21 +86,23 @@ begin
86
86
  <% else %>
87
87
  output = STDOUT
88
88
  <% end %>
89
-
90
-
89
+
90
+
91
91
  args = [ '<%= spec_dir %>', # the directory to search for jtestr files
92
- JtestR::SimpleLogger::ERR, # log level
93
- JtestR::GenericResultHandler::QUIET, #output level
92
+ JtestR::SimpleLogger::ERR, # log level (DEBUG/WARN/ERR)
93
+ JtestR::GenericResultHandler::QUIET, #output level (QUIET/VERBOSE)
94
94
  fake_out, # output STDOUT
95
- [], # groups to run
95
+ [], # groups to run
96
+ # Use JtestR::GenericResultHandler for debugging
96
97
  Buildr::TestFramework::TestResult::RSpecResultHandler, # result handler
97
98
  [] # classpath
98
99
  ]
99
-
100
+
100
101
  argv = <%= runner.rspec.inspect %> || []
101
102
  argv.push *<%= tests.inspect %>
102
103
  Buildr::TestFramework::TestResult::RSpecResultHandler.init(argv, output, output)
103
-
104
+ Buildr::TestFramework::TestResult::RSpecResultHandler.test_files = <%= tests.inspect %>
105
+
104
106
  jtestr.run *args
105
107
 
106
108
  rescue => e
@@ -109,8 +111,8 @@ rescue => e
109
111
  end
110
112
 
111
113
  exit 0 # let buildr find the erros from the result yaml
112
-
114
+
113
115
  # Local Variables:
114
116
  # mode: ruby
115
117
  # End:
116
-
118
+
@@ -116,11 +116,16 @@ public class JavaTestFilter {
116
116
  }
117
117
 
118
118
 
119
- public String[] filter(String[] names) throws ClassNotFoundException {
119
+ public String[] filter(String[] names) throws Throwable {
120
120
  Vector testCases = new Vector();
121
121
  for (int i = names.length ; i-- > 0 ;) {
122
- Class cls = _loader.loadClass(names[i]);
123
- if (isTest(cls)) { testCases.add(names[i]); }
122
+ try {
123
+ Class cls = _loader.loadClass(names[i]);
124
+ if (isTest(cls)) { testCases.add(names[i]); }
125
+ } catch (Throwable e) {
126
+ System.err.println("JavaTestFilter: Unable to load class "+names[i]+" to determine testing ability");
127
+ throw e;
128
+ }
124
129
  }
125
130
  String[] result = new String[testCases.size()];
126
131
  testCases.toArray(result);
@@ -166,18 +166,19 @@ module Buildr
166
166
  @prerequisites << manifest if String === manifest || Rake::Task === manifest
167
167
  [meta_inf].flatten.map { |file| file.to_s }.uniq.each { |file| path('META-INF').include file }
168
168
  end
169
-
169
+
170
170
  enhance do
171
171
  if manifest
172
172
  # Tempfiles gets deleted on garbage collection, so we're going to hold on to it
173
173
  # through instance variable not closure variable.
174
174
  @manifest_tmp = Tempfile.new('MANIFEST.MF')
175
+ File.chmod 0644, @manifest_tmp.path
175
176
  self.manifest = File.read(manifest.to_s) if String === manifest || Rake::Task === manifest
176
177
  self.manifest = Manifest.new(manifest) unless Manifest === manifest
177
178
  #@manifest_tmp.write Manifest::STANDARD_HEADER
178
179
  @manifest_tmp.write manifest.to_s
179
180
  @manifest_tmp.write "\n"
180
- @manifest_tmp.rewind
181
+ @manifest_tmp.close
181
182
  path('META-INF').include @manifest_tmp.path, :as=>'MANIFEST.MF'
182
183
  end
183
184
  end
@@ -217,7 +218,7 @@ module Buildr
217
218
  # :call-seq:
218
219
  # with(options) => self
219
220
  #
220
- # Additional
221
+ # Additional
221
222
  # Pass options to the task. Returns self. ZipTask itself does not support any options,
222
223
  # but other tasks (e.g. JarTask, WarTask) do.
223
224
  #
@@ -225,7 +226,8 @@ module Buildr
225
226
  # package(:jar).with(:manifest=>'MANIFEST_MF')
226
227
  def with(*args)
227
228
  super args.pop if Hash === args.last
228
- include :from=>args
229
+ fail "package.with() should not contain nil values" if args.include? nil
230
+ include :from=>args if args.size > 0
229
231
  self
230
232
  end
231
233
 
@@ -267,7 +269,7 @@ module Buildr
267
269
  def classes=(value) #:nodoc:
268
270
  @classes = [value].flatten.map { |dir| file(dir.to_s) }
269
271
  end
270
-
272
+
271
273
  end
272
274
 
273
275
 
@@ -340,18 +342,18 @@ module Buildr
340
342
  # * :map -- A Hash used to map component type to paths within the EAR.
341
343
  # By default each component type is mapped to a directory with the same name,
342
344
  # for example, EJBs are stored in the /ejb path. To customize:
343
- # package(:ear).map[:war] = 'web-applications'
345
+ # package(:ear).map[:war] = 'web-applications'
344
346
  # package(:ear).map[:lib] = nil # store shared libraries on root of archive
345
347
  #
346
348
  # EAR components are added by means of the EarTask#add, EarTask#<<, EarTask#push methods
347
- # Component type is determined from the artifact's type.
349
+ # Component type is determined from the artifact's type.
348
350
  #
349
351
  # package(:ear) << project('coolWebService').package(:war)
350
352
  #
351
353
  # The << method is just an alias for push, with the later you can add multiple components
352
- # at the same time. For example..
354
+ # at the same time. For example..
353
355
  #
354
- # package(:ear).push 'org.springframework:spring:jar:2.6',
356
+ # package(:ear).push 'org.springframework:spring:jar:2.6',
355
357
  # projects('reflectUtils', 'springUtils'),
356
358
  # project('coolerWebService').package(:war)
357
359
  #
@@ -363,7 +365,7 @@ module Buildr
363
365
  #
364
366
  # # will add an ejb entry for the-cool-ejb-2.5.jar in application.xml
365
367
  # package(:ear).add 'org.coolguys:the-cool-ejb:jar:2.5', :type=>:ejb
366
- # # A better syntax for this is:
368
+ # # A better syntax for this is:
367
369
  # package(:ear).add :ejb=>'org.coolguys:the-cool-ejb:jar:2.5'
368
370
  #
369
371
  # By default, every JAR package is assumed to be a library component, so you need to specify
@@ -372,13 +374,13 @@ module Buildr
372
374
  # For WebApplications (:war)s, you can customize the context-root that appears in application.xml.
373
375
  # The following example also specifies a different directory inside the EAR where to store the webapp.
374
376
  #
375
- # package(:ear).add project(:remoteService).package(:war),
377
+ # package(:ear).add project(:remoteService).package(:war),
376
378
  # :path=>'web-services', :context_root=>'/Some/URL/Path'
377
379
  #
378
380
  # [1] http://java.sun.com/j2ee/sdk_1.2.1/techdocs/guides/ejb/html/Overview5.html#10106
379
381
  # [2] http://java.sun.com/j2ee/verified/packaging.html
380
382
  class EarTask < JarTask
381
-
383
+
382
384
  SUPPORTED_TYPES = [:war, :ejb, :jar, :rar, :lib]
383
385
 
384
386
  # The display-name entry for application.xml
@@ -416,7 +418,7 @@ module Buildr
416
418
  rescue # not an artifact spec, it must me a filename
417
419
  file(pkg)
418
420
  end
419
- else
421
+ else
420
422
  raise "Invalid EAR component #{pkg.class}: #{pkg}"
421
423
  end
422
424
  end
@@ -438,7 +440,7 @@ module Buildr
438
440
  end
439
441
  raise "Unknown EAR component type: #{type}. Perhaps you may explicity tell what component type to use." unless
440
442
  SUPPORTED_TYPES.include?(type)
441
- component = options.merge(:artifact => artifact, :type => type,
443
+ component = options.merge(:artifact => artifact, :type => type,
442
444
  :id=>artifact.respond_to?(:to_spec) ? artifact.id : artifact.to_s.pathmap('%n'),
443
445
  :path=>options[:path] || dirs[type].to_s)
444
446
  component[:clone] = component_clone(component) unless :lib == type
@@ -448,7 +450,7 @@ module Buildr
448
450
  end
449
451
  self
450
452
  end
451
-
453
+
452
454
  alias_method :push, :add
453
455
  alias_method :<<, :push
454
456
 
@@ -482,7 +484,7 @@ module Buildr
482
484
 
483
485
  def update_classpath(component)
484
486
  package = file(component[:artifact].to_s)
485
- package.manifest = (package.manifest || {}).dup # avoid mofifying parent projects manifest
487
+ package.manifest = (package.manifest || {}).dup # avoid mofifying parent projects manifest
486
488
  package.prepare do
487
489
  header = case package.manifest
488
490
  when Hash then package.manifest
@@ -506,7 +508,7 @@ module Buildr
506
508
  def libs_classpath(component)
507
509
  from = component[:path]
508
510
  @classpath = @components.select { |comp| comp[:type] == :lib }.
509
- map do |lib|
511
+ map do |lib|
510
512
  basename = lib[:artifact].to_s.pathmap('%f')
511
513
  full_path = lib[:path].empty? ? basename : File.join(lib[:path], basename)
512
514
  Util.relative_path(full_path, from)
@@ -516,7 +518,7 @@ module Buildr
516
518
  def descriptor_xml
517
519
  buffer = ""
518
520
  xml = Builder::XmlMarkup.new(:target=>buffer, :indent => 2)
519
- xml.declare! :DOCTYPE, :application, :PUBLIC,
521
+ xml.declare! :DOCTYPE, :application, :PUBLIC,
520
522
  "-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN",
521
523
  "http://java.sun.com/j2ee/dtds/application_1_2.dtd"
522
524
  xml.application do
@@ -527,7 +529,7 @@ module Buildr
527
529
  case comp[:type]
528
530
  when :war
529
531
  xml.module :id=>comp[:id] do
530
- xml.web do
532
+ xml.web do
531
533
  xml.tag! 'web-uri', uri
532
534
  xml.tag! 'context-root', File.join('', (comp[:context_root] || comp[:id])) unless comp[:context_root] == false
533
535
  end
@@ -543,7 +545,7 @@ module Buildr
543
545
  end
544
546
  buffer
545
547
  end
546
-
548
+
547
549
  # return a FileTask to build the ear application.xml file
548
550
  def descriptor
549
551
  return @descriptor if @descriptor
@@ -559,7 +561,7 @@ module Buildr
559
561
  def xml
560
562
  @xml ||= ear.send :descriptor_xml
561
563
  end
562
-
564
+
563
565
  def needed?
564
566
  super || xml != File.read(self.to_s) rescue true
565
567
  end
@@ -567,18 +569,17 @@ module Buildr
567
569
  @descriptor.ear = self
568
570
  @descriptor
569
571
  end
570
-
572
+
571
573
  end
572
574
 
573
575
 
574
576
  include Extension
575
577
 
576
- before_define do |project|
577
- ::Java.load
578
- if project.parent && project.parent.manifest
578
+ before_define(:package => :build) do |project|
579
+ if project.parent && project.parent.manifest
579
580
  project.manifest = project.parent.manifest.dup
580
581
  else
581
- project.manifest = {
582
+ project.manifest = {
582
583
  'Build-By'=>ENV['USER'], 'Build-Jdk'=>ENV_JAVA['java.version'],
583
584
  'Implementation-Title'=>project.comment || project.name,
584
585
  'Implementation-Version'=>project.version }
@@ -681,7 +682,7 @@ module Buildr
681
682
  Java::AarTask.define_task(file_name).tap do |aar|
682
683
  aar.with :manifest=>manifest, :meta_inf=>meta_inf
683
684
  aar.with :wsdls=>path_to(:source, :main, :axis2, '*.wsdl')
684
- aar.with :services_xml=>path_to(:source, :main, :axis2, 'services.xml')
685
+ aar.with :services_xml=>path_to(:source, :main, :axis2, 'services.xml')
685
686
  aar.with [compile.target, resources.target].compact
686
687
  aar.with :libs=>compile.dependencies
687
688
  end
@@ -700,8 +701,8 @@ module Buildr
700
701
 
701
702
  def package_as_javadoc(file_name) #:nodoc:
702
703
  ZipTask.define_task(file_name).tap do |zip|
703
- zip.include :from=>javadoc.target
704
- javadoc.options[:windowtitle] ||= project.comment || project.name
704
+ zip.include :from=>doc.target
705
+ doc.options[:windowtitle] ||= project.comment || project.name
705
706
  end
706
707
  end
707
708
 
@@ -28,7 +28,7 @@ module Buildr
28
28
  attr_reader :parent
29
29
 
30
30
  class << self
31
-
31
+
32
32
  # :call-seq:
33
33
  # POM.load(arg)
34
34
  #
@@ -82,8 +82,8 @@ module Buildr
82
82
  unless depends = @depends_for_scopes[scopes]
83
83
  declared = project["dependencies"].first["dependency"] rescue nil
84
84
  depends = (declared || []).reject { |dep| value_of(dep["optional"]) =~ /true/ }.
85
- map { |dep|
86
- spec = pom_to_hash(dep, properties)
85
+ map { |dep|
86
+ spec = pom_to_hash(dep, properties)
87
87
  apply = managed(spec)
88
88
  spec = apply.merge(spec) if apply
89
89
 
@@ -93,7 +93,7 @@ module Buildr
93
93
 
94
94
  exclusions = dep["exclusions"]["exclusion"] rescue nil
95
95
  transitive_deps = POM.load(spec).dependencies(SCOPES_TRANSITIVE)
96
- transitive_deps = transitive_deps.reject{|dep|
96
+ transitive_deps = transitive_deps.reject{|dep|
97
97
  exclusions.find {|ex| dep.index("#{dep['groupdId'].first}:#{dep['artifactId'].first}:") == 0}
98
98
  } if exclusions
99
99
 
@@ -71,13 +71,13 @@ module Java
71
71
  end
72
72
 
73
73
  end
74
-
74
+
75
75
  # On OS X we know where the default JDK is. We can try to guess for other OS.
76
76
  # We set JAVA_HOME early so we can use it without calling Java.load first.
77
77
  ENV['JAVA_HOME'] ||= '/System/Library/Frameworks/JavaVM.framework/Home' if Config::CONFIG['host_os'] =~ /darwin/i
78
78
 
79
79
  class << self
80
-
80
+
81
81
  # Returns the classpath, an array listing directories, JAR files and
82
82
  # artifacts. Use when loading the extension to add any additional
83
83
  # libraries used by that extension.
@@ -87,7 +87,7 @@ module Java
87
87
  def classpath
88
88
  @classpath ||= []
89
89
  end
90
-
90
+
91
91
  # Most platforms requires tools.jar to be on the classpath, tools.jar contains the
92
92
  # Java compiler (OS X and AIX are two exceptions we know about, may be more).
93
93
  # Guess where tools.jar is from JAVA_HOME, which hopefully points to the JDK,
@@ -99,7 +99,7 @@ module Java
99
99
  find { |path| File.exist?(path) }
100
100
  end
101
101
  end
102
-
102
+
103
103
  # Loads the JVM and all the libraries listed on the classpath. Call this
104
104
  # method before accessing any Java class, but only call it from methods
105
105
  # used in the build, giving the Buildfile a chance to load all extensions
@@ -107,14 +107,14 @@ module Java
107
107
  def load
108
108
  return self if @loaded
109
109
  classpath << tools_jar if tools_jar
110
-
110
+
111
111
  classpath.map! { |path| Proc === path ? path.call : path }
112
112
  cp = Buildr.artifacts(classpath).map(&:to_s).each { |path| file(path).invoke }
113
113
  java_opts = (ENV['JAVA_OPTS'] || ENV['JAVA_OPTIONS']).to_s.split
114
114
  ::Rjb.load cp.join(File::PATH_SEPARATOR), java_opts
115
115
 
116
116
  props = ::Rjb.import('java.lang.System').getProperties
117
- enum = props.propertyNames
117
+ enum = props.propertyNames
118
118
  while enum.hasMoreElements
119
119
  name = enum.nextElement.toString
120
120
  ENV_JAVA[name] = props.getProperty(name)