Reg*_*ent 53
据我所知,没有正式的方法来创建Xcode 4插件(就像没有一个用于v3.x).
这是一个关于Xcode缺乏插件支持的openradar:
请支持第三方通过公共插件API扩展Xcode的能力.Aperture,Visual Studio,Eclipse,TextMate和其他应用程序都受益于此功能.我希望看到更高级的重构,代码分析(想想Jetharins的Resharper)和建模.
如果你想要插件,请欺骗这个!
编辑:偶然发现了这个:
CédricLuthi:" Xcode 4确实支持用户定义的插件,请参阅 CLITool-InfoPlist 以获取有效的Xcode 4插件示例.您只需在Info.plist中添加XC4Compatible(true)."
https://github.com/0xced/CLITool-InfoPlist
据说这些GitHub回购也可能很方便:
Xcode4 Plugin-API文档(链接死机)
Xcode插件模板(链接更新)
更多mogenerator的Xmod插件可能是一个很好的起点.
(不是Xcode-4兼容,但我上次检查过)
最好的学习方法是查看github插件代码(参见下面的长列表):
因为它不是官方标准,我注意到每个样本以不同的方式加载.
XCODE PLUGIN样品
通过搜索github/web编译
'DVTSourceTextView'
Run Code Online (Sandbox Code Playgroud)
这是Xcode Editor窗口类名
要么
信息列表键
'XC4Compatible'
https://github.com/omz/ColorSense-for-Xcode
https://github.com/ciaran/xcode-bracket-matcher
- uses a ruby parser run as pipe!
https://github.com/joshaber/WTFXcode
https://github.com/0xced/NoLastUpgradeCheck
http://code.google.com/p/google-toolbox-for-mac/downloads/list
see GTMXcode4Plugin
https://github.com/DeepIT/XcodeColors
https://github.com/0xced/CLITool-InfoPlist
https://github.com/sap-production/xcode-ide-maven-integration
https://github.com/ciaran/xcode-bracket-matcher
Run Code Online (Sandbox Code Playgroud)
获取作为控制台的NSTextView
https://github.com/sap-production/xcode-ide-maven-integration
- (NSTextView *)findConsoleAndActivate {
Class consoleTextViewClass = objc_getClass("IDEConsoleTextView");
NSTextView *console = (NSTextView *)[self findView:consoleTextViewClass inView:NSApplication.sharedApplication.mainWindow.contentView];
if (console) {
NSWindow *window = NSApplication.sharedApplication.keyWindow;
if ([window isKindOfClass:objc_getClass("IDEWorkspaceWindow")]) {
if ([window.windowController isKindOfClass:NSClassFromString(@"IDEWorkspaceWindowController")]) {
id editorArea = [window.windowController valueForKey:@"editorArea"];
[editorArea performSelector:@selector(activateConsole:) withObject:self];
}
}
}
return console;
}
Run Code Online (Sandbox Code Playgroud)