Wiki source code of Debugging WOLips

Version 47.1 by mark_ritchie on 2010/02/17 17:58

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