Class: Gjp::AntRunner

Inherits:
KitRunner show all
Includes:
Logging
Defined in:
lib/gjp/ant_runner.rb

Overview

runs Ant with gjp-specific options

Instance Method Summary collapse

Methods included from Logging

#log

Methods inherited from KitRunner

#find_executable, #initialize, #run_executable

Constructor Details

This class inherits a constructor from Gjp::KitRunner

Instance Method Details

#ant(options) ⇒ Object

runs ant in a subprocess



9
10
11
# File 'lib/gjp/ant_runner.rb', line 9

def ant(options)
  run_executable("#{get_ant_commandline(@project.full_path)} #{options.join(" ")}")
end

#get_ant_commandline(prefix) ⇒ Object

returns a command line for running Ant from the specified prefix



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/gjp/ant_runner.rb', line 15

def get_ant_commandline(prefix)
  executable = find_executable("ant")

  if !executable.nil?
    ant_path = File.join(prefix, executable)

    "#{ant_path}"
  else
    raise ExecutableNotFoundError.new("ant")
  end
end