class FastlaneCore::JavaTransporterExecutor

Generates commands and executes the iTMSTransporter by invoking its Java app directly, to avoid the crazy parameter escaping problems in its accompanying shell script.

Public Instance Methods

build_download_command(username, password, apple_id, destination = "/tmp", provider_short_name = "") click to toggle source
# File fastlane_core/lib/fastlane_core/itunes_transporter.rb, line 265
def build_download_command(username, password, apple_id, destination = "/tmp", provider_short_name = "")
  [
    Helper.transporter_java_executable_path.shellescape,
    "-Djava.ext.dirs=#{Helper.transporter_java_ext_dir.shellescape}",
    '-XX:NewSize=2m',
    '-Xms32m',
    '-Xmx1024m',
    '-Xms1024m',
    '-Djava.awt.headless=true',
    '-Dsun.net.http.retryPost=false',
    java_code_option,
    '-m lookupMetadata',
    "-u #{username.shellescape}",
    "-p #{password.shellescape}",
    "-apple_id #{apple_id.shellescape}",
    "-destination #{destination.shellescape}",
    ("-itc_provider #{provider_short_name}" unless provider_short_name.to_s.empty?),
    '2>&1' # cause stderr to be written to stdout
  ].compact.join(' ')
end
build_provider_ids_command(username, password) click to toggle source
# File fastlane_core/lib/fastlane_core/itunes_transporter.rb, line 286
def build_provider_ids_command(username, password)
  [
    Helper.transporter_java_executable_path.shellescape,
    "-Djava.ext.dirs=#{Helper.transporter_java_ext_dir.shellescape}",
    '-XX:NewSize=2m',
    '-Xms32m',
    '-Xmx1024m',
    '-Xms1024m',
    '-Djava.awt.headless=true',
    '-Dsun.net.http.retryPost=false',
    java_code_option,
    '-m provider',
    "-u #{username.shellescape}",
    "-p #{password.shellescape}",
    '2>&1' # cause stderr to be written to stdout
  ].compact.join(' ')
end
build_upload_command(username, password, source = "/tmp", provider_short_name = "") click to toggle source
# File fastlane_core/lib/fastlane_core/itunes_transporter.rb, line 242
def build_upload_command(username, password, source = "/tmp", provider_short_name = "")
  [
    Helper.transporter_java_executable_path.shellescape,
    "-Djava.ext.dirs=#{Helper.transporter_java_ext_dir.shellescape}",
    '-XX:NewSize=2m',
    '-Xms32m',
    '-Xmx1024m',
    '-Xms1024m',
    '-Djava.awt.headless=true',
    '-Dsun.net.http.retryPost=false',
    java_code_option,
    '-m upload',
    "-u #{username.shellescape}",
    "-p #{password.shellescape}",
    "-f #{source.shellescape}",
    additional_upload_parameters, # that's here, because the user might overwrite the -t option
    '-t Signiant',
    '-k 100000',
    ("-itc_provider #{provider_short_name}" unless provider_short_name.to_s.empty?),
    '2>&1' # cause stderr to be written to stdout
  ].compact.join(' ') # compact gets rid of the possibly nil ENV value
end
execute(command, hide_output) click to toggle source
# File fastlane_core/lib/fastlane_core/itunes_transporter.rb, line 320
def execute(command, hide_output)
  # The Java command needs to be run starting in a working directory in the iTMSTransporter
  # file area. The shell script takes care of changing directories over to there, but we'll
  # handle it manually here for this strategy.
  FileUtils.cd(Helper.itms_path) do
    return super(command, hide_output)
  end
end
handle_error(password) click to toggle source
# File fastlane_core/lib/fastlane_core/itunes_transporter.rb, line 312
def handle_error(password)
  unless File.exist?(Helper.transporter_java_jar_path)
    UI.error("The iTMSTransporter Java app was not found at '#{Helper.transporter_java_jar_path}'.")
    UI.error("If you're using Xcode 6, please select the shell script executor by setting the environment variable "\
      "FASTLANE_ITUNES_TRANSPORTER_USE_SHELL_SCRIPT=1")
  end
end
java_code_option() click to toggle source
# File fastlane_core/lib/fastlane_core/itunes_transporter.rb, line 304
def java_code_option
  if Helper.mac? && Helper.xcode_at_least?(9)
    return "-jar #{Helper.transporter_java_jar_path.shellescape}"
  else
    return "-classpath #{Helper.transporter_java_jar_path.shellescape} com.apple.transporter.Application"
  end
end