Xcode 4 plugin development

I searched everywhere but can't find anything. Does anyone know how to create an Xcode 4 plugin?

+46
plugins xcode xcode4
Jun 11 '11 at 15:52
source share
7 answers

As far as I know , there is no official way to create Xcode 4 plugins (just as it was not for v3.x).

Here is an open glad Xcode lack of plugin support:

Please support 3rd party ability to extend Xcode through public plugin API. Aperture, Visual Studio, Eclipse, TextMate, and other applications benefit from this ability. I would like to see more advanced refactoring, code analysis (think that Jetbrains Resharter), and modeling.

Provide the plugin API for Xcode 4 (rdar: // 8622025)

Please deceive this if you want plugins !




Edit: just stumbled upon this:

Cedric Luti : " Xcode 4 supports custom plugins , see CLITool-InfoPlist for an example working Xcode 4 plugin. You just need to add XC4Compatible (true) to Info.plist."

https://github.com/0xced/CLITool-InfoPlist




Considering these GitHub repositories may also be useful:




Next mogenerator The Xmod plugin can be a good starting point.
(Not at all compatible with Xcode-4, the last time I checked, though)

+53
Jun 11 '11 at 15:56
source share
— -

The best way to find out is to look at the github plugin code (see the long list below):

  • This is basically a plugin.
  • No main.m No MainMenu.xib
  • The first class is loaded by setting the NSPrincipalClass to info.plist
  • in your init: you register for AppKit notifications
  • See code examples
  • some check the mainBundle application id to make sure it is Xcode
  • The Xcode Editor Window Class is DVTSourceTextView
  • Its subclass is DVTSourceTextView: NSTextView: NSText
  • so you can register to listen to your notifications for NSTextView or NSText
  • e.g. NSTextViewWillChangeNotifyingTextViewNotification

Since it is not an official standard, I noticed that each sample is loaded differently.

XCODE PLUGIN SAMPLES

compiled either by github / web search for

'DVTSourceTextView' 

This is the class name of the Xcode editor window.

or

Info-list button

 '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 

GET IN NSTextView, which is a console

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; } 
+7
Nov 01 '12 at 16:09
source share

Take a look at this new plugin: https://github.com/sap-production/xcode-ide-maven-integration . Perhaps you can get some concepts for your plugin.

+4
22 Oct
source share

ColorSense for Xcode 4 was released on Github yesterday. Since the code is really compact, extending only to 3 classes, I think you should take a look there.

+3
Sep 09 '12 at 9:38
source share

Xcode does not have a public plug-in API.

This was the case with earlier versions, and this also applies to Xcode 4.

+2
Jun 11 2018-11-11T00:
source share

Take a look at this article: Xcode 4: Builder Interface Plugins

0
Aug 21 '12 at 19:12
source share

No, Xcode does not support plugins, alternatively you can try AppCode, another IDE for iOS / MacOS, it supports plugin development.

-3
Sep 22 2018-11-11T00:
source share



All Articles