我到处都找过了,但是始终找不到任何信息。有人知道如何创建Xcode 4插件吗?
编辑:刚刚偶然发现了这个:
Cédric Luthi: "Xcode 4支持用户定义的插件,请参考CLITool-InfoPlist获取一个可用的Xcode 4插件示例。您只需在Info.plist中添加XC4Compatible(true)即可。"
https://github.com/0xced/CLITool-InfoPlist
话虽如此,这些GitHub存储库也可能很有用:
Xcode4插件API文档(链接失效)
Xcode插件模板(链接已更新)
此外mogenerator的Xmod插件可能是一个很好的起点。
(上次我检查时还不兼容Xcode-4)
学习的最佳方式是查看GitHub插件代码(请参见下面的长列表):
由于它不是官方标准,我注意到每个示例都以不同的方式加载。
XCODE插件示例
通过在GitHub / Web上搜索编译
'DVTSourceTextView'
'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
- (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;
}
看一下这个新插件:https://github.com/sap-production/xcode-ide-maven-integration。也许你可以从中获得一些关于你的插件的概念。
Xcode没有公开的插件API。
早期版本就是这样,Xcode 4也不例外。