A little-known fact about Xcode is that is supports syntax colouring and function pop-ups for Dylan files.
Whilst this is nice, it inevitably leads to the desire to be able to build Dylan programs directly from within Xcode.
There are a few problems with this, but it turns out that with a bit of scripting it is possible. To save everyone else going through the same pain that I went through, I’ve made some template projects that you can install into Xcode.
Version
The current version is 1.1.
At the moment the file archive doesn’t include any obvious indication of the version number. I’ll try to fix that at some point. For now, if in doubt, check the output of the Build Results window - you should see a version scroll past at some point!
Downloading
You can download the templates from here.
Installation
Eventually I will make an installer, but for now you have to do the installation manually.
Extract the dylan-xcode-latest.tar.gz archive:
tar xzcf dylan-xcode-latest.tar.gzThis should produce a single folder called “Dylan Tool”. Copy this into /Library/Application Support/Apple/Developer Tools/Project Templates/Command Line Utility/
Start Xcode, and choose New Project, you should now be able to choose “Dylan Tool” from the list of templates.
Usage
Once you’ve installed the template, you can create a new Dylan project by choosing File/New Project…, then selecting Dylan Tool from the Command Line Utilities section of the assistant.
You should see a new project with three source files:
- hello.lid
- hello.dylan
- hello.dylan-exports
If you know any Dylan, you should know what these are for! If not, you probably need to check out some of the tutorials first.
You should be able to build and run this project by choosing Build and Run from the Build menu.
