Monday, March 17, 2014

Setting up Eclipse for working with Object Modelling System v3

At the last school on  Object Modelling System, dr.  Gabriella (Gaby) Turek found a setup for running OMS inside Eclipse IDE (OMS developers use Netbeans). Recently Gaby improved the configuration she found in Trento. Here tehy are, her suggestions :

" So here’s what I came up lately that is IMHO “clean”
  1. Open Eclipse
  2. New > Project > General > Project
  3. After project is created, copy all the directories and files from the project you want to work on (or project skeleton directory for a new project) into the newly created project. You can do this thru Eclipse or thru the command line. If you do the latter, make sure that in Eclipse you right click on the Project name and select Refresh so that Eclipse “sees” all the new files. You can omit the netbeans folder but make sure you don’t forget the .oms one
  4. Right click on the project name again and select Properties > Builders > New > Ant builder
  5. Give it a name, browse to select the project build.xml file, and browse to select base directory (the project’s directory). Save by selecting OK.
  6. Now if you right click on the build.xml file and choose the Run As > Ant build, the “all” target will be inked to compile. Note that in the Mac, if you are also compiling fortran code as part of the build (or C, or…) you will get an error like “cannot run program gfortran file not found”. This is because Eclipse started from the UI interface does not pick up any path settings you may have. This can be overcome by starting Eclipse from the command line using the command > open -n ./
  7. To run a specific sim file. Right click on Run AS > Ant Build … . Name the the configuration. Select the targets you want to run (for example all and run, or just run)  Click on the Main tab and in the arguments section enter the sim file you want to run as in this  example:  –Dfile=simulation/Example1.sim. Click on Common tab and click on Display in favorites menu.  Create one for each simulation file
  8. So that’s how to set up and run and existing project.

I should explore what advantage comes with in step 2) selecting Java Project and proceeding the same way. You get the eclipse java builder….. not sure at this point if it buys you anything. As I mentioned I have not figured out how to set up debugging. But then I couldn’t make work too well in Netbeans either. Perhaps it requires a complete paradigm shift away from netbeans in terms of project setup. "

No comments:

Post a Comment