Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add an instruction to configure different envfiles per build settings using Podfile #547

Merged
merged 1 commit into from
Jun 21, 2021

Conversation

devxoul
Copy link
Contributor

@devxoul devxoul commented Jan 26, 2021

This library generates code using Ruby script ReadDotEnv.rb which reads ENVFILE from the environment variables. The script is executed during the CocoaPods library build phase.

With pod_install hook you can set custom build settings of CocoaPods libraries. Since Xcode exposes all build settings to the environment variables, this is the best place to set ENVFILE. You may also access to the build configurations so you can set different envfiles per build configurations.

Example

(I'm using Debug, Development, Production build configurations)

Screen Shot 2021-01-26 at 6 14 12 PM

Related issues

@height
Copy link

height bot commented Jan 26, 2021

Link Height tasks by mentioning a task ID in the pull request title or description, commit messages, or comments.

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

@sterlingwes
Copy link
Contributor

This does seem like the nicest approach, rather than doing a copy with an xcode build pre-action. I couldn't get this to work with v1.4.2 of the library though. I'm not sure if the ENVFILE use has changed since this. Would be nice if this were the recommended approach though, as it's a lot easier to understand.

Copy link
Collaborator

@luancurti luancurti left a comment

Choose a reason for hiding this comment

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

Awesome!

@luancurti luancurti merged commit 35c2999 into lugg:master Jun 21, 2021
@devxoul devxoul deleted the xcode-envfile-podfile branch June 23, 2021 05:09
pvinis pushed a commit to artsy/react-native-config that referenced this pull request Jan 18, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants