Module Java::Commands
In: lib/buildr/java/commands.rb  (CVS)

JDK commands: java, javac, javadoc, etc.

Methods

apt   classpath_from   java   javac   javadoc   path_to_bin  

Public Class methods

Runs Apt with the specified arguments.

The last argument may be a Hash with additional options:

  • :compile — If true, compile source files to class files.
  • :source — Specifies source compatibility with a given JVM release.
  • :output — Directory where to place the generated source files, or the generated class files when compiling.
  • :classpath — One or more file names, tasks or artifact specifications. These are all expanded into artifacts, and all tasks are invoked.

Runs Java with the specified arguments.

Each argument should be provided as separate array value, e.g.

 java("-jar", "yuicompressor-2.4.2.jar", "--type","css",
      "src/main/webapp/styles/styles-all.css",
      "-o", "src/main/webapp/styles/styles-all-min.css")

The last argument may be a Hash with additional options:

  • :classpath — One or more file names, tasks or artifact specifications. These are all expanded into artifacts, and all tasks are invoked.
  • :java_args — Any additional arguments to pass (e.g. -hotspot, -xms)
  • :properties — Hash of system properties (e.g. ‘path’=>base_dir).
  • :name — Shows this name, otherwise shows the first argument (the class name).
  • :verbose — If true, prints the command and all its argument.

Runs Javac with the specified arguments.

The last argument may be a Hash with additional options:

  • :output — Target directory for all compiled class files.
  • :classpath — One or more file names, tasks or artifact specifications. These are all expanded into artifacts, and all tasks are invoked.
  • :sourcepath — Additional source paths to use.
  • :javac_args — Any additional arguments to pass (e.g. -extdirs, -encoding)
  • :name — Shows this name, otherwise shows the working directory.

Runs Javadocs with the specified files and options.

This method accepts the following special options:

  • :output — The output directory
  • :classpath — Array of classpath dependencies.
  • :sourcepath — Array of sourcepaths (paths or tasks).
  • :name — Shows this name, otherwise shows the working directory.

All other options are passed to Javadoc as following:

  • true — As is, for example, :author=>true becomes -author
  • false — Prefixed, for example, :index=>false becomes -noindex
  • string — Option with value, for example, :windowtitle=>’My project’ becomes -windowtitle "My project"
  • array — Option with set of values separated by spaces.

Protected Class methods

Extracts the classpath from the options, expands it by calling artifacts, invokes each of the artifacts and returns an array of paths.

Returns the path to the specified Java command (with no argument to java itself).

[Validate]