Those are good questions, I'll try to do my best and answer with what I know about this workflow. Note that this is still an in progress work and we are working towards a better developer experience.
This is the project generated by build script (cmake actually) and yes, it contains all targets of swift project and reference to all the source files across all compiler components e.g. libParse, libSema,... etc and as well as other components such as runtime and standard library.
So the goal of having this Swift.xcodeproj dropped into the workspace is that so it is used by Xcode to reference all source files and provide an editor experience so you can search for a file in the workspace and start making changes.
This workflow is based on taking Xcode IDE and use that on top of ninja build system. To give a bit more context before we use to build fully on top of Xcode, but that was not stable as ninja build so that is why this is the recommended workflow now. You can read more about this in here Remove/Deprecate —xcode option from build script.
But to answer the question this new project will serve as a link from Xcode to an "External Build System" in this case ninja and where we are going to create our target so we can via Xcode, link an Xcode target to a ninja executable, trigger a ninja build, attach to the debugger and start working. So in short terms, this new project is the bridge from Xcode to ninja.
It depends on what you want to work on. For the compiler you want swift-frontend
. But you don't want to add the one from Swift.xcodeproj
(perhaps you will to help Xcode with indexing). But at this point you should create a new target that points to the ninja executable. And that is the step right after Create an empty Xcode project in the workspace
.
Once we have everything setup, we are able to invoke swift-frontend executable from Xcode and actually pass arguments to it, so you can create a simple swift file and pass as an argument through Xcode to the frontend executable with custom flags maybe. I normally get the arguments from lit execution of a test file run with -a
. But there is more info about how to debug things down in this GettingStarted
file.
I think that is it, hope that helps