discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to use buildtool?


From: Gregory Casamento
Subject: Re: How to use buildtool?
Date: Sat, 23 Jan 2016 17:32:41 -0500

Ivan/Richard,

​buildtool/xcode framework is still very much a work in progress... so any help is welcomed.​  One thing that should be laid out up front is that the framework's structure is based on the output of the meta-tool contained in the Tools directory in the dev-libs/xcode directory.  The tool was used to analyze the structure of the plist .xcodeproj file and the attributes of the classes and then behavior was then filled in by me.   The result is that the xcodeproj files are completely read into the classes of the framework when the xcodeproj file is read into memory and organized precisely the way they are laid out in the file so that dependencies and all information about each target is known.

What is currently missing is the ability to control which targets are built, as Ivan explained.   If you would like to submit a patch, please do so.  It would be most welcome if it helps the framework to function better.

I have briefly replied below to some of the questions.


On Sat, Jan 23, 2016 at 2:12 PM, Ivan Vučica <ivan@vucica.net> wrote:
[help-gnustep to bcc, +to discuss-gnustep]

On Fri, Jan 22, 2016 at 2:58 PM Richard Kennaway <richard@kennaway.org.uk> wrote:
(Is this list dead? No postings for two years. Where else should I take this enquiry?)

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!)


​The only other option was to include the xcode framework in the same directory as the tool and this just didn't seem right since the framework is of general use.​

 

>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".

​You need to pass in "build", "clean", or "install"
 

My interpretation is that 'build' is passed as a string, turned into a selector, and then invoked on PBXContainer (which gets unpacked using PBXCoder).

​This is correct.   The reason it is done this way is that if more build methods are added, we can support them.  It could be friendlier though.
 

Which means you're really interested in this:
(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.

​This is also correct.​

 

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].

​Yes, I believe this would be a possible solution.​

 
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?

​Yes, please, feel free.
 

_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnustep




--
Gregory Casamento
GNUstep Lead Developer / OLC, Principal Consultant
http://www.gnustep.org - http://heronsperch.blogspot.com
http://ind.ie/phoenix/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]