Omath using Eclipse

From Omath

Jump to: navigation, search

Contents

Download eclipse 3.1

After you've downloaded it, unzip it wherever you'd like to install it; there's no actual installation program. The first time eclipse runs, it will ask you which workspace to use; I'd recommend you use one somewhere in your home directory, in the sort of place you'd usually keep the files for a project.

If you have a Debian linux installation you can install eclipse with

apt-get install eclipse-platform eclipse-pde eclipse-jdt

Install subclipse

Start eclipse, go to Help|Software Updates|Find and Install. Select 'Search for new features to install', click 'New Remote Site', and enter the URL 'http://subclipse.tigris.org/update'. The rest should be obvious.

Tell subclipse about the omath repository

In eclipse, go to Window|Open Perspective|Other, and select 'SVN Repository Exploring'. Right click in the 'SVN Repository' view, and slect New|Repository Location. Enter the URL of your repository; for omath, this is http://svn.omath.org/ You can leave Root URL blank.

You should probably enter your username and password as well. (If you're not Dror or Yossi, you don't have one yet; ask me.)

Check out the omath source tree as a java project

Under the newly added repository, find the folder /kernel/trunk. Right click on this, and select 'Check Out As...', then select Java project. Type in the project name (probably 'kernel', or similar), then go to the section 'JDK compliance', and select '5.0'. Now click 'Finish'. If you get a dialog titled 'Confirm Overwrite', just click okay.

You should be able to run either the applet or the command line program from within Eclipse; right-click on either OmathApplet.java or Omath.java in the org.omath.ui package, and select 'Run As'.

If you make changes (please do!) you can check them back in by right clicking on the project folder (or a subfolder), selecting 'Team' then 'Commit'. All the other SVN commands are listed under 'Team'. You might want to look at Getting started hacking omath.

troubleshooting

You may need to right-click on the top folder of the project, select 'Build Path', and tell eclipse that the source files live in the folder 'java-source'. (While you're at it, tell it to put output files in 'classes'; this will make building the jar easier if you need to do that later.)

Edit your local.properties file

There are a few times we can't avoid making references to the local file system. These are all wrapped up in your local.properties file. Go the the /ant directory,

copy
 local.properties.template ---> local.properties 

then make the appropriate changes in the local.properties file. Hopefully it should just be a matter of choosing either the windows or unix looking lines, and changing the paths to match your setup.

Make .nb file assocations in Eclipse (optional)

If you have Mathematica, you may want to tell Eclipse to load .nb file in Mathematica (there are a few Mathematica notebooks included in omath's repository). Under Preferences, go to Editors, File Associations. It's obvious from here.

==Tell Eclipse to use java source level 5.0 (required, but maybe you did it above)== If you didn't specify the java source level when you checked out the project via SVN, you'll have to do that now.

Go to Project|Properties|Java Compiler. Click 'Enable project specific settings', and set 'Compiler compliance level' to 5.0

Opening an 'Ant' view

In order to use our automated build scripts. You'll need to open the 'Ant' view. Go to Window|Show View|Ant. You can move this resulting view to a convenient location; probably overlapping with whatever you've already got on the left hand edge of the screen.

Once you have the view positioned, click on the little grey plus sign at the top of the view. Select ant/build.xml. The interesting tasks are build-sessions, which runs mathematica over all the test sessions, and distribution.

Working on the parser project

If you're interested in working on the parser, you'll need to check out the parser project separately. Instead of checking out '/kernel/trunk', check out '/parser/trunk', but otherwise follow the instructions above.

The parser is a complicated beast - in fact too complicated to write by hand. We using javacc (the java compiler compiler) to build the parser out of a languange definition file. Worse, we generate the language definition file itself using a python script!

Thus to work on the parser, you'll need a working install of Python, and javacc. See Hacking the parser for instructions on setting these up.

Personal tools