Closed macsforme closed 5 years ago
I think you would just need to add a similar reorderProjects
function into this list call array before m.workspaceFileRefs
: https://github.com/premake/premake-core/blob/339a5f6f83ea8457804f945caec7f0987a20e405/modules/xcode/xcode4_workspace.lua#L18-L25
I can't imagine the function needing to be overly different, give the sln2005
one a whirl?
It is desirable to be able to determine which project scheme is selected by default when generating Xcode project files. I don't believe that the
startproject
option ever worked for Xcode, but I was able to do it with a workaround by reordering my project definitions so that the project I wanted to be the default was declared first in the premake scripts. This snippet of code shows how it was set up so that the main executable would come up as the start project in XcodeThis used to create a workspace laid out like this:
As of c92c7a595ee7e8a19f30bc1cb37451a9208538e3 by @tvandijck, the first project specified in the premake scripts no longer appears at the top and is no longer selected by default. Now, we have this:
So as you can see, the list of schemes in the drop-down menu doesn't mirror the list of projects in the sidebar (not before, and not now). I'm not sure what causes the schemes to generate in the order that they do (maybe something to do with dependencies between them). Digging into the BZFlag.xcworkspace/contents.xcworkspacedata file for both versions, it looks like prior to the above commit, projects were listed in the workspace file in the order that they were specified in the premake scripts, and subsequent to the above commit, projects seem to be listed in the workspace file in alphabetical order. The other consistent element seems to be that the very first project listed in the workspace file is the one that is selected by default when you first open the workspace.
It would be a big help to be able to set the start project in Xcode to save a step (and possible confusion) after generating the project files. Looking at the Visual Studio solution code here, it looks like
startproject
is implemented simply by reordering of certain elements. Is it possible to do this in Xcode using similar means, since we apparently just need to have the start project appear first in the workspace file?I can try my hand at doing the implementation, if I can just get a bit of guidance.