Wiki source code of Debugging WOLips

Version 64.1 by mark_ritchie on 2010/02/17 13:51

Hide last authors
mark_ritchie 45.1 1 = Debugging WOLips as the master does! =
mark_ritchie 37.1 2
mark_ritchie 34.1 3 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!
4
5 == Overview of what's going on ==
6
7 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! ;-)
8
9 == The setup ==
10
11 When I did this and wrote these notes, I was using:
12
13 * Mac OS X 10.5.7
14 * Java 1.5.0//19//
15 * Eclipse 3.4.2 (eclipse-SDK-3.4.2-macosx-carbon.tar.gz)
16
mark_ritchie 47.1 17 {{panel title="Snow Leopard Update" bgColor="#FFFFCE"}}
18
mark_ritchie 49.1 19 I gave this a go on Snow Leopard and it worked fine with one little detail which I've noted at the end of this page.
mark_ritchie 47.1 20 Here's the setup I was using:
mark_ritchie 49.1 21 - Mac OS X 10.6.1
mark_ritchie 47.1 22 - Java 1.6.0_15
mark_ritchie 49.1 23 - Eclipse 3.4.2 (eclipse-SDK-3.4.2-macosx-carbon.tar.gz)
mark_ritchie 47.1 24
25 {{/panel}}
26
mark_ritchie 34.1 27 == Checking out the source code ==
28
29 **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!** ;-)
30
31 === Check out the source code into a local folder ===
32
mark_ritchie 45.1 33 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.
mark_ritchie 34.1 34
mark_ritchie 45.1 35 svn co https:~/~/svn.objectstyle.org/repos/woproject/trunk/woproject ,,/woproject,,
mark_ritchie 34.1 36
mark_ritchie 45.1 37 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.
mark_ritchie 34.1 38
39 === Create a new eclipse workspace ===
40
mark_ritchie 45.1 41 Launch a clean copy of Eclipse with no plugings installed. Strictly speaking, probably not necessary however these are the steps which I took.
42
43 Create a new Workspace
mark_ritchie 47.1 44 I chose ,,/WOLipsDebugging
45 [[image:Workspace.png]],,
mark_ritchie 45.1 46
mark_ritchie 47.1 47 === Import woenvironment ===
mark_ritchie 34.1 48
mark_ritchie 47.1 49 Start off by importing the woenvironment project. From the File menu, select Import
50 [[image:ImportMenu.png]]
51 Click the disclosure triangle for General and select Existing Projects into Workspace
52 [[image:ExistingProject.png]]
53 Click Next button.
54 Ensure that "Select root directory" is selected and click Browse
55 Browse to the folder where you checked out the woproject source code above and select woenvironment.
56 [[image:woenvironmentCheckout.png]]
57 Eclipse should scan the folder and notice one project in the folder called woenvironment.
58 **It's important that you don't have 'Copy the project into your workspace' selected.**
59 [[image:woenvironmentProject.png]]
60 Click Finish.
61
62 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.
63
mark_ritchie 34.1 64 === Import wolips projects into your workspace ===
65
mark_ritchie 47.1 66 Repeat the steps above and import all the wolips projects except for 3!
67
mark_ritchie 63.1 68 * EntityModler, eomodeldoc and org.objectstyle.wolips.eomodeler.factories
mark_ritchie 61.1 69 are special projects which require special setup and caffination before touching.
mark_ritchie 59.1 70
mark_ritchie 47.1 71 The import of wolips should look like this:
72 [[image:wolipsImport.png]]
73
74 And Eclipse should identify a whole bunch of projects.
75 **Make sure that you deselect the 3 special cases noted above**
76 The list of projects should look something like this:
77 [[image:wolipsProjects.png]]
78
79 Click Finish and the projects should all be imported.
80
81 {{note}}
82
83 When I did this I got the following error message.
84 I have no idea what this means...
85 !ResourceErrorMessage.png!
86
87 {{/note}}
88
89 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.
90
mark_ritchie 34.1 91 === Import wolips plugins ===
92
mark_ritchie 47.1 93 In the same way as above, import the core plugins from wolips/core/plugins. Something like this:
94 [[image:corePluginImport.png]]
95 [[image:corePluginProjects.png]]
96
mark_ritchie 34.1 97 === Import 3rd party plugins ===
98
mark_ritchie 47.1 99 Finally, import the third party plugins from wolips/3rdparty/plugin. Something like this:
100 [[image:thridPartyImport.png]]
101 [[image:thirdPartyProjects.png]]
102
mark_ritchie 34.1 103 === Close special projects ===
104
mark_ritchie 47.1 105 In case you missed the notices above, close these projects.
106
mark_ritchie 34.1 107 * EntityModeler
108 * eomodeldoc
109 * org.objectstyle.wolips.eomodeler.factories
mark_ritchie 47.1 110 (Note: Working on these projects is beyond the scope of what I needed to do. Sorry.)
mark_ritchie 34.1 111
112 === Close projects which require additional resources to compile ===
113
mark_ritchie 47.1 114 These projects require additional resources to compile. As I didn't need them, I just closed them.
115
116 * org.objectstyle.wolips.apple.mavenintegration
mark_ritchie 34.1 117 * org.objectstyle.wolips.groovy.ui
118 * org.objectstyle.wolips.jprofiler.launching
119
mark_ritchie 51.1 120 == The run configuration setup ==
mark_ritchie 47.1 121
122 At this point, you should have a long list of packages which should all be compiling.
123 If that's not the case, please document additional steps here, making special note of your setup.
124
125 Getting on with the configuration to be able to test the software which is now compiling.
126 From the Run menu, select "Debug Configurations ..."
127 [[image:debugConfiguration.png]]
128
129 Select "Eclipse Application" from the list on the left
130 and then click the "New" button at the top.
131 [[image:newLaunchConfiguration.png]]
132 This creates a new launch configuration which you can customize as you like.
133 By default it's called 'New//configuration'. For this session, I named it DebugEclipse//
134
135 My preference is to explicitly set the workspace for testing however I'm sure the default will be fine if you like it.
136 I chose: $workspace//loc}/../WOLipsDebuggingWorkspace
137 My setup looked something like below however there are lots of configuration options which I didn't need to explore:
138 [[image:debugConfigured.png]]//
139
140 == Launch the debug version ==
141
142 Click the Debug button in the debug configuration window to launch the test version.
143 This will be a clean version of Eclipse with the workspace which you set and any other settings.
144 By default, all of the plugins are loaded and ready for testing!
145 And now, you should be running inside the debug version of Eclipse with all the wolips bits to play with!
146
147 == Snow Leopard Update ==
148
mark_ritchie 49.1 149 I was running the carbon version of Eclipse 3.4.2 on Snow Leopard.
mark_ritchie 47.1 150 Up to this point, I was following the instructions above however when I tried to launch Eclipse, I got this error:
151
152 {{code value="java"}}
153
154 java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM
155 at org.eclipse.swt.internal.Library.loadLibrary(Library.java:177)
156 at org.eclipse.swt.internal.Library.loadLibrary(Library.java:151)
157 ...
158
159 {{/code}}
160
mark_ritchie 57.1 161 This is a known problem and is documented <a href="http:~/~/www.eclipse.org/swt/faq.php#cocoa32launch">here</a>
mark_ritchie 47.1 162 The fix is to add the --d32 parameter to the launch arguments.--
163
164 Original: --os $target.os} --ws $target.ws} --arch $target.arch} --nl $target.nl}
165 Updated: --os $target.os} --ws $target.ws} --arch $target.arch} --nl $target.nl} --d32--
166
167 My final setup looked like this:
mark_ritchie 49.1 168 [[image:32Bit_jvm_arguments.png]]