开发者

How to get the result of a build in Xcode 4 triggered with Applescript?

I am running an Applescript that runs Xcode 4, but the script ends no matter what, either if the build is successful or if it f开发者_开发百科ails.

Is there any way that I can wait for Xcode to finish to build and get the result? In case of a success I can just end the Applescript with a success message, but if it fails I would like to get the logs that are printed in Xcode (where I get all the errors and details) and pass them to the script so they can be saved on a file.

Can someone point me to the right procedure to do this?


Please see this question along with my answer, but essentially the build command in Xcode 4 does not work properly because of what looks to be an incomplete implementation on Apple's part. If the command actually returned a value, then Applescript would wait until it got a response before moving onto the next command.


Have you looked in the AppleScript dictionary for Xcode? Because when I look at the dictionary for Xcode 3.2, I see a command called build which takes an optional transcript argument.

build specifier : the object for the command
[static analysis boolean] : Perform static analysis along with the build.
[transcript boolean] : If given, then the full build transcript should be returned when the build finishes. Otherwise, a simple build status is returned.
[using build configuration type] : The build configuration type to use when building. If no build configuration type is given the active build configuration type is used.

I don't have an Xcode project that I can build to test this, but it would appear that you need to get the project you want to build and then call set build_results to (build the_project transcript true)

And even without the transcripts argument, you should get a build status back indicating whether the build succeeded.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜