buildr 1.4.25-java → 1.5.0.dev2-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +50 -0
  3. data/NOTICE +1 -1
  4. data/README.rdoc +1 -1
  5. data/addon/buildr/bnd.rb +0 -6
  6. data/addon/buildr/custom_pom.rb +6 -0
  7. data/addon/buildr/org/apache/buildr/BuildrNail$Main.class +0 -0
  8. data/addon/buildr/org/apache/buildr/BuildrNail.class +0 -0
  9. data/addon/buildr/org/apache/buildr/JettyWrapper$1.class +0 -0
  10. data/addon/buildr/org/apache/buildr/JettyWrapper$BuildrHandler.class +0 -0
  11. data/addon/buildr/org/apache/buildr/JettyWrapper.class +0 -0
  12. data/addon/buildr/wsgen.rb +27 -27
  13. data/buildr.buildfile +1 -1
  14. data/buildr.gemspec +13 -9
  15. data/doc/_config.yml +3 -1
  16. data/doc/_layouts/default.html +1 -1
  17. data/doc/artifacts.textile +42 -0
  18. data/doc/download.textile +18 -6
  19. data/doc/languages.textile +15 -1
  20. data/doc/packaging.textile +1 -1
  21. data/doc/preface.textile +1 -1
  22. data/doc/projects.textile +13 -0
  23. data/doc/releasing.textile +14 -0
  24. data/doc/settings_profiles.textile +4 -0
  25. data/lib/buildr.rb +1 -0
  26. data/lib/buildr/core/application.rb +2 -3
  27. data/lib/buildr/core/build.rb +21 -34
  28. data/lib/buildr/core/compile.rb +0 -12
  29. data/lib/buildr/core/filter.rb +7 -0
  30. data/lib/buildr/core/generate.rb +1 -0
  31. data/lib/buildr/core/project.rb +14 -4
  32. data/lib/buildr/core/test.rb +2 -4
  33. data/lib/buildr/core/transports.rb +2 -0
  34. data/lib/buildr/groovy/bdd.rb +0 -7
  35. data/lib/buildr/ide/eclipse.rb +3 -3
  36. data/lib/buildr/java/ant.rb +0 -6
  37. data/lib/buildr/java/bdd.rb +0 -7
  38. data/lib/buildr/java/commands.rb +1 -1
  39. data/lib/buildr/java/deprecated.rb +0 -60
  40. data/lib/buildr/java/ecj.rb +16 -3
  41. data/lib/buildr/java/jruby.rb +19 -1
  42. data/lib/buildr/java/packaging.rb +4 -8
  43. data/lib/buildr/java/pom.rb +17 -12
  44. data/lib/buildr/java/rjb.rb +21 -3
  45. data/lib/buildr/java/tests.rb +0 -21
  46. data/lib/buildr/packaging/archive.rb +1 -1
  47. data/lib/buildr/packaging/artifact.rb +132 -3
  48. data/lib/buildr/packaging/zip.rb +32 -29
  49. data/lib/buildr/packaging/ziptask.rb +7 -5
  50. data/lib/buildr/scala.rb +0 -1
  51. data/lib/buildr/scala/bdd.rb +28 -122
  52. data/lib/buildr/scala/compiler.rb +24 -10
  53. data/lib/buildr/scala/doc.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 +4 -3
  56. data/lib/buildr/scala/org/apache/buildr/ZincRunner.class +0 -0
  57. data/lib/buildr/scala/org/apache/buildr/ZincRunner.java +37 -0
  58. data/lib/buildr/scala/tests.rb +18 -26
  59. data/lib/buildr/version.rb +1 -1
  60. data/spec/addon/bnd_spec.rb +5 -5
  61. data/spec/addon/custom_pom_spec.rb +38 -32
  62. data/spec/addon/jaxb_xjc_spec.rb +0 -4
  63. data/spec/core/application_spec.rb +4 -5
  64. data/spec/core/build_spec.rb +10 -51
  65. data/spec/core/common_spec.rb +7 -0
  66. data/spec/core/compile_spec.rb +0 -6
  67. data/spec/core/console_spec.rb +1 -1
  68. data/spec/core/generate_from_eclipse_spec.rb +22 -8
  69. data/spec/core/project_spec.rb +34 -70
  70. data/spec/core/test_spec.rb +6 -9
  71. data/spec/core/transport_spec.rb +16 -7
  72. data/spec/groovy/compiler_spec.rb +2 -2
  73. data/spec/java/ant_spec.rb +0 -5
  74. data/spec/java/compiler_spec.rb +4 -4
  75. data/spec/java/ecj_spec.rb +244 -45
  76. data/spec/java/java_spec.rb +7 -9
  77. data/spec/java/packaging_spec.rb +23 -23
  78. data/spec/java/pom_spec.rb +37 -0
  79. data/spec/java/tests_spec.rb +0 -5
  80. data/spec/packaging/archive_spec.rb +1 -1
  81. data/spec/packaging/artifact_spec.rb +129 -7
  82. data/spec/packaging/packaging_spec.rb +1 -1
  83. data/spec/sandbox.rb +2 -2
  84. data/spec/scala/bdd_spec.rb +0 -101
  85. data/spec/scala/compiler_spec.rb +20 -16
  86. data/spec/scala/doc_spec.rb +0 -11
  87. data/spec/scala/tests_spec.rb +6 -15
  88. data/spec/spec_helpers.rb +1 -1
  89. data/spec/xpath_matchers.rb +2 -1
  90. metadata +30 -16
  91. data/addon/buildr/cobertura.rb +0 -21
  92. data/addon/buildr/emma.rb +0 -21
@@ -22,7 +22,7 @@ p(title). !images/zbuildr.png!
22
22
 
23
23
  p(preface). !images/asf-logo.png!
24
24
 
25
- Copyright 2007-2009 Apache Buildr
25
+ Copyright 2007-2016 Apache Buildr
26
26
 
27
27
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
28
28
 
@@ -64,6 +64,19 @@ A project definition requires four pieces of information: the project name, grou
64
64
 
65
65
  Everything else depends on what that particular project is building. And it all goes inside the project definition block, the piece of code that comes between @define <name> .. do@ and @end@.
66
66
 
67
+ h2(#instructions_order). Order is important
68
+ When defining your project, the order in which you place instructions matter.
69
+
70
+ For example, the project below will not pick up resources because they are defined after the package instruction.
71
+
72
+ {% highlight ruby %}
73
+ define 'testwar' do
74
+ project.version = 1.0
75
+ package(:war)
76
+ project.resources.from(_('src/main/java')).exclude('*.java')
77
+ end
78
+ {% endhighlight ruby %}
79
+
67
80
 
68
81
  h2(#dir_structure). The Directory Structure
69
82
 
@@ -113,6 +113,20 @@ end
113
113
 
114
114
  The environment variable @NEXT_VERSION@ has precedence over Release.next_version.
115
115
 
116
+ h3(#alternate_version_file). Using an alternate version file
117
+
118
+ To avoid dealing with conflicts over the Buildfile, you can store the version inside version.rb next to it.
119
+
120
+ version.rb:
121
+ {% highlight ruby %}
122
+ THIS_VERSION = "1.0.0-rc1"
123
+ {% endhighlight %}
124
+
125
+ Your Buildfile should import version.rb like so:
126
+ {% highlight ruby %}
127
+ require File.join(File.dirname(__FILE__), 'version.rb')
128
+ {% endhighlight %}
129
+
116
130
  h2(#custom_tag_and_msg). How to specify my own tag name and commit message?
117
131
 
118
132
  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@.
@@ -81,6 +81,10 @@ repositories:
81
81
  remote:
82
82
  - https://intra.net/maven2
83
83
  - http://example.com
84
+
85
+ # specify the corporate mirror
86
+ mirrors:
87
+ - http://www.corporateserver001.com/repo
84
88
 
85
89
  release_to:
86
90
  url: http://intra.net/maven2
@@ -76,6 +76,7 @@ require 'buildr/packaging/test_jar'
76
76
  require RUBY_PLATFORM == 'java' ? 'buildr/java/jruby' : 'buildr/java/rjb'
77
77
  require 'buildr/java/ant'
78
78
  require 'buildr/java/compiler'
79
+ require 'buildr/java/ecj'
79
80
  require 'buildr/java/external'
80
81
  require 'buildr/java/tests'
81
82
  require 'buildr/java/test_result'
@@ -106,8 +106,7 @@ module Buildr
106
106
 
107
107
  class Application < Rake::Application #:nodoc:
108
108
 
109
- # Deprecated: rakefile/Rakefile, removed in 1.5
110
- DEFAULT_BUILDFILES = ['buildfile', 'Buildfile', 'buildfile.rb', 'Buildfile.rb'] + DEFAULT_RAKEFILES
109
+ DEFAULT_BUILDFILES = ['buildfile', 'Buildfile', 'buildfile.rb', 'Buildfile.rb']
111
110
 
112
111
  attr_reader :rakefiles, :requires
113
112
  private :rakefiles, :requires
@@ -331,7 +330,7 @@ module Buildr
331
330
  ['--rules', "Trace the rules resolution.",
332
331
  lambda { |value| options.trace_rules = true }
333
332
  ],
334
- ['--no-search', '--nosearch', '-N', "Do not search parent directories for the Rakefile.",
333
+ ['--no-search', '--nosearch', '-N', "Do not search parent directories for the Buildfile.",
335
334
  lambda { |value| options.nosearch = true }
336
335
  ],
337
336
  ['--silent', '-s', "Like --quiet, but also suppresses the 'in directory' announcement.",
@@ -56,30 +56,6 @@ module Buildr #:nodoc:
56
56
 
57
57
  after_define(:build)
58
58
 
59
- # *Deprecated:* Use +path_to(:target)+ instead.
60
- def target
61
- Buildr.application.deprecated 'Use path_to(:target) instead'
62
- layout.expand(:target)
63
- end
64
-
65
- # *Deprecated:* Use Layout instead.
66
- def target=(dir)
67
- Buildr.application.deprecated 'Use Layout instead'
68
- layout[:target] = _(dir)
69
- end
70
-
71
- # *Deprecated:* Use +path_to(:reports)+ instead.
72
- def reports()
73
- Buildr.application.deprecated 'Use path_to(:reports) instead'
74
- layout.expand(:reports)
75
- end
76
-
77
- # *Deprecated:* Use Layout instead.
78
- def reports=(dir)
79
- Buildr.application.deprecated 'Use Layout instead'
80
- layout[:reports] = _(dir)
81
- end
82
-
83
59
  # :call-seq:
84
60
  # build(*prereqs) => task
85
61
  # build { |task| .. } => task
@@ -353,7 +329,7 @@ module Buildr #:nodoc:
353
329
  # Extract the current version number from the buildfile.
354
330
  # Raise an error if not found.
355
331
  def extract_version
356
- buildfile = File.read(Buildr.application.buildfile.to_s)
332
+ buildfile = File.read(version_file)
357
333
  buildfile.scan(THIS_VERSION_PATTERN)[0][2]
358
334
  rescue
359
335
  fail 'Looking for THIS_VERSION = "..." in your Buildfile, none found'
@@ -373,6 +349,17 @@ module Buildr #:nodoc:
373
349
 
374
350
  # the initial value of THIS_VERSION
375
351
  attr_accessor :this_version
352
+
353
+ # :call-seq:
354
+ # version_file()
355
+ # Provides the file containing the version of the project.
356
+ # If the project contains a version.rb file next to the Buildr build file,
357
+ # it is used. Otherwise, always use the buildfile.
358
+ def version_file
359
+ version_rb_file = File.dirname(Buildr.application.buildfile.to_s) + '/version.rb'
360
+ return version_rb_file if File.exists?(version_rb_file)
361
+ return Buildr.application.buildfile.to_s
362
+ end
376
363
 
377
364
  # :call-seq:
378
365
  # with_release_candidate_version() { |filename| ... }
@@ -390,7 +377,7 @@ module Buildr #:nodoc:
390
377
  # THIS_VERSION = 1.1.0
391
378
  # for the release buildfile.
392
379
  def with_release_candidate_version
393
- release_candidate_buildfile = Buildr.application.buildfile.to_s + '.next'
380
+ release_candidate_buildfile = version_file + '.next'
394
381
 
395
382
  release_candidate_buildfile_contents = change_version { |version|
396
383
  version.gsub(/-SNAPSHOT$/, "")
@@ -398,7 +385,7 @@ module Buildr #:nodoc:
398
385
  File.open(release_candidate_buildfile, 'w') { |file| file.write release_candidate_buildfile_contents }
399
386
  begin
400
387
  yield release_candidate_buildfile
401
- mv release_candidate_buildfile, Buildr.application.buildfile.to_s
388
+ mv release_candidate_buildfile, version_file
402
389
  ensure
403
390
  rm release_candidate_buildfile rescue nil
404
391
  end
@@ -415,7 +402,7 @@ module Buildr #:nodoc:
415
402
  def change_version
416
403
  current_version = extract_version
417
404
  new_version = yield(current_version)
418
- buildfile = File.read(Buildr.application.buildfile.to_s)
405
+ buildfile = File.read(version_file)
419
406
  buildfile.gsub(THIS_VERSION_PATTERN) { |ver| ver.sub(/(["']).*\1/, %Q{"#{new_version}"}) }
420
407
  end
421
408
 
@@ -451,7 +438,7 @@ module Buildr #:nodoc:
451
438
  buildfile = change_version { |version| # THIS_VERSION minus SNAPSHOT
452
439
  resolve_next_version(this_version) # THIS_VERSION
453
440
  }
454
- File.open(Buildr.application.buildfile.to_s, 'w') { |file| file.write buildfile }
441
+ File.open(version_file, 'w') { |file| file.write buildfile }
455
442
  end
456
443
 
457
444
  # Return the message to use to commit the buildfile with the next version
@@ -498,7 +485,7 @@ module Buildr #:nodoc:
498
485
  def tag_release(tag)
499
486
  unless this_version == extract_version
500
487
  info "Committing buildfile with version number #{extract_version}"
501
- Hg.commit File.basename(Buildr.application.buildfile.to_s), message
488
+ Hg.commit File.basename(version_file), message
502
489
  Hg.push if Hg.remote
503
490
  end
504
491
  info "Tagging release #{tag}"
@@ -510,7 +497,7 @@ module Buildr #:nodoc:
510
497
  def update_version_to_next
511
498
  super
512
499
  info "Current version is now #{extract_version}"
513
- Hg.commit File.basename(Buildr.application.buildfile.to_s), message
500
+ Hg.commit File.basename(version_file), message
514
501
  Hg.push if Hg.remote
515
502
  end
516
503
  end
@@ -546,7 +533,7 @@ module Buildr #:nodoc:
546
533
  def tag_release(tag)
547
534
  unless this_version == extract_version
548
535
  info "Committing buildfile with version number #{extract_version}"
549
- Git.commit File.basename(Buildr.application.buildfile.to_s), message
536
+ Git.commit File.basename(version_file), message
550
537
  Git.push if Git.remote
551
538
  end
552
539
  info "Tagging release #{tag}"
@@ -559,7 +546,7 @@ module Buildr #:nodoc:
559
546
  def update_version_to_next
560
547
  super
561
548
  info "Current version is now #{extract_version}"
562
- Git.commit File.basename(Buildr.application.buildfile.to_s), message
549
+ Git.commit File.basename(version_file), message
563
550
  Git.push if Git.remote
564
551
  end
565
552
  end
@@ -588,7 +575,7 @@ module Buildr #:nodoc:
588
575
  def update_version_to_next
589
576
  super
590
577
  info "Current version is now #{extract_version}"
591
- Svn.commit Buildr.application.buildfile.to_s, message
578
+ Svn.commit version_file, message
592
579
  end
593
580
  end
594
581
 
@@ -277,18 +277,6 @@ module Buildr #:nodoc:
277
277
  self
278
278
  end
279
279
 
280
- # *Deprecated*: Use dependencies instead.
281
- def classpath
282
- Buildr.application.deprecated 'Use dependencies instead.'
283
- dependencies
284
- end
285
-
286
- # *Deprecated*: Use dependencies= instead.
287
- def classpath=(artifacts)
288
- Buildr.application.deprecated 'Use dependencies= instead.'
289
- self.dependencies = artifacts
290
- end
291
-
292
280
  # Compilation dependencies.
293
281
  attr_accessor :dependencies
294
282
 
@@ -308,8 +308,15 @@ module Buildr #:nodoc:
308
308
  end
309
309
  self
310
310
  end
311
+
312
+ BINARY_FILES = [ '*.png', '*.gif', '*.jpg', '*.jpeg' ]
313
+
314
+ def is_binary?(content, path)
315
+ !!path && BINARY_FILES.any? { |glob| File.fnmatch(glob, path) }
316
+ end
311
317
 
312
318
  def transform(content, path = nil)
319
+ return content if is_binary?(content, path)
313
320
  type = Regexp === mapper_type ? :regexp : mapper_type
314
321
  raise ArgumentError, "Invalid mapper type: #{type.inspect}" unless respond_to?("#{type}_transform", true)
315
322
  self.__send__("#{type}_transform", content, path) { |key| config[key] || config[key.to_s.to_sym] }
@@ -168,6 +168,7 @@ EOF
168
168
  if natures && natures.index('org.eclipse.pde.PluginNature')
169
169
  script << " package(:jar)"
170
170
  end
171
+ script << " dependencies ||= []"
171
172
  if mf && mf.main['Require-Bundle']
172
173
  mf.main['Require-Bundle'].split(',').each do
173
174
  |bundle|
@@ -214,12 +214,14 @@ module Buildr #:nodoc:
214
214
  project.send :call_callbacks, :after_define
215
215
  end
216
216
  end
217
- project.enhance do |project|
218
- @on_define.each { |extension| extension[project] }
219
- end if @on_define
220
217
  # Enhance the project using the definition block.
221
218
  project.enhance { project.instance_exec project, &block } if block
222
219
 
220
+ # Mark the project as defined
221
+ project.enhance do |project|
222
+ project.send :define!
223
+ end
224
+
223
225
  # Top-level project? Invoke the project definition. Sub-project? We don't invoke
224
226
  # the project definiton yet (allow project calls to establish order of evaluation),
225
227
  # but must do so before the parent project's definition is done.
@@ -253,7 +255,7 @@ module Buildr #:nodoc:
253
255
  end
254
256
  project ||= @projects[name] # Not found in scope.
255
257
  raise "No such project #{name}" unless project
256
- project.invoke unless no_invoke || Buildr.application.current_scope.join(":").to_s == project.name.to_s
258
+ project.invoke unless project.defined? || no_invoke || Buildr.application.current_scope.join(":").to_s == project.name.to_s
257
259
  project
258
260
  end
259
261
 
@@ -614,7 +616,15 @@ module Buildr #:nodoc:
614
616
  @calledback ||= {}
615
617
  end
616
618
 
619
+ def defined?
620
+ @defined
621
+ end
622
+
617
623
  protected
624
+ def define!
625
+ @defined = true
626
+ end
627
+
618
628
 
619
629
  # :call-seq:
620
630
  # base_dir = dir
@@ -261,7 +261,7 @@ module Buildr #:nodoc:
261
261
 
262
262
  def execute(args) #:nodoc:
263
263
  if Buildr.options.test == false
264
- info "Skipping tests for #{project.name}"
264
+ trace "Skipping tests for #{project.name}"
265
265
  return
266
266
  end
267
267
  setup.invoke
@@ -357,13 +357,11 @@ module Buildr #:nodoc:
357
357
  def using(*args)
358
358
  args.pop.each { |key, value| options[key.to_sym] = value } if Hash === args.last
359
359
  args.each do |name|
360
+ info name
360
361
  if TestFramework.has?(name)
361
362
  self.framework = name
362
363
  elsif name == :integration
363
364
  options[:integration] = true
364
- else
365
- Buildr.application.deprecated "Please replace with using(:#{name}=>true)"
366
- options[name.to_sym] = true
367
365
  end
368
366
  end
369
367
  self
@@ -279,6 +279,8 @@ module URI
279
279
  headers['User-Agent'] = "Buildr-#{Buildr::VERSION}"
280
280
  request = Net::HTTP::Get.new(request_uri.empty? ? '/' : request_uri, headers)
281
281
  request.basic_auth self.user, self.password if self.user
282
+ http.verify_mode = ::OpenSSL::SSL.const_get(ENV['SSL_VERIFY_MODE']) if ENV['SSL_VERIFY_MODE']
283
+ http.ca_path = ENV['SSL_CA_CERTS'] if ENV['SSL_CA_CERTS']
282
284
  http.request request do |response|
283
285
  case response
284
286
  when Net::HTTPNotModified
@@ -53,13 +53,6 @@ module Buildr::Groovy
53
53
  **/*Specification.groovy **/*Story.groovy
54
54
  }.any? { |glob| !Dir[project.path_to(:source, bdd_dir, lang, glob)].empty? }
55
55
  end
56
-
57
- private
58
- def const_missing(const)
59
- return super unless const == :REQUIRES # TODO: remove in 1.5
60
- Buildr.application.deprecated "Please use JBehave.dependencies/.version instead of JBehave::REQUIRES/VERSION"
61
- dependencies
62
- end
63
56
  end
64
57
 
65
58
  def tests(dependencies) #:nodoc:
@@ -460,9 +460,9 @@ module Buildr #:nodoc:
460
460
  module Scala
461
461
  include Extension
462
462
 
463
- NATURE = 'ch.epfl.lamp.sdt.core.scalanature'
464
- CONTAINER = 'ch.epfl.lamp.sdt.launching.SCALA_CONTAINER'
465
- BUILDER = 'ch.epfl.lamp.sdt.core.scalabuilder'
463
+ NATURE = 'org.scala-ide.sdt.core.scalanature'
464
+ CONTAINER = 'org.scala-ide.sdt.launching.SCALA_CONTAINER'
465
+ BUILDER = 'org.scala-ide.sdt.core.scalabuilder'
466
466
 
467
467
  after_define :eclipse => :eclipse_scala
468
468
  after_define :eclipse_scala do |project|
@@ -37,12 +37,6 @@ module Buildr #:nodoc:
37
37
  @dependencies ||= ["org.apache.ant:ant:jar:#{version}", "org.apache.ant:ant-launcher:jar:#{version}"]
38
38
  end
39
39
 
40
- private
41
- def const_missing(const)
42
- return super unless const == :REQUIRES # TODO: remove in 1.5
43
- Buildr.application.deprecated "Please use Ant.dependencies/.version instead of Ant::REQUIRES/VERSION"
44
- dependencies
45
- end
46
40
  end
47
41
 
48
42
 
@@ -309,13 +309,6 @@ module Buildr #:nodoc:
309
309
  **/*Behaviour.java **/*Behavior.java
310
310
  }.any? { |glob| !Dir[project.path_to(:source, bdd_dir, lang, glob)].empty? }
311
311
  end
312
-
313
- private
314
- def const_missing(const)
315
- return super unless const == :REQUIRES # TODO: remove in 1.5
316
- Buildr.application.deprecated 'Please use JBehave.dependencies/.version instead of JBehave::REQUIRES/VERSION'
317
- dependencies
318
- end
319
312
  end
320
313
 
321
314
  def tests(dependencies) #:nodoc:
@@ -75,7 +75,7 @@ module Java
75
75
  end
76
76
  manifest = Buildr::Packaging::Java::Manifest.new([{'Class-Path' => paths.join(" ")}])
77
77
  tjar = Tempfile.new(['javacmd', '.jar'])
78
- Zip::ZipOutputStream.open(tjar.path) do |zos|
78
+ Zip::OutputStream.open(tjar.path) do |zos|
79
79
  zos.put_next_entry('META-INF/MANIFEST.MF')
80
80
  zos.write manifest.to_s
81
81
  zos.write "\n"
@@ -15,48 +15,6 @@
15
15
 
16
16
  module Java #:nodoc:
17
17
 
18
- # *Deprecated:* In earlier versions, Java.wrapper served as a wrapper around RJB/JRuby.
19
- # From this version forward, we apply with JRuby style for importing Java classes:
20
- # Java.java.lang.String.new('hai!')
21
- # You still need to call Java.load before using any Java code: it resolves, downloads
22
- # and installs various dependencies that are required on the classpath before calling
23
- # any Java code (e.g. Ant and its tasks).
24
- class JavaWrapper
25
-
26
- include Singleton
27
-
28
- # *Deprecated:* Append to Java.classpath directly.
29
- def classpath
30
- Buildr.application.deprecated 'Append to Java.classpath instead.'
31
- ::Java.classpath
32
- end
33
-
34
- def classpath=(paths)
35
- fail 'Deprecated: Append to Java.classpath, you cannot replace the classpath.'
36
- end
37
-
38
- # *Deprecated:* No longer necessary.
39
- def setup
40
- Buildr.application.deprecated 'See documentation for new way to access Java code.'
41
- yield self if block_given?
42
- end
43
-
44
- # *Deprecated:* Use Java.load instead.
45
- def load
46
- Buildr.application.deprecated 'Use Java.load instead.'
47
- ::Java.load
48
- end
49
-
50
- alias :onload :setup
51
-
52
- # *Deprecated:* Use Java.pkg.pkg.ClassName to import a Java class.
53
- def import(class_name)
54
- Buildr.application.deprecated 'Use Java.pkg.pkg.ClassName to import a Java class.'
55
- ::Java.instance_eval(class_name)
56
- end
57
- end
58
-
59
-
60
18
  class << self
61
19
 
62
20
  # *Deprecated*: Use Java::Commands.java instead.
@@ -97,24 +55,6 @@ module Java #:nodoc:
97
55
  ENV['JAVA_HOME']
98
56
  end
99
57
 
100
- # *Deprecated:* In earlier versions, Java.wrapper served as a wrapper around RJB/JRuby.
101
- # From this version forward, we apply with JRuby style for importing Java classes:
102
- # Java.java.lang.String.new('hai!')
103
- # You still need to call Java.load before using any Java code: it resolves, downloads
104
- # and installs various dependencies that are required on the classpath before calling
105
- # any Java code (e.g. Ant and its tasks).
106
- def wrapper
107
- Buildr.application.deprecated 'See documentation for new way to access Java code.'
108
- if block_given?
109
- Java.load
110
- yield JavaWrapper.instance
111
- else
112
- JavaWrapper.instance
113
- end
114
- end
115
-
116
- alias :rjb :wrapper
117
-
118
58
  end
119
59
 
120
60