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

Feature: Allow specifying custom export options from file and environment variable references #283

Merged
merged 4 commits into from
Nov 4, 2022

Conversation

priitlatt
Copy link
Contributor

Closes #272.

Passing custom export options for xcode-project use-profiles directly with CLI argument can be a little cumbersome and error prone (long lines, missing quotes around the JSON, etc). To overcome that, allow custom export options to be given as a file or environment variable reference:

  • Using file reference:
echo '{"uploadBitcode": false, "uploadSymbols": false}' > /path/to/custom-export-options.json
xcode-project use-profiles --custom-export-options=@file:/path/to/custom-export-options.json
  • Using environment variable reference:
export CUSTOM_EXPORT_OPTIONS='{"uploadBitcode": false, "uploadSymbols": false}'
xcode-project use-profiles --custom-export-options=@env:CUSTOM_EXPORT_OPTIONS
  • Using default environment variable:
export XCODE_PROJECT_CUSTOM_EXPORT_OPTIONS='{"uploadBitcode": false, "uploadSymbols": false}'
xcode-project use-profiles
  • Using plain CLI argument (the old way):
xcode-project use-profiles --custom-export-options='{"uploadBitcode": false, "uploadSymbols": false}'

Updated actions:

  • xcode-project use-profiles

@@ -100,7 +107,7 @@ def use_profiles(
xcode_project_patterns: Sequence[pathlib.Path] = XcodeProjectArgument.XCODE_PROJECT_PATTERN.get_default(),
profile_path_patterns: Sequence[pathlib.Path] = XcodeProjectArgument.PROFILE_PATHS.get_default(),
export_options_plist: pathlib.Path = ExportIpaArgument.EXPORT_OPTIONS_PATH.get_default(),
custom_export_options: Optional[Dict] = None,
custom_export_options: Optional[Union[Dict, CustomExportOptions]] = None,
Copy link
Contributor Author

@priitlatt priitlatt Nov 4, 2022

Choose a reason for hiding this comment

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

The only functional changes in this file are on lines 110 and 121-123. Everything else is just formatting.

@priitlatt priitlatt marked this pull request as ready for review November 4, 2022 10:19
@priitlatt priitlatt merged commit 2b9fb6e into master Nov 4, 2022
@priitlatt priitlatt deleted the feature/custom-export-options-from-file-env branch November 4, 2022 10:29
@priitlatt priitlatt changed the title Feature/custom export options from file env Feature: Allow specifying custom export options from file and environment variable references Nov 4, 2022
@priitlatt priitlatt added the enhancement New feature or request label Nov 4, 2022
priitlatt added a commit that referenced this pull request Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow use-profiles custom export options to use @file: reference
2 participants