Permalink
Browse files

Merge pull request #8 from arielo/feature/upload_testflight_dsym

Testlight publish task compresses and uploads dSYM file
  • Loading branch information...
2 parents 6216c6f + b42d5d0 commit 77b30d5d09c39416d037cd4c5351d53a4369b24b Dave Newman committed Jul 30, 2012
Showing with 21 additions and 2 deletions.
  1. +2 −0 lib/wox/build_environment.rb
  2. +1 −1 lib/wox/builder.rb
  3. +17 −1 lib/wox/test_flight.rb
  4. +1 −0 wox.gemspec
@@ -28,6 +28,8 @@ def initialize options
if options[:ipa_name]
options[:ipa_file] ||= File.join self[:build_dir],
[self[:project_name], self[:version], self[:configuration], self[:ipa_name]].join("-") + ".ipa"
+ options[:dsym_file] ||= File.join self[:build_dir],
+ [self[:project_name], self[:version], self[:configuration], self[:ipa_name]].join("-") + ".dSYM.zip"
end
end
View
@@ -9,7 +9,7 @@ def build
log_file = File.join environment[:build_dir], "build-#{configuration}.log"
- run_command "xcodebuild -#{environment[:target_or_scheme]} '#{environment[:target]}' -configuration #{configuration}", :results => log_file
+ run_command "xcodebuild -#{environment[:target_or_scheme]} '#{environment[:target]}' -configuration #{configuration} BUILD_DIR=#{environment[:build_dir]} clean build", :results => log_file
end
end
end
View
@@ -1,4 +1,6 @@
require 'wox/helpers/number_helper'
+require 'zip/zip'
+require 'zip/zipfilesystem'
module Wox
class TestFlight < Task
@@ -12,6 +14,7 @@ def arg_to_string arg
def api_args
args = {
:file => "@#{environment[:ipa_file]}",
+ :dsym => "@#{environment[:dsym_file]}",
:api_token => environment[:api_token],
:team_token => environment[:team_token],
:notes => environment[:notes]
@@ -28,7 +31,7 @@ def curl_arg_string
def publish
ipa_file = environment[:ipa_file]
-
+ compress_dsym
puts "Publishing to TestFlight"
puts "File: #{ipa_file} (#{bytes_to_human_size File.size?(ipa_file)})"
puts "Accessible To: #{environment[:distribution_lists].join(", ")}" if environment.has_entry? :distribution_lists
@@ -38,5 +41,18 @@ def publish
run_command "curl --progress-bar #{curl_arg_string} http://testflightapp.com/api/builds.json", :results => log_file
end
+ def compress_dsym
+ configuration, sdk, ipa_file, build_dir = environment[:configuration], environment[:sdk], environment[:ipa_file], environment[:build_dir]
+ dsym_file = File.join build_dir, "#{configuration}-#{sdk}", environment[:app_file]
+ dsym_file += ".app.dSYM"
+ archive = environment[:dsym_file]
+ puts "Compressing dSYM: #{archive}"
+ FileUtils.rm archive, :force=>true
+ Zip::ZipFile.open(archive, 'w') do |zipfile|
+ Dir["#{dsym_file}/**/**"].each do |file|
+ zipfile.add(file.sub(File.dirname(dsym_file)+'/',''),file)
+ end
+ end
+ end
end
end
View
@@ -16,6 +16,7 @@ Gem::Specification.new do |s|
s.add_dependency "thor"
s.add_dependency "plist"
+ s.add_dependency "rubyzip"
s.add_development_dependency "rspec"

0 comments on commit 77b30d5

Please sign in to comment.