[help-gnustep to bcc, +to discuss-gnustep] On Fri, Jan 22, 2016 at 2:58 PM Richard Kennaway <[email protected]> wrote:
> (Is this list dead? No postings for two years. Where else should I take > this enquiry?) > http://www.gnustep.org/information/gethelp.html Consider discuss-gnustep :-) > I have a command-line tool written in C++ and built with XCode on a Mac, > which I'm trying to port to a Linux machine. I came across buildtool, > which promises to interpret the Xcode project file and carry out the build > using the gnustep tools. I've installed gnustep, xcode, and buildtool, but > it is not clear to me how to use buildtool. No documentation comes with it > and I've found none on the web. Your choice to read the source code was the right one because, luckily, this is a very short and simple tool, with easy to follow code. (What follows is merely an interpretation while coming up with this email; I've never really used buildtool before. I could be wrong!) > From reading the source code, it takes two arguments, the name of the > Xcode project and a command to buildtool to tell it what to do with it. I > see nothing in the source to reveal what commands are available, except > that the default is "build". When I try that, buildtool begins by > attempting to build a target that I don't want to build for this platform > and wouldn't make any sense there (it's an iOS app). > > How can I tell buildtool which target I want to build? I have tried > guessing its commands, but so far it has responded to everything with > "Unknown build operation". > My interpretation is that 'build' is passed as a string, turned into a selector, and then invoked on PBXContainer (which gets unpacked using PBXCoder). Which means you're really interested in this: https://github.com/gnustep/xcode/blob/master/PBXContainer.m (Note: I'm linking to Github, because it's more convenient for me, but note that the canonical version control system is still Subversion, at http://svn.gna.org/svn/gnustep). Based on PBXContainer's implemented methods, you could seemingly call the following methods and have it work: 'build', 'clean', 'install'. Somewhat uselessly, you could (but probably want) also call 'archiveVersion', 'classes', 'objectVersion', 'objects' and 'collectHeaderFileReferences'. Amusingly, you could call 'dealloc', too, but I doubt that would help. PBXContainer's implementation of 'build' seems to forward this to the 'root object'. Reading an arbitrary .pbxproj grabbed from the Internet, a 'rootObject' will probably be an object of type PBXProject. Reading -[PBXProject build] method, you can see that the answer to your question is 'no, you cannot filter out which target will be built'. But because this is a tool (and accompanying framework) that's very easy to follow around, this seems like something that'd be very easy to hack together. I would look into how you can store the 'desired target' in GSXCBuildContext. Then, if this desired target is non-nil, you'd skip every other target when executing -[PBXProject build]. If you choose to do this, and decide to contribute the patch upstream (which means you'd follow existing code style etc), I think we can accept it even without formal copyright assignment (I think the patch might be short enough). That's probably up to Gregory, who authored the tool. Greg?
_______________________________________________ Help-gnustep mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-gnustep
