I’m interested in contributing to Swift by working on the local refactoring functionality and need some guidance on building the Swift toolchain locally and integrating it with Xcode.
Great to hear that you’re interested in contributing.
The way I recently tested a local toolchain build in Xcode is the following (there might be other ways, but this has worked for me):
Add the following parameters to my build-script invocation: --install-swift --install-llvm --install-destdir build/toolchain
Create an Info.plist in XcodeDefault.xctoolchain with contents like below
Copy XcodeDefault.xctoolchain to /Library/Developer/Toolchains (I don’t remember whether I needed to rename it from XcodeDefault.xctoolchain to eg. LocalToolchain.xctoolchain or not.
Relaunch Xcode
Select the local toolchain from Xcode -> Toolchains
During development, I usually find it easier to write test cases and develop against them instead of testing inside Xcode, though (see swift/test/refactoring at main · swiftlang/swift · GitHub for examples). And then only verify that everything works as expected once I’m happy with the test cases.
Thank you both for your responses! I’ll try out the approaches you’ve mentioned and follow up if I run into any issues. Appreciate the guidance and suggestions!