class JLauncher::FullConfig

The full configuration needed to start a program has a manifest plus an optional extra_class_path element, which contains either maven coordinates or a local file containing a jar

Attributes

manifest[R]
start_coordinates[R]

Public Class Methods

new(manifest, extra_class_path, start_coordinates) click to toggle source
# File lib/jlauncher.rb, line 149
def initialize(manifest, extra_class_path, start_coordinates)
  @manifest = manifest
  @extra_class_path = extra_class_path
  @start_coordinates = start_coordinates

end

Public Instance Methods

launch_config(resolver) click to toggle source
# File lib/jlauncher.rb, line 157
def launch_config(resolver)
  class_path_from_manifest = @manifest.dependencies.map {
      |c| resolver.get(c)
  }

  if @extra_class_path
    split_index = @extra_class_path.index(":")
    protocol = @extra_class_path[0..split_index - 1]
    value = @extra_class_path[split_index + 1..-1]
    extra_element = case protocol
                    when "file"
                      value
                    when "maven"
                      resolver.get(Coordinates.new(value))
                    end
    class_path_from_manifest = class_path_from_manifest << extra_element
  end

  JvmLaunchConfig.new(
      class_path_from_manifest,
      @manifest.main_class
  )
end