Class: Java::JavaWrapper

Inherits:
Object show all
Includes:
Singleton
Defined in:
lib/buildr/java/deprecated.rb

Overview

Deprecated: In earlier versions, Java.wrapper served as a wrapper around RJB/JRuby. From this version forward, we apply with JRuby style for importing Java classes:

Java.java.lang.String.new('hai!')

You still need to call Java.load before using any Java code: it resolves, downloads and installs various dependencies that are required on the classpath before calling any Java code (e.g. Ant and its tasks).

Instance Method Summary collapse

Instance Method Details

#classpathObject

Deprecated: Append to Java.classpath directly.



33
34
35
36
# File 'lib/buildr/java/deprecated.rb', line 33

def classpath
  Buildr.application.deprecated 'Append to Java.classpath instead.'
  ::Java.classpath
end

#classpath=(paths) ⇒ Object



38
39
40
# File 'lib/buildr/java/deprecated.rb', line 38

def classpath=(paths)
  fail 'Deprecated: Append to Java.classpath, you cannot replace the classpath.'
end

#import(class_name) ⇒ Object

Deprecated: Use Java.pkg.pkg.ClassName to import a Java class.



57
58
59
60
# File 'lib/buildr/java/deprecated.rb', line 57

def import(class_name)
  Buildr.application.deprecated 'Use Java.pkg.pkg.ClassName to import a Java class.'
  ::Java.instance_eval(class_name)
end

#loadObject

Deprecated: Use Java.load instead.



49
50
51
52
# File 'lib/buildr/java/deprecated.rb', line 49

def load
  Buildr.application.deprecated 'Use Java.load instead.'
  ::Java.load
end

#setup {|_self| ... } ⇒ Object Also known as: onload

Deprecated: No longer necessary.

Yields:

  • (_self)

Yield Parameters:



43
44
45
46
# File 'lib/buildr/java/deprecated.rb', line 43

def setup
  Buildr.application.deprecated 'See documentation for new way to access Java code.'
  yield self if block_given?
end