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

fix(iOS): #698 Re-generate env file on each build #784

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kapobajza
Copy link

@kapobajza kapobajza commented Nov 29, 2023

This is a fix for #698.

Updated the podspec's before_compile script to touch the BuildDotenvConfig.rb file so that Xcode/xcodebuild can pick up on the changes.

I am not sure if this is the ideal solution, but it works for me.
I've tested it locally, by installing the local version on a RN project.

@BrianMay-AO
Copy link

I came to a slightly different solution based on the same idea. I simply removed the input_files and output_files entries from both of the script_phases in the podspec.

These options are optional and help XCode to determine if the output files need to be rebuilt. In this case, the input file (BuildDotenvConfig.rb) never changes, only the argument passed to it changes. And output file is already present, so it doesn't appear to need to be rebuilt. The solution in this PR works around that by making a no-op modification to the input file which causes the script phase to trigger.

I'm no expert at Ruby or iOS things, so I'm not sure which approach is better. But I would love to see a solution merged in and released soon.

For reference, here is another issue that would be properly resolved with this change.

# 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