johnno1962 / HotReloading

Hot reloading as a Swift Package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for custom Xcode app path

leonidmelnyk opened this issue Β· comments

Hello @johnno1962,

I'd like to make Support for custom Xcode app path.
I've found the solution with symlink but unfortunately this solution is doesn't work for me.
That's why I've already prepared a branch with changes but it seems I don't have enough permissions to push it and propose a pull request (receiving 403).
BTW in order this feature to be done, I'll need to prepose one pull request to this repository and one more to InjectionIII (I've prepared changes to both repos)

Could you please advise me on this question? πŸ™
Looking forward to your help!

Best regards,
Leonid

Hi, to make a pull request you need to make a fork of the repositories then add the branch with your changes to that fork which you'll be able to push to. Then you make pull request against the main repos. What changes do you have in mind? Can you post the diffs? From memory this wouldn't be completely straightforward.

Thank you for the fast response! I'll create pull requests very soon

Here are the diffs for both repos:
HotReloading.diff.zip
InjectionIII.diff.zip

The key points are:

  • if Xcode is installed at /Applications/Xcode.app then the app will work as it worked previously
  • otherwise user will be proposed to select the path to Xcode with standard NSOpenPanel
  • I've added a menu item Select Xcode so user also will be able to re-select it
    Screenshot 2022-07-20 at 21 54 29
  • Xcode path is saved to UserDefaults so used won't need to select it on each app start
  • there is ability to pass Xcode path through params when user opens the app using command line:
    open /Applications/InjectionIII.app --args -projectFile "/path/to/project" -addDirectory "/additional/directory/to/watch" -xcodeAppPath "/path/to/xcode"

Thank you! πŸ™

@johnno1962 I've created PR to HotReloading repo and PR to InjectionIII repo

Looking forward to your feedback!
Thank you!

Hi, Thanks for the time you're putting into this! You've done a great job of understanding some ageing code. To be honest, the changes you propose are a little more extensive than I'd be comfortable making at this stage without having to do an extensive retest, particularly those to do with the "rpath" of the injection bundle which I haven't changed in a long while.

I've taken a look at this problem myself taking a different approach where InjectionIII finds the path to the Xcode in use from the build logs automatically using the platform argument of the compile command rather than introducing a new item of state to the app:

https://github.com/johnno1962/HotReloading/pull/56/files

As your PR shows there are only two places where the path to the Xcode in use is required, first for linking to find clang and the platform/sdk path and secondly for code signing. If we could remove the requirement to know where the current Xcode is we wouldn't need to introduce a UI to select it.

What do you think of the alternative?

Hi @johnno1962,

A good job! Your approach is more interesting than mine πŸ‘
I've left a comment to the PR with a couple more my thoughts about it πŸ™

Thank you for your job!

@leonidmelnyk I released the new PR as 4.3.1 if you want to try it out. Thanks for bringing this up. It was time it was resolved.