lib/gym/package_command_generator.rb in gym-0.1.0 vs lib/gym/package_command_generator.rb in gym-0.2.0
- old
+ new
@@ -1,13 +1,19 @@
module Gym
# Responsible for building the fully working xcodebuild command
+ #
+ # Because of a known bug in PackageApplication Perl script used by Xcode the packaging process is performed with
+ # a patched version of the script.
class PackageCommandGenerator
class << self
def generate
- parts = ["/usr/bin/xcrun -sdk iphoneos PackageApplication -v"]
+ @patched_package_application = XcodeFix.patch_package_application
+
+ parts = ["/usr/bin/xcrun #{@patched_package_application} -v"]
parts += options
parts += pipe
+ parts += postfix
parts
end
def options
@@ -15,12 +21,12 @@
options << "'#{appfile_path}'"
options << "-o '#{ipa_path}'"
options << "exportFormat ipa"
- if Gym.config[:provisioning_profile_name]
- options << "--embed '#{Gym.config[:provisioning_profile_name]}'"
+ if Gym.config[:provisioning_profile_path]
+ options << "--embed '#{Gym.config[:provisioning_profile_path]}'"
end
if Gym.config[:codesigning_identity]
options << "--sign '#{Gym.config[:codesigning_identity]}'"
end
@@ -28,9 +34,14 @@
options
end
def pipe
[""]
+ end
+
+ def postfix
+ # Remove the patched PackageApplication file after the export is finished
+ ["&& rm '#{@patched_package_application}'"]
end
def appfile_path
Dir.glob("#{BuildCommandGenerator.archive_path}/Products/Applications/*.app").first
end