www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - My attempt to integrate the dmd compiler with eclipse

reply "Hasan Aljudy" <hasan.aljudy gmail.com> writes:
Hi, I'm kind of new here, I've been looking at the site for sometime now and 
I'm really liking the concept of D. I haven't played with it much due to my 
laziness and the lack of a good IDE.

I've been looking around and, I found an eclipse plugin that somebody wrote 
which basically implemented a syntax hilighter .. but no compiler nor a 
debugger ..
So after a while I realized that the IDE I'm looking for doesn't exist 
(yet), so I decided to make one!!!
Actually, I decided to try and write a plugin for eclipse to support D.

This is actually my first eclipse plugin ever, so it's very very hackish .. 
it's pretty much just a proof of concept (if that's what you'd call it).

How do you use it?
Simple, you should see a "D" button on your toolbar, so just click it.
The only thing it does is invoke the compiler against all the .d files in 
your project and create a your-project-name.exe
dmd.exe file1.d file2.d file3.d projectname.exe
Most of it is hard coded, however you can specify the path of the compiler 
(in window->preferences->D compiler), actually, you HAVE to specify the path 
or the plugin won't work.
The plugin doesn't support launching yet .. so you'd have to use the command 
line for that (or by double clicking, if you know how to make the console 
window not disappear in a blink of an eye)
So when you actually click the button you won't see anything happen, it's 
very possible that your code produces error messeges without you having a 
clue.

I only started a couple of days ago and I'm just so excited, which is why 
I'm posting it now.

The plugin really sucks at this stage, but I hope that I (or somebody else) 
will work on it to make it better.

I'm also a newb to this news:// thing (why can't you just use a forum?), I'm 
using outlook express to post this messege and I'm trying to attach a file, 
however I have no clue whether the file will get attached or not.

Enjoy! (assuming the attachment works)
Like I said I know it's horrobly sucky at the moment, but atleast I'm trying 
to do something. 
Apr 29 2005
next sibling parent reply John Reimer <brk_6502 yahoo.com> writes:
Hasan Aljudy wrote:
 Hi, I'm kind of new here, I've been looking at the site for sometime now and 
 I'm really liking the concept of D. I haven't played with it much due to my 
 laziness and the lack of a good IDE.
 
 I've been looking around and, I found an eclipse plugin that somebody wrote 
 which basically implemented a syntax hilighter .. but no compiler nor a 
 debugger ..
 So after a while I realized that the IDE I'm looking for doesn't exist 
 (yet), so I decided to make one!!!
 Actually, I decided to try and write a plugin for eclipse to support D.
 
 This is actually my first eclipse plugin ever, so it's very very hackish .. 
 it's pretty much just a proof of concept (if that's what you'd call it).
 
 How do you use it?
 Simple, you should see a "D" button on your toolbar, so just click it.
 The only thing it does is invoke the compiler against all the .d files in 
 your project and create a your-project-name.exe
 dmd.exe file1.d file2.d file3.d projectname.exe
 Most of it is hard coded, however you can specify the path of the compiler 
 (in window->preferences->D compiler), actually, you HAVE to specify the path 
 or the plugin won't work.
 The plugin doesn't support launching yet .. so you'd have to use the command 
 line for that (or by double clicking, if you know how to make the console 
 window not disappear in a blink of an eye)
 So when you actually click the button you won't see anything happen, it's 
 very possible that your code produces error messeges without you having a 
 clue.
 
 I only started a couple of days ago and I'm just so excited, which is why 
 I'm posting it now.
 
 The plugin really sucks at this stage, but I hope that I (or somebody else) 
 will work on it to make it better.
 
 I'm also a newb to this news:// thing (why can't you just use a forum?), I'm 
 using outlook express to post this messege and I'm trying to attach a file, 
 however I have no clue whether the file will get attached or not.
 
 Enjoy! (assuming the attachment works)
 Like I said I know it's horrobly sucky at the moment, but atleast I'm trying 
 to do something. 
 
 

Nice work, Hasan. Perhaps you could continue the project at dsource.org? If you decide to, you can talk to Brad, the site admin there. He can set you up with a project (or you can continue by modifying the eclipseD project). I think a lot of people would be very interested to see this project take shape. - JJR
Apr 29 2005
next sibling parent reply "Hasan Aljudy" <hasan.aljudy gmail.com> writes:
 I too have tried to integrate D development in Eclipse. I also installed
 EclipseD (the plugin that does syntax highlight), but for project 
 management
 I used an External Tool configuration that would call Build (Derek 
 Parnell's
 tool, are you familiar with it?) to build files, which for now is a better
 solution than yours I think. Later I made a simple Ant .xml file with 
 clean,
 make, and run targets, etc. (they now used Build with configurable
 arguments).

No, I haven't really heared of "Build", and I'm not familiar with Ant either. And yeah, I guess using one of those is a better solution than mine. Where can I find some resources/tutorials for some of these things? I mean, these command line build tools that one would use to manage a project from the command line? I'm a total n00b really when it comes to managing large stuff from the command line (which is why I started this plugin in the first place ..). I barely know how "make" works. The only thing I know is that source files compile to object files, then object files get linked into an executable. When one source file changes, you only recompile that file into its object file, then relink all the object files into the executable.
 Nice work, Hasan.  Perhaps you could continue the project at
 dsource.org?  If you decide to,  you can talk to Brad, the site admin
 there.  He can set you up with a project (or you can continue by
 modifying the eclipseD project).

I don't wanna put it on dsrouce.org yet, I have a tendency for not completing my projects .. I don't want to put it there for nothing. I downloaded eclipseD source code, I'll see if I can merge my plugin with it or merge it with my plugin. Anyway, here is the new version of my plugin, there is only one change: compiler output is now displayed in a "D Compiler Output" view (Window -> Show View -> Other.. -> D plugin views -> D Compiler Output)
Apr 30 2005
next sibling parent reply Derek Parnell <derek psych.ward> writes:
On Sat, 30 Apr 2005 18:24:07 -0600, Hasan Aljudy wrote:

 No, I haven't really heared of "Build"

 Where can I find some resources/tutorials for some of these things?

http://www.dsource.org/projects/build -- Derek Parnell Melbourne, Australia 1/May/2005 10:57:19 AM
Apr 30 2005
parent "Hasan Aljudy" <hasan.aljudy gmail.com> writes:
 No, I haven't really heared of "Build"

 Where can I find some resources/tutorials for some of these things?

http://www.dsource.org/projects/build

Ah! Thanks for that, I made a few changes to allow build to be used as the compiler (I just supplied the running process with the system's PATH variable) Also made some improvements for the source-file-retriving mechanism to go inside folders (recursively). I can't believe there's no built-in mechanism in eclipse for that, I mean getting a list of source files in a project (unless it's there and I can't see it). new version attached.
May 01 2005
prev sibling parent "Bruno Medeiros" <daiphoenixNOSPAM lycos.com> writes:
"Hasan Aljudy" <hasan.aljudy gmail.com> wrote in message 
news:d517jb$1h9m$1 digitaldaemon.com...
 I too have tried to integrate D development in Eclipse. I also installed
 EclipseD (the plugin that does syntax highlight), but for project 
 management
 I used an External Tool configuration that would call Build (Derek 
 Parnell's
 tool, are you familiar with it?) to build files, which for now is a 
 better
 solution than yours I think. Later I made a simple Ant .xml file with 
 clean,
 make, and run targets, etc. (they now used Build with configurable
 arguments).

No, I haven't really heared of "Build", and I'm not familiar with Ant either. And yeah, I guess using one of those is a better solution than mine. Where can I find some resources/tutorials for some of these things? I mean, these command line build tools that one would use to manage a project from the command line? I'm a total n00b really when it comes to managing large stuff from the command line (which is why I started this plugin in the first place ..). I barely know how "make" works.

Some info: Ant is a build tool, like 'make' and SCons, usually more popular in the Java community. In 'make' you have a normal text file (Makefile) written in the makefile language. In SCons the build file is a Python script. In Ant, the build file is a XML file. Ant is a shell command tool, like make, but Eclipse comes packaged with support for Ant (it includes command-line Ant, and an Ant View that shows the targets of an Ant build.xml file, and where you can click the target icon and build that target). It was because of this view that I later made a .xml file instead of just the .bat I initialy had. See my other reply in this thread if you want to see the build.xml file.
May 03 2005
prev sibling parent reply Hasan Aljudy <hasan.aljudy gmail.com> writes:
I put it on dsource.org (read: I took over eclipseD)
The old eclipseD became org.dsource.deditor, and my plugin became 
org.dsource.dbuilder, together they make eclipseD. (They are seperate 
plugins).

http://www.dsource.org/projects/eclipseD/?sec=downloads

I've made several improvements to dbuilder, you can now launch your 
project from the launch menu (there is no shortcut yet, so you'd have to 
click "run as.." first), you an also pass arguments to your program.
There are two views: compiler output view, and application output view.
The compiler output just displays the output of the compiler, while the 
application output view is a humble attempt to mimic the "Console" 
(read: you can't input to your program, yet).
You have to activate these views from "Window->Show View->Other.." first.

Again, to use the compiler you must set it first from 
"Window->preferences->D->D Compiler", I personally use "build" as the 
compiler, seems to work better with the way I set things up (read: I 
don't know how to make dmd properly compile files inside subfolders).

John Reimer wrote:
 Hasan Aljudy wrote:
 
 Hi, I'm kind of new here, I've been looking at the site for sometime 
 now and I'm really liking the concept of D. I haven't played with it 
 much due to my laziness and the lack of a good IDE.

 I've been looking around and, I found an eclipse plugin that somebody 
 wrote which basically implemented a syntax hilighter .. but no 
 compiler nor a debugger ..
 So after a while I realized that the IDE I'm looking for doesn't exist 
 (yet), so I decided to make one!!!
 Actually, I decided to try and write a plugin for eclipse to support D.

 This is actually my first eclipse plugin ever, so it's very very 
 hackish .. it's pretty much just a proof of concept (if that's what 
 you'd call it).

 How do you use it?
 Simple, you should see a "D" button on your toolbar, so just click it.
 The only thing it does is invoke the compiler against all the .d files 
 in your project and create a your-project-name.exe
 dmd.exe file1.d file2.d file3.d projectname.exe
 Most of it is hard coded, however you can specify the path of the 
 compiler (in window->preferences->D compiler), actually, you HAVE to 
 specify the path or the plugin won't work.
 The plugin doesn't support launching yet .. so you'd have to use the 
 command line for that (or by double clicking, if you know how to make 
 the console window not disappear in a blink of an eye)
 So when you actually click the button you won't see anything happen, 
 it's very possible that your code produces error messeges without you 
 having a clue.

 I only started a couple of days ago and I'm just so excited, which is 
 why I'm posting it now.

 The plugin really sucks at this stage, but I hope that I (or somebody 
 else) will work on it to make it better.

 I'm also a newb to this news:// thing (why can't you just use a 
 forum?), I'm using outlook express to post this messege and I'm trying 
 to attach a file, however I have no clue whether the file will get 
 attached or not.

 Enjoy! (assuming the attachment works)
 Like I said I know it's horrobly sucky at the moment, but atleast I'm 
 trying to do something.

Nice work, Hasan. Perhaps you could continue the project at dsource.org? If you decide to, you can talk to Brad, the site admin there. He can set you up with a project (or you can continue by modifying the eclipseD project). I think a lot of people would be very interested to see this project take shape. - JJR

May 03 2005
parent John Reimer <brk_6502 yahoo.com> writes:
Hasan Aljudy wrote:
 I put it on dsource.org (read: I took over eclipseD)
 The old eclipseD became org.dsource.deditor, and my plugin became 
 org.dsource.dbuilder, together they make eclipseD. (They are seperate 
 plugins).
 
 http://www.dsource.org/projects/eclipseD/?sec=downloads
 
 I've made several improvements to dbuilder, you can now launch your 
 project from the launch menu (there is no shortcut yet, so you'd have to 
 click "run as.." first), you an also pass arguments to your program.
 There are two views: compiler output view, and application output view.
 The compiler output just displays the output of the compiler, while the 
 application output view is a humble attempt to mimic the "Console" 
 (read: you can't input to your program, yet).
 You have to activate these views from "Window->Show View->Other.." first.
 
 Again, to use the compiler you must set it first from 
 "Window->preferences->D->D Compiler", I personally use "build" as the 
 compiler, seems to work better with the way I set things up (read: I 
 don't know how to make dmd properly compile files inside subfolders).
 

Excellent! And thank you! I guess we should get Brad to move eclipseD project out of its "inactive" status in the dsource forums then. ;-) Good to see "build" put to more good use. Elephant also currently uses "build" for project building. -JJR
May 03 2005
prev sibling parent reply "Bruno Medeiros" <daiphoenixNOSPAM lycos.com> writes:
"Hasan Aljudy" <hasan.aljudy gmail.com> wrote in message 
news:d4sna0$2tpm$1 digitaldaemon.com...
 Hi, I'm kind of new here, I've been looking at the site for sometime now 
 and I'm really liking the concept of D. I haven't played with it much due 
 to my laziness and the lack of a good IDE.

 I've been looking around and, I found an eclipse plugin that somebody 
 wrote which basically implemented a syntax hilighter .. but no compiler 
 nor a debugger ..
 So after a while I realized that the IDE I'm looking for doesn't exist 
 (yet), so I decided to make one!!!
 Actually, I decided to try and write a plugin for eclipse to support D.

 This is actually my first eclipse plugin ever, so it's very very hackish 
 .. it's pretty much just a proof of concept (if that's what you'd call 
 it).

 How do you use it?
 Simple, you should see a "D" button on your toolbar, so just click it.
 The only thing it does is invoke the compiler against all the .d files in 
 your project and create a your-project-name.exe
 dmd.exe file1.d file2.d file3.d projectname.exe
 Most of it is hard coded, however you can specify the path of the compiler 
 (in window->preferences->D compiler), actually, you HAVE to specify the 
 path or the plugin won't work.
 The plugin doesn't support launching yet .. so you'd have to use the 
 command line for that (or by double clicking, if you know how to make the 
 console window not disappear in a blink of an eye)
 So when you actually click the button you won't see anything happen, it's 
 very possible that your code produces error messeges without you having a 
 clue.

 I only started a couple of days ago and I'm just so excited, which is why 
 I'm posting it now.

 The plugin really sucks at this stage, but I hope that I (or somebody 
 else) will work on it to make it better.

 I'm also a newb to this news:// thing (why can't you just use a forum?), 
 I'm using outlook express to post this messege and I'm trying to attach a 
 file, however I have no clue whether the file will get attached or not.

 Enjoy! (assuming the attachment works)
 Like I said I know it's horrobly sucky at the moment, but atleast I'm 
 trying to do something.

I too have tried to integrate D development in Eclipse. I also installed EclipseD (the plugin that does syntax highlight), but for project management I used an External Tool configuration that would call Build (Derek Parnell's tool, are you familiar with it?) to build files, which for now is a better solution than yours I think. Later I made a simple Ant .xml file with clean, make, and run targets, etc. (they now used Build with configurable arguments). To make a complete D IDE plugin for Eclipse would be one of the best things that could happen to D and the D community. Eclipse has already proven to be one of the most relevant development applications out there. It has one of the best Java IDEs out there (if not the best). I even liked and used most of CDT (C/C++ Development Tools) more that Visual Studio 2003 in a C++ project I did last semester. It is definitely an excellent and powerfull RCP platform and IDE plugin platform, and it's free/open-source of course. It also came to my mind to contribute to a D IDE plugin, but college eats away most of my time. (But I haven't gave up the ideia) Bruno Medeiros
Apr 29 2005
parent reply Marco <Marco_member pathlink.com> writes:
I too have tried to integrate D development in Eclipse. I also installed 
EclipseD (the plugin that does syntax highlight), but for project management 
I used an External Tool configuration that would call Build (Derek Parnell's 
tool, are you familiar with it?) to build files, which for now is a better 
solution than yours I think. Later I made a simple Ant .xml file with clean, 
make, and run targets, etc. (they now used Build with configurable 
arguments).
Bruno Medeiros 

please post your Eclipse plugin stuff here or at http://www.dsource.org/
Apr 30 2005
parent "Bruno Medeiros" <daiphoenixNOSPAM lycos.com> writes:
"Marco" <Marco_member pathlink.com> wrote in message 
news:d501ju$eh8$1 digitaldaemon.com...
I too have tried to integrate D development in Eclipse. I also installed
EclipseD (the plugin that does syntax highlight), but for project 
management
I used an External Tool configuration that would call Build (Derek 
Parnell's
tool, are you familiar with it?) to build files, which for now is a better
solution than yours I think. Later I made a simple Ant .xml file with 
clean,
make, and run targets, etc. (they now used Build with configurable
arguments).
Bruno Medeiros

please post your Eclipse plugin stuff here or at http://www.dsource.org/

It is not a plugin, it is just a very simple Ant build file. I've attached it if you still want to see. Just copy the build.xml to your eclipse (simple) project base dir, open an Ant View in eclipse, and in the view add the build.xml file. You'll have to tweak the .xml for your projects, but I think it's self-explanatory how to do so. The one I have attached is for a SDL test project.
May 03 2005