有关于构建Xcode 4插件的任何文档吗? [英] Is there any documentation for building Xcode 4 plugins?

查看:87
本文介绍了有关于构建Xcode 4插件的任何文档吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我注意到了一些关于 github 的项目,通过插件扩展了Xcode 4的功能。

Recently I've noticed a couple of projects on github that extend the functionality of Xcode 4 via plugins.

@olemoritz 的两个项目作为示例:

Two projects as examples by @olemoritz:

  • MiniXcode changes the main toolbar.
  • ColorSense provides overlays to help pick colours.

这两个项目都安装在〜/ Library / Application Support / Developer / Shared / Xcode / Plug-ins 中,Xcode只是选择它们。

Both projects are installed into ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins and Xcode just picks them up.

扩展Xcode时是否有任何文档来源(官方或用户生成)?

Are there any sources of documentation (officlal or user generated) on extending Xcode?

ping @olemortiz ;)

推荐答案

当我写了你提到的这些插件,这里有一些指针:

As I wrote those plugins you mentioned, here are some pointers:


  • 官方文档从苹果,所以虽然Xcode有一个插件基础设施,它是完全私人的API。 (但嘿,没有人想提交Xcode插件到App Store,对吗?)) - 通常的警告适用:你应该编码非常防御,可能Xcode更新破坏的东西。任何插件可以完全带来Xcode,所以要小心。

  • There is no official documentation from Apple, so while Xcode does have a plugin infrastructure, it is entirely private API. (but hey, no one wants to submit Xcode plugins to the App Store, right? ;)) – The usual warnings apply: You should code very defensively, and it's possible that Xcode updates break things. Any plugin can bring Xcode down entirely, so be careful.

有一个看似放弃的工作来记录插件接口在这里

There is a seemingly abandoned effort to document the plugin interface here.

有一些开源项目可以让你看到需要什么一个插件加载在所有,例如我的,并有 CLITool-Infoplist (我认为这是我得到的基本结构,但我不能真正记住,

There are some open source projects that allow you to see what's needed to get a plugin loaded at all, e.g. mine and there's CLITool-Infoplist (I think that's where I got the basic structure from, but I can't really remember, because I've been doing this without publishing anything for quite a while).

您可以使用 class-dump 从Xcode的私有框架生成头文件,例如IDEKit和IDEFoundation(在 Xcode.app/Contents/Frameworks )。阅读这些内容可以让你了解Xcode内部结构的相关信息。 DVTKit和DVTFoundation(在 Xcode.app/Contents/SharedFrameworks )也可用于类转储。

You can use class-dump to generate headers from Xcode's private frameworks, e.g. IDEKit and IDEFoundation (in Xcode.app/Contents/Frameworks). Reading those gives you quite a bit of information on how Xcode is structured internally. DVTKit and DVTFoundation (in Xcode.app/Contents/SharedFrameworks) can also be useful to class-dump.

您可以通过注册 nil 的观察者来观察在Xcode中发送的所有通知。

You can observe all notifications that are sent in Xcode by registering an observer for nil. I initially just logged all those notifications to get an idea of where I might be able to hook into.

祝你好运!

这篇关于有关于构建Xcode 4插件的任何文档吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆