def package
      build

      print "Packaging and Signing..."
      if (@configuration.signing_identity != nil) then
        puts ""
        print "Signing identity: #{@configuration.signing_identity}"
      end

      # trash and create the dist IPA path if needed
      FileUtils.rm_rf @configuration.package_destination_path unless !File.exists? @configuration.package_destination_path
      FileUtils.mkdir_p @configuration.package_destination_path

      # Construct the IPA and Sign it
      cmd = []
      cmd << "/usr/bin/xcrun"
      cmd << "-sdk iphoneos"
      cmd << "PackageApplication"
      cmd << "'#{@configuration.built_app_path}'"
      cmd << "-o '#{@configuration.ipa_path}'"
      cmd << "--sign '#{@configuration.signing_identity}'" unless @configuration.signing_identity == nil

      if @configuration.xcrun_extra_args then
        cmd.concat @configuration.xcrun_extra_args if @configuration.xcrun_extra_args.is_a? Array
        cmd << @configuration.xcrun_extra_args if @configuration.xcrun_extra_args.is_a? String
      end

      puts "Running #{cmd.join(" ")}" if @configuration.verbose
      cmd << "2>&1 /dev/null"
      cmd = cmd.join(" ")
      system(cmd)

      if @configuration.watch_app then
        reinject_wk_stub_in_ipa
      end

      puts ""
      puts "Done."
    end
def package
      build

      print "Packaging and Signing..."
      if (@configuration.signing_identity != nil) then
        puts ""
        print "Signing identity: #{@configuration.signing_identity}"
      end

      # trash and create the dist IPA path if needed
      FileUtils.rm_rf @configuration.package_destination_path unless !File.exists? @configuration.package_destination_path
      FileUtils.mkdir_p @configuration.package_destination_path

      # Construct the IPA and Sign it
      cmd = []
      cmd << "/usr/bin/xcrun"
      cmd << "-sdk iphoneos"
      cmd << "PackageApplication"
      cmd << "'#{@configuration.built_app_path}'"
      cmd << "-o '#{@configuration.ipa_path}'"
      cmd << "--sign '#{@configuration.signing_identity}'" unless @configuration.signing_identity == nil

      if @configuration.xcrun_extra_args then
        cmd.concat @configuration.xcrun_extra_args if @configuration.xcrun_extra_args.is_a? Array
        cmd << @configuration.xcrun_extra_args if @configuration.xcrun_extra_args.is_a? String
      end

      puts "Running #{cmd.join(" ")}" if @configuration.verbose
      cmd << "2>&1 /dev/null"
      cmd = cmd.join(" ")
      system(cmd)

      if @configuration.watch_app then
        reinject_wk_stub_in_ipa
      end

      puts ""
      puts "Done."
    end
desc "Package the release as a distributable archive"