Class: FastlaneCore::JavaTransporterExecutor

Inherits:
TransporterExecutor show all
Defined in:
lib/fastlane_core/itunes_transporter.rb

Overview

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

Instance Method Summary collapse

Instance Method Details

#build_download_command(username, password, apple_id, destination = "/tmp") ⇒ Object



186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# File 'lib/fastlane_core/itunes_transporter.rb', line 186

def build_download_command(username, password, apple_id, destination = "/tmp")
  [
    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',
    "-classpath #{Helper.transporter_java_jar_path.shellescape}",
    'com.apple.transporter.Application',
    '-m lookupMetadata',
    "-u #{username.shellescape}",
    "-p #{password.shellescape}",
    "-apple_id #{apple_id.shellescape}",
    "-destination #{destination.shellescape}",
    '2>&1' # cause stderr to be written to stdout
  ].join(' ')
end

#build_upload_command(username, password, source = "/tmp") ⇒ Object



163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/fastlane_core/itunes_transporter.rb', line 163

def build_upload_command(username, password, source = "/tmp")
  [
    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',
    "-classpath #{Helper.transporter_java_jar_path.shellescape}",
    'com.apple.transporter.Application',
    '-m upload',
    "-u #{username.shellescape}",
    "-p #{password.shellescape}",
    "-f #{source.shellescape}",
    ENV["DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS"], # that's here, because the user might overwrite the -t option
    '-t Signiant',
    '-k 100000',
    '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) ⇒ Object



207
208
209
210
211
212
213
214
# File 'lib/fastlane_core/itunes_transporter.rb', line 207

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