Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show progress during upload #35

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions lib/motion/project/testflight.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Copyright (c) 2012, Laurent Sansonetti <[email protected]>
# All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Expand Down Expand Up @@ -39,7 +39,7 @@ def sdk=(sdk)
@sdk = sdk
@config.vendor_project(sdk, :static)
libz = '/usr/lib/libz.dylib'
@config.libs << libz unless @config.libs.index(libz)
@config.libs << libz unless @config.libs.index(libz)
end
end

Expand Down Expand Up @@ -72,6 +72,7 @@ def create_launcher
if Object.const_defined?('TestFlight') and !UIDevice.currentDevice.model.include?('Simulator')
NSNotificationCenter.defaultCenter.addObserverForName(UIApplicationDidFinishLaunchingNotification, object:nil, queue:nil, usingBlock:lambda do |notification|
#{'TestFlight.setDeviceIdentifier(UIDevice.currentDevice.uniqueIdentifier)' if identify_testers}
TestFlight.setOptions({ TFOptionReportCrashes => false})
TestFlight.takeOff('#{app_token || team_token}')
end)
end
Expand Down Expand Up @@ -118,18 +119,19 @@ def testflight?
App.fail "Submission notes must be provided via the `notes' environment variable. Example: rake testflight notes='w00t'" unless notes

Rake::Task["archive"].invoke

# An archived version of the .dSYM bundle is needed.
app_dsym = App.config.app_bundle_dsym('iPhoneOS')
app_dsym_zip = app_dsym + '.zip'
if !File.exist?(app_dsym_zip) or File.mtime(app_dsym) > File.mtime(app_dsym_zip)
Dir.chdir(File.dirname(app_dsym)) do
sh "/usr/bin/zip -q -r \"#{File.basename(app_dsym)}.zip\" \"#{File.basename(app_dsym)}\""
end
end
curl = "/usr/bin/curl http://testflightapp.com/api/builds.json -F file=@\"#{App.config.archive}\" -F dsym=@\"#{app_dsym_zip}\" -F api_token='#{prefs.api_token}' -F team_token='#{prefs.team_token}' -F notes=\"#{notes}\" -F notify=#{prefs.notify ? "True" : "False"}"
end

curl = "/usr/bin/curl http://testflightapp.com/api/builds.json --progress-bar -F file=@\"#{App.config.archive}\" -F dsym=@\"#{app_dsym_zip}\" -F api_token='#{prefs.api_token}' -F team_token='#{prefs.team_token}' -F notes=\"#{notes}\" -F notify=#{prefs.notify ? "True" : "False"}"
curl << " -F distribution_lists='#{distribution_lists}'" if distribution_lists
curl << " | tee"
App.info 'Run', curl
sh curl
end
Expand Down