This page describes how set up Eclipse to develop Scilab.
Contents
1. Tools installation
1.1. Scilab
Retrieve scilab sources. git clone git://git.scilab.org/scilab
- From this part, the directory containing Scilab sources will be called SCI_SRC.
1.2. Eclipse
Go to the eclipse web site and Download the eclipse platform.
1.3. Eclipse: Checkstyle plugin
Follow these instructions: Download and Install.
- Add Scilab Checkstyle as default:
- Menu Window/Preferences
- Select Checkstyle node
- Click on the "New" button, choose external configuration and select SCI/checkstyle/scilab_checkstyle_convention.xml
- Set this new checktyle as default
- Do not forgot to activate checkstyle on the project you will create
2. Modules import
- Now you have to import all Scilab Gui modules within Eclipse.
- You need to import all the modules below :
- action_bindings
- commons
- completion
- console
- core
- external_objects_java
- graph
- graphic_export
- graphic_object
- gui
- helptools
- history_browser
- history_manager
- javasci
- jvm
- localization
- preferences
- renderer
- scinotes
- scirenderer
- types
- ui_data
- xcos
We will only describe how to do it for the gui module.
- Repeat the next steps for each module you want to import in Eclipse.
2.1. Example : Import GUI module
- Open eclipse.
Choose File menu / New / Project
In the wizard open choose Java Project from Existing Ant BuildFile then Next
Click on Browse to give Eclipse the path for the gui module ant buildfile
Now click Finish
You should see a gui project in your eclipse environment now.
3. Module Build Path Cleaning
Now we will clean up the dependencies of the imported projects. The inter-dependencies of the modules and the third-party jar dependencies will be added manually, so we basically remove everything. We have to do this for each module.
Right Click on a module / Build Path / Configure Build Path...
At the Libraries tab, remove everything, except JRE_LIB
4. Module dependencies Resolution
Now we have unlinked the jar dependencies of each module, we have to explain eclipse how to compile and link all
those modules together.
- We have to enable the dependencies below :
- action_bindings depends on :
localization
- commons depends on :
localization
- completion depends on :
localization
- console depends on :
action_bindings
commons
completion
history_manager
jvm
localization
- core depends on :
commons
console
graphic_objects
gui
jvm
localization
- external_objects_java depends on :
commons
- graph depends on :
commons
gui
jvm
localization
types
- graphic_export depends on :
commons
graphic_objects
renderer
localization
scirenderer
- graphic_objects depends on :
action_binding
commons
localization
scirenderer
- gui depends on :
action_bindings
commons
console
graphic_export
graphic_objects
history_manager
jvm
localization
renderer
scirenderer
- helptools depends on :
commons
gui
localization
- history_browser depends on :
action_binding
commons
graphic_objects
gui
history_manager
localization
- history_manager depends on :
commons
- javasci depends on :
types
- jvm depends on :
commons
- localization depends on :
nothing
- preferences depens on :
commons
gui
localization
scinotes
- renderer depends on :
commons
console
graphic_objects
jvm
localization
scirenderer
- scinotes depends on :
action_bindings
commons
completion
console
core
gui
helptools
history_manager
jvm
localization
- scirenderer depends on :
nothing
- types depends on :
localization
- ui_data depends on :
action_bindings
commons
graphic_objects
gui
localization
types
- xcos depends on :
action_bindings
commons
core
graph
gui
helptools
javasci
localization
types
- action_bindings depends on :
4.1. Example : Resolve GUI module dependencies
- Open the GUI module
Right click on the module name / Build Path / Configure Build Path
Go on the Tab named Project
Click Add
- Now check the box for each dependence you want to add :
Check action_bindings
Check console
Check graphic_export
Check localization
Check renderer
Check scirenderer
Click OK
Click OK
5. Third-party JARs
- Check out the dependencies from the SVN repository:
cd scilab svn export --username anonymous --password Scilab svn://svn.scilab.org/scilab/trunk/Dev-Tools/SE/Prerequirements/Windows/
- Right-click on each project
Right Click on a module / Build Path / Configure Build Path...
At the Libraries tab, choose Add External JARs...
Browse out the third-party JARs, which are in the thirdparty folder of the checked out sources. Select all of them, except scirenderer, since this latter has been already added as a module dependency.
6. Projects compilation
- Now, with all projects opened in your Eclipse workspace :
- If you enabled the automatic build, process should already be done and you must not have any compilation error problem.
If you choose to compile it manually, Click on Project menu / Build All
7. Debugging a specific java module
- Configure Scilab with the JVM remote debuging enable by default
- To do so, you have to edit an XML configuration file in the Scilab directory: etc/jvm_options.xml.
The debugging options are already there in the file, somewhere at the bottom of the file, commented out. Remove the <!-- and --> XML comments around the debugging options.
For further information on enabling remote debugging, take a look at the related JVM documentation.
- Attach Debug to the Scilab JVM
- Start your Eclipse with the sources imported as described above.
- Set up the desired breakpoints.
Create a new debug configuration. Choose Remote Jave Application, and set host and port to localhost and 8000, respectively.
- Launch the debugger and it will attach to the Scilab JVM.
For further notes on remote debugging in Eclipse, take a look at the IBM DeveloperWorks technotes.
Note: instead of configuring the debug for all Scilab, you can start a specific Scilab binary with the JVM remote debuging enabled using an environment variable (depending on your OS)
_JAVA_OPTIONS="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n" bin/scilab