Weblog · Projects · Contact Me


D for Xcode

Français

Download

D plugin for Xcode 1.0.1 (828 Kb)
Most recent update of the D plugin for Xcode. November 23, 2007.
Source code 1.0.1 (1.5 Mb)
Source code for building the plugin on your own.

Note: This plugin is only for Xcode versions 2.4.1 and 2.5. (Xcode 2.5 can be installed side by side with Xcode 3 on Mac OS X 10.5 Leopard.)

Introduction

This D plugin for Xcode makes it easy to develop tools, libraries, and applications in the D programming language using Apple’s Xcode IDE. The plugin does the following things:

Requirements

Note: This plugin hasn’t been tested with Xcode 3 and is not expected to work.

Installation

For Xcode 2.4.1:
Take the downloaded “D for Xcode.xcplugin” file to the “/Library/Application Support/Apple/Developer Tools/Plug-ins” folder (create the folder if you need to), and relaunch Xcode.
For Xcode 2.5:
Take the downloaded “D for Xcode.xcplugin” file to the “/Library/Application Support/Developer/2.5/Xcode/Plug-ins” folder (create the folder if you need to), and relaunch Xcode.

Alternatively you can install the plugin in the Library folder in your own user account.

Once this is done, you can create D files and add them to the desired targets in your Xcode projects, and they should compile and link fine.

Screenshots

Known Issues

Crash Workaround (if you need it)

D for Xcode adds a full D parser running within the Xcode process. This means that if something goes wrong when parsing your file, it has the potential to crash Xcode. While I’ve made all efforts I could to avoid that situation, you may still prefer to disable it if you experience crashes. So if you ever need to disable real-time syntax highlighting and code parsing (for the editor pop-up menu), here’s how to do it.

Open the plugin package by control-clicking or right-clicking on the plugin file from the Finder to open the contextual menu, and choose “Show Package Content”. From there, open the “Resources” folder and the “d.pblangspec” file in a text editor. Near the start of the file, you’ll see these two lines:

SourceScannerClassName = DXDSourceScanner;
SourceLexerClassName = DXDSourceLexer;

Comment them out (by adding // at the start of each line) and relaunch Xcode. This will prevent Xcode from invoking the parser built in the plugin, but shouldn’t affect the build process. Syntax highlighting will default to using the Xcode built-in lexer with custom rules which can’t keep track of everything in D, but is still good enough for most cases.

About Module Directories

The compiler and the dependency checker assumes the module directory you’re working with is the directory project directory. This means that a module named mypackage.mymodule must be located at PROJECT_DIR/mypackage/mymodule.d. You can add other module directories (if you want to include libraries for instance), but the dependency graph doesn’t take them into account and your files depending on them won’t be recompiled automatically if you change them (you’ll need to clean the target first). Let me know if this is a problem for you.

Bug Reports

If you find a problem, whether it’s crashing Xcode or not, I’d like to know about it. Please give me any relevant information (such as Xcode crash logs if Xcode crash) and the appropriate steps, or files, to replicate the problem (so I can debug it locally). You can send bug reports at this address: michel.fortin@michelf.com.

License

D for Xcode is available under the GNU General Public License, version 2 or later.

Version History

D for Xcode 1.0.1 (November 23, 2007)

D for Xcode 1.0 (November 20, 2007)


Site powered by: Reflex