Skip to content
This repository has been archived by the owner on Oct 2, 2018. It is now read-only.

Added support for export_options and app thinning #194

Merged
merged 1 commit into from
Feb 10, 2016
Merged

Added support for export_options and app thinning #194

merged 1 commit into from
Feb 10, 2016

Conversation

bartoszj
Copy link
Contributor

Hi,

As promised. I've added support for -exportOptionsPlist (as :export_options) and app thinning. With this pull request user will be able to provide path to export plist file or hash of options. In both cases some export options can be overridden by :include_symbols, :include_bitcode, :export_method and :export_team_id. To the output directory are copied manifest.plist, app-thinning.plist, App Thinning Size Report.txt files and the Apps folder with thinned ipa files.

Gym.config[:include_symbols] = hash[:uploadSymbols] if Gym.config[:include_symbols].nil?
Gym.config[:include_bitcode] = hash[:uploadBitcode] if Gym.config[:include_bitcode].nil?
Gym.config[:export_team_id] ||= hash[:teamID]
# Generate export options plist
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does this comment belong to? Wrong spacing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was make several refactoring. Probably I overlooked this comment. It should be removed.

@ohayon ohayon self-assigned this Jan 25, 2016
@bartoszj
Copy link
Contributor Author

@KrauseFx
I hope I've made all necessary adjustments.

@plrthink
Copy link

waiting for this PR to be merged

@bartoszj
Copy link
Contributor Author

I've added a little bit more informations to the README.md file. I hope you will like it.

@KrauseFx
Copy link
Contributor

KrauseFx commented Feb 5, 2016

Sorry for the delay, this looks awesome, reviewing everything now! 👍

@@ -154,10 +154,39 @@ sdk "iphoneos9.0"

clean true

export_options ({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, without the { I get different an error.

In case of:

export_options (
  method: "ad-hoc"
)

I got:

/Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane_core-0.36.1/lib/fastlane_core/configuration/configuration_file.rb:28:in `rescue in initialize': [!] Syntax error in your configuration file './fastlane/Gymfile' on line 6: (eval):6: syntax error, unexpected tLABEL (RuntimeError)
  method: "ad-hoc"
         ^
(eval):7: syntax error, unexpected ')', expecting end-of-input
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane_core-0.36.1/lib/fastlane_core/configuration/configuration_file.rb:22:in `initialize'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane_core-0.36.1/lib/fastlane_core/configuration/configuration.rb:146:in `new'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane_core-0.36.1/lib/fastlane_core/configuration/configuration.rb:146:in `load_configuration_file'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/gym-1.5.0/lib/gym/detect_values.rb:10:in `set_additional_default_values'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/gym-1.5.0/lib/gym.rb:25:in `config='
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/gym-1.5.0/lib/gym/manager.rb:4:in `work'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.57.0/lib/fastlane/actions/gym.rb:22:in `run'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.57.0/lib/fastlane/runner.rb:143:in `block (2 levels) in execute_action'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.57.0/lib/fastlane/actions/actions_helper.rb:35:in `execute_action'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.57.0/lib/fastlane/runner.rb:129:in `block in execute_action'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.57.0/lib/fastlane/runner.rb:128:in `chdir'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.57.0/lib/fastlane/runner.rb:128:in `execute_action'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.57.0/lib/fastlane/fast_file.rb:149:in `method_missing'
    from Fastfile:105:in `block (2 levels) in parsing_binding'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.57.0/lib/fastlane/lane.rb:36:in `call'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.57.0/lib/fastlane/runner.rb:110:in `try_switch_to_lane'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.57.0/lib/fastlane/fast_file.rb:141:in `rescue in method_missing'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.57.0/lib/fastlane/fast_file.rb:136:in `method_missing'
    from Fastfile:172:in `block (2 levels) in parsing_binding'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.57.0/lib/fastlane/lane.rb:36:in `call'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.57.0/lib/fastlane/runner.rb:52:in `block in execute'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.57.0/lib/fastlane/runner.rb:46:in `chdir'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.57.0/lib/fastlane/runner.rb:46:in `execute'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.57.0/lib/fastlane/lane_manager.rb:46:in `cruise_lane'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.57.0/lib/fastlane/command_line_handler.rb:30:in `handle'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.57.0/bin/fastlane:38:in `block (2 levels) in run'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/commander-4.3.5/lib/commander/command.rb:178:in `call'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/commander-4.3.5/lib/commander/command.rb:153:in `run'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/commander-4.3.5/lib/commander/runner.rb:428:in `run_active_command'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane_core-0.36.1/lib/fastlane_core/ui/fastlane_runner.rb:23:in `run!'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/commander-4.3.5/lib/commander/delegates.rb:15:in `run!'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.57.0/bin/fastlane:150:in `run'
    from /Users/user/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fastlane-1.57.0/bin/fastlane:156:in `<top (required)>'
    from /Users/user/.rbenv/versions/2.3.0/bin/fastlane:23:in `load'
    from /Users/user/.rbenv/versions/2.3.0/bin/fastlane:23:in `<main>'

There is no problem when we have { inside (. So for now I'll not remove this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, this is because you have to remove the space after the method name 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, you are right. Sorry.

@KrauseFx
Copy link
Contributor

KrauseFx commented Feb 5, 2016

This looks great, thank you so much for your work! I added some comments before the PR is ready. Another question: This should fail if the user defined the use_legacy_build_api but still passes a custom plist, right? If so, we should make sure to fail gracefully using UI.user_error!("use_legacy_build_api must be false to use xy") 👍

@KrauseFx
Copy link
Contributor

KrauseFx commented Feb 5, 2016

Also, thank you so much for adding tests 👍

@KrauseFx
Copy link
Contributor

KrauseFx commented Feb 8, 2016

Hey @bartoszj, just wanted to check if you had time to look into this? Otherwise I'm more than happy to take over this PR and do the final changes.

@bartoszj
Copy link
Contributor Author

bartoszj commented Feb 9, 2016

Hi,
I was sick recently, so I had no strength and time to look at your comments. If you allow me, I want to at least try to finish this PR. I hope I will find time today to make adjustments.

@KrauseFx
Copy link
Contributor

KrauseFx commented Feb 9, 2016

@bartoszj Get well soon, absolutely no problem, let me know when you had time to look into this. Really appreciate all your contribution 👍

@bartoszj
Copy link
Contributor Author

bartoszj commented Feb 9, 2016

This looks great, thank you so much for your work! I added some comments before the PR is ready. Another question: This should fail if the user defined the use_legacy_build_api but still passes a custom plist, right? If so, we should make sure to fail gracefully using UI.user_error!("use_legacy_build_api must be false to use xy") 👍

I've checked. If we use use_legacy_build_api and export_options everything will works. The legacy mode will be executed, and the package_command_generator_legacy.rb ignores export_options, so the plist options will not be used at all. But this is something that gym should prevent. I'll try to add this error handling.

@bartoszj
Copy link
Contributor Author

bartoszj commented Feb 9, 2016

@KrauseFx
Hi, I hope I've make all adjustments.

@KrauseFx
Copy link
Contributor

This looks great, thank you so much for your contribution @bartoszj 👍

KrauseFx added a commit that referenced this pull request Feb 10, 2016
Added support for `export_options` and app thinning
@KrauseFx KrauseFx merged commit 519a925 into fastlane-old:master Feb 10, 2016
@bartoszj bartoszj deleted the exportOptionsPlist branch February 11, 2016 17:54
@fastlane-old fastlane-old locked and limited conversation to collaborators Mar 11, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants