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

feat: add a dummy swift file to the example if the library uses swift #525

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

Conversation

mfazekas
Copy link

@mfazekas mfazekas commented Feb 4, 2024

Summary

It seems that swift debugging in libraries doesn't really work unless the app itself has a swift file. See #517

There is an empty File.swift in example-legacy template but it's not added to the project. This change executes a ruby script to include that file in the Xcode project.

Note that it requires working ruby install and xcodeproj gem available and only run on Mac. Which is reasonable as , ruby and xcodeproj are decencies of cocoa pods.

Test plan

@atlj
Copy link
Collaborator

atlj commented May 24, 2024

Hey @mfazekas thanks a lot for the PR! I was able to validate the issue on my end.
I have one question regarding the implementation, do you think it would make sense to use the @bacons/xcode to create the swift file instead of using ruby here? Yes we already have the necessary dependencies to run a ruby script here but most of the logic is already inside NodeJS I think directly using NodeJS instead of spawning ruby would make more sense since:

  1. So far we've been using ~99% Javascript
  2. Most of the contributors are familiar with Javascript
  3. We have tools to statically check the Javascript code in this repo but not Ruby.
  4. Non-MacOS systems would be able to create the file (This one still needs to be tested). So users can start their library in a non-darwin platform and then move to darwin. This might prevent an edge case.
  5. We would like to add similar logic to modify the generated XCode project further, so this would be a great first step.

You can find the exact same implementation done in @bacons/xcode here.
Screenshot 2024-05-24 at 21 51 06

@mfazekas
Copy link
Author

@atlj sure we can do it in javascript I was not aware of '@bacons/Xcode'; . Cocoapods does use ruby and xcodeproj gem, so it should be installed, but I agree that js solution is better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants