With the new team working on Archimedes, I had to help them set up an environment to work with Archimedes. I am pretty proud of the outcome.
In order to code for Archimedes, just follow these steps:
- Download and install a Java Virtual Machine S.E. SDK version 1.5 or later compatible with the Sun virtual machine (I suggest sun's one called 'Java SE Development Kit (JDK)' under http://java.sun.com/javase/downloads/index.jsp).
- Install Subversion (http://subversion.tigris.org - or "sudo apt-get install subversion" on debian based linux distributions or "sudo port install subversion" on Mac OS X with MacPorts).
- Download an Eclipse version above 3.4 (I suggest the one found at http://download.eclipse.org/eclipse/downloads/drops/R-3.4.2-200902111700/ - Eclipse SDK for your platform should be enough). Make sure it has all of the Eclipse RCP plugins. If you pick another version, choose the package Eclipse SDK or the specific build for Eclipse Plug-in Development.
- Install it on your system. It usually just involves unpacking the zip or tar.gz file you downloaded.
- Open it. Usually, just enter the folder that was created on the previous step, there should be an executable called 'eclipse'. Run that executable.
- Install subclipse. Go to "Help"->"Software Updates...". Select the tab "Available Software", click on "Add Site...". Fill in the "Location" field with "http://subclipse.tigris.org/update_1.4.x" (if you installed version 1.6 of Subversion, you can use "http://subclipse.tigris.org/update_1.6.x"). Click on OK. It should list the site on the table with the name "http://subclipse.tigris.org/update_1.4.x". Click the checkbox next to it. Click on the button "Install..." on the upper right corner. Accept the license and let it install. Once it's done, it will ask you to restart Eclipse. Please do.
- Download the file "http://svn.archimedes.org.br/public/mainarchimedes/rcparchimedes/br.org.archimedes.config/trunk/ArchimedesProjectsSet.psf". Save it somewhere you can find.
- Go back to Eclipse and go to "File"->"Import...". Expand "Team" and choose "Team Project Set". Click "Next". Click "Finish". It will download all the projects needed to work on Archimedes. This will take some time and a lot of bandwith. If you get an "Svn error", please erase all projects and try again.
Running Archimedes from within Eclipse should be pretty simple but I've found problems more than once. Here is what you should do:
- Find the project "br.org.archimedes.core", expand it. Find the file "archimedes.product", right-click it, "Run As..."->"Eclipse Application". On Mac, that's enough. It all works. On Linux, I've found that this doesn't select all plugins needed. It then pops an error dialog asking if you want to view the log. Answer "No".
- Go to "Run"->"Run configurations...". Select the tab "Plug-ins". Click the button "Add Required Plug-ins". Click "Apply" and then "Run". This should do the trick and run Archimedes with all plug-ins.
- Download an Eclipse version along with its Delta Pack. I suggest you use the same version on development and on building to avoid unpleasant surprises. Therefore, go to http://download.eclipse.org/eclipse/downloads/drops/R-3.4.2-200902111700/ and download "Eclipse SDK" for your platform and "Delta Pack". Extract both files on the same place (it should merge the contents). This means, if you enter the "eclipse/plugins" directory of that new eclipse path, you should find plugins for all platforms (such as "org.eclipse.swt.carbon.macosx_3.4.0.v3448f.jar", "org.eclipse.swt.gtk.linux.ppc_3.4.0.v3448f.jar", "org.eclipse.swt.gtk.linux.x86_3.4.0.v3448f.jar",
"org.eclipse.swt.win32.win32.x86_3.4.0.v3448f.jar" and others). - Go to your "br.org.archimedes.build" project. Open the "build_local.properties" file. Change all fields. "buildHome" should be the absolute path to your "br.org.archimedes.build" project. "buildDirectory" should be the absolute path to a temporary folder where the build will generate the files. Make sure this is not a folder where you store important files because the build system will erase it. "eclipseDir" should be the absolute path to the Eclipse installation created on step 1. "os" should be the name of your operating system ("linux", "macosx" or "win32"). "ws" should be the name of the widget system of your system ("gtk", "carbon" or "win32"). "arch" should be the architecture of your processor ("x86", "x86_64" or "ppc").
- Go to your "br.org.archimedes.build" project and open the folder "maps". Copy the file "all-hugo.map" to "all.map". Open the new "all.map". Replace all occurrences of "/Users/night/Document/Archimedes/" with the path to your workspace (for example "/home/night/" if my workspace if "/home/night/workspace").
- On Eclipse, right click the "build.xml" file on "br.org.archimedes.build" project and choose "Run As..."->"Ant Build". On other systems, open a terminal (or cmd.exe), go to the directory where you "br.org.archimedes.build" project is and type 'ant'. If "ant" is not installed, please install it (http://ant.apache.org/manual/install.html or "sudo apt-get install ant" for debian based linux distributions). This should trigger the build process. It takes around 5 minutes to build it all.
Happy hacking!