Debugging WOLips
Debugging WOLips as the master does!
These instructions is intended for the developer who wants to compile and run WOLips source for the purpose of debugging or other exploration. Thanks very much to Mike Schrag for the guidance to get this setup and working!
Overview of what's going on
We're going to check out the latest source for WOLips, build it and arrange for Eclipse to launch is a debug mode to test it out. It's very handy that Eclipse has a built in ability to launch itself in debug mode and load the local versions of the plugins. If you read the old and out dated instructions floating about that talk about building an entire release and installing them into a new copy of Eclipse then you're going to like this method a whole lot better! ;-)
The setup
When I did this and wrote these notes, I was using:
- Mac OS X 10.5.7
- Java 1.5.019
- Eclipse 3.4.2 (eclipse-SDK-3.4.2-macosx-carbon.tar.gz)
Checking out the source code
A note for the impatient - don't try to checkout the source right into Eclipse. The files aren't structured in a way that allows this to work. I know because I tried to do it that way first! ;-)
Check out the source code into a local folder
You're checking out a local copy of the code from the source repository. Next, we're going to selectively import (but not copy) parts of that code into Eclipse. I'm using command line subversion to check out the lastest version however feel free to use a different tool or different version, as you like.
svn co https://svn.objectstyle.org/repos/woproject/trunk/woproject /woproject
Note that I've checked out the source code into my home folder. It doesn't matter where you put the source code as long as you can find it in the steps below.
Create a new eclipse workspace
Launch a clean copy of Eclipse with no plugings installed. Strictly speaking, probably not necessary however these are the steps which I took.
Create a new Workspace
I chose /WOLipsDebugging
Import woenvironment
Start off by importing the woenvironment project. From the File menu, select Import
Click the disclosure triangle for General and select Existing Projects into Workspace
Click Next button.
Ensure that "Select root directory" is selected and click Browse
Browse to the folder where you checked out the woproject source code above and select woenvironment.
Eclipse should scan the folder and notice one project in the folder called woenvironment.
It's important that you don't have 'Copy the project into your workspace' selected.
Click Finish.
Once Eclipse has finished building the project, there should be no errors! If that's not the case, then you need to back up and make sure that you've followed all the steps above.
Import wolips projects into your workspace
Repeat the steps above and import all the wolips projects except for 3!
EntityModler, eomodeldoc and org.objectstyle.wolips.eomodeler.factories
Are special projects which require special setup and caffination before touching.
The import of wolips should look like this:
And Eclipse should identify a whole bunch of projects.
Make sure that you deselect the 3 special cases noted above
The list of projects should look something like this:
Click Finish and the projects should all be imported.
Once Eclipse finishes building the projects there are going to be a whole bunch of build errors. Don't Panic. Most of them will resolve themselves after the next steps.
Import wolips plugins
In the same way as above, import the core plugins from wolips/core/plugins. Something like this:
Import 3rd party plugins
Finally, import the third party plugins from wolips/3rdparty/plugin. Something like this:
Close special projects
In case you missed the notices above, close these projects.
- EntityModeler
- eomodeldoc
- org.objectstyle.wolips.eomodeler.factories
(Note: Working on these projects is beyond the scope of what I needed to do. Sorry.)
Close projects which require additional resources to compile
These projects require additional resources to compile. As I didn't need them, I just closed them.
- org.objectstyle.wolips.apple.mavenintegration
- org.objectstyle.wolips.groovy.ui
- org.objectstyle.wolips.jprofiler.launching
The run configuration setup
At this point, you should have a long list of packages which should all be compiling.
If that's not the case, please document additional steps here, making special note of your setup.
Getting on with the configuration to be able to test the software which is now compiling.
From the Run menu, select "Debug Configurations ..."
Select "Eclipse Application" from the list on the left
and then click the "New" button at the top.
This creates a new launch configuration which you can customize as you like.
By default it's called 'Newconfiguration'. For this session, I named it DebugEclipse
My preference is to explicitly set the workspace for testing however I'm sure the default will be fine if you like it.
I chose: $Unknown macro: workspace_loc. Click on this message for details.
/../WOLipsDebuggingWorkspace
My setup looked something like below however there are lots of configuration options which I didn't need to explore:
Launch the debug version
Click the Debug button in the debug configuration window to launch the test version.
This will be a clean version of Eclipse with the workspace which you set and any other settings.
By default, all of the plugins are loaded and ready for testing!
And now, you should be running inside the debug version of Eclipse with all the wolips bits to play with!