Developing Moonlight|3D with Eclipse
Prerequisites
At this stage, it is only possible to build Moonlight|3D using Eclipse 3.1 or higher (get it for your platform from http://www.eclipse.org). You should also install the following eclipse plugins:
- Subclipse: A Subversion client for Eclipse, needed to get the sources of this program
- PyDev (optional): A Python development environment for Eclipse to facilitate working on python scripts
The rest of the dependencies will be fetched during the next couple of steps
Checking out Moonlight|3D
The first step is to checkout Moonlight|3D from the Subversion repository. Open the SVN Repository Exploring perspective, right-click in the SVN Repository view, select New/Repository Location... and enter the following data:
URL: http://dev.moonlight3d.eu/svn/Moonlight
Root URL: http://dev.moonlight3d.eu/svn/Moonlight
If you don't have a repository account, leave user name and password blank. Then click OK and you should be able to browse the repository contents in the SVN Repository view.
Now you need to check out the following projects from the repository's trunk:
- mlframework
- mlgraph
- Moonlight
To check out a project, click on its directory in this view and select Check out as... from the context menu and select Java Project. Click Next. Create a new project in the workspace and accept the default project name. Click finish and the checkout should proceed.
Qt Jambi libraries
The Qt Jambi libraries cannot be added to the Subversion repository for licensing reasons. Therefore you must provide your own copy. Grab the precompiled open source version for your platform from http://www.trolltech.com and extract it to a temporary directory. You need to copy all shared libraries (DLLs on Windows) from the lib/ directory (bin/ on Windows) to the library directory for your platform in mlframework/. Also, copy the qtjambi.jar into the same library directory.
Adjusting project settings
Once you have checked out Moonlight|3D you will have to deal with a couple of build errors in the projects. To resolve them you will need to edit the Java Build Path settings in Eclipse.
Before you can run Moonlight|3D you need to run some ant scripts which perform some bookkeeping. Start out with building the custom ant tasks for the Moonlight Application Framework. Open the "Ant" view and drag the file mlframework/ant-tasks/build.xml into it. A new entry ml-ant-tasks should now appear in the view. Expand it and double-click on "package" to run that ant task. This builds two ant tasks for Moonlight|3D which are required for creating plugin lists for the Framework's plugin loader and for updating the translation tables from the Java sources. These tasks are required for the last stage before Moonlight|3D can be run: building the plugins. Drag and drop the file mlframework/build.xml onto the Ant view and run the package target in this file and do the same with Moonlight/build.xml and it's own package target.
To be able to start Moonlight|3D you also need to a special run configuration. You need to set the program arguments to
${workspace_loc}/Moonlight
and the VM arguments must read ([your platform] needs to be substituted with the subdirectory containing the correct native libraries for your platform):
-Dcom.trolltech.qt.library-path=${project_loc}/lib/[your platform] -Djava.library.path=${project_loc}/lib/[your platform]
Moonlight|3D has two main classes:
- ml.ML3D is for normal, interactive mode with full user interface
- ml.MLBatch is for batch mode
After you adjusted these settings Moonlight|3D should compile and start flawlessly. It may occasionally happen that the latest version from Subversion is so badly broken that it won't compile, but this is rather rare.
Asking for help
If you have questions or trouble with these instructions feel free to ask on the Moonlight|3D forums at http://www.moonlight3d.eu/forum
