Wiki source code of XcodeMigration

Version 37.1 by Pascal Robert on 2011/03/27 10:24

Hide last authors
Kieran Kelleher 30.1 1 {{toc}}{{/toc}}
2
Pascal Robert 32.1 3 = Introduction =
Pascal Robert 17.1 4
Pascal Robert 28.1 5 XcodeMigration is a tool written by [[Pascal Robert>>~~probert]]to help you migrate multiple WebObjects projects from Xcode to Eclipse/WOLips.  If you have complex or many projects to convert, this is the tool to use.  The tool is written in Java and is a Eclipse project, so you will need to import the project into Eclipse first (you need a functionnal WOLips installation to be able to import the tool). 
Pascal Robert 17.1 6
Kieran Kelleher 30.1 7 {{info title="Short video showing XCode project conversion"}}
8
9 * [Converting XCode Projects to Eclipse Dev Tools|http://www.wocommunity.org/podcasts/Converting_Xcode_projects.mov]
10
11 {{/info}}
12
Pascal Robert 32.1 13 {{note}}
14 XcodeMigration is using the tool _pbprojectdump_ which is no longer present in the Xcode 3 bundle. You need to install Xcode 2.5 to get access to _pbprojectdump_ (you can copy it from another machine too).
15
16 {{/note}}
17
Pascal Robert 17.1 18 = How to use it =
19
Kieran Kelleher 30.1 20 If you want to convert your Java classes from MacRoman to UTF-8, make sure your Eclipse workspace is in UTF-8 (the default is MacRoman).
21
Pascal Robert 32.1 22 {{panel}}
Kieran Kelleher 30.1 23
Pascal Robert 32.1 24 !Image 1.png|align=center!
25
26 {{/panel}}
27
Kieran Kelleher 30.1 28 Make sure that you are in the WOLips perspective.
29
Pascal Robert 32.1 30 {{panel}}
Pascal Robert 28.1 31
Pascal Robert 32.1 32 !Image 6.png|align=center!
33 !Image 7.png|align=center!
Pascal Robert 28.1 34
Pascal Robert 32.1 35 {{/panel}}
Kieran Kelleher 30.1 36
Pascal Robert 36.1 37 [[Download the tool>>^XcodeMigration.zip]] (you don't need to expand the .zip file). You can also get it from a [[GitHub repository>>https://github.com/pascalrobert/XCodeMigration]].
Pascal Robert 34.1 38
Pascal Robert 32.1 39 Import the XcodeMigration tool into Eclipse, by selecting //File// > //Import//.
Kieran Kelleher 30.1 40
Pascal Robert 32.1 41 {{panel}}
Pascal Robert 28.1 42
Pascal Robert 32.1 43 !Image 2.png|align=center!
44
45 {{/panel}}
46
Kieran Kelleher 30.1 47 Select //Existings Projects into Workspace// and click //Next//.
48
Pascal Robert 32.1 49 {{panel}}
Pascal Robert 28.1 50
Pascal Robert 32.1 51 !Image 3.png|align=center!
52
53 {{/panel}}
54
Kieran Kelleher 30.1 55 Select the location of the ZIP file with the tool and click //Finish//.
56
Pascal Robert 32.1 57 {{panel}}
Kieran Kelleher 30.1 58
Pascal Robert 32.1 59 !Image 4.png|align=center!
60
61 {{/panel}}
62
Kieran Kelleher 30.1 63 The tool needs two projects templates, one of them is a application template, the other a framework template.  So you need to create a //WebObjects Application// and a //WebObjects Framework//.
64
Pascal Robert 32.1 65 {{panel}}
Pascal Robert 28.1 66
Pascal Robert 32.1 67 !Image 8.png|align=center!
Pascal Robert 28.1 68
Pascal Robert 32.1 69 {{/panel}}
70
71 {{panel}}
72
73 !Image 9.png|align=center!
74
75 {{/panel}}
76
Kieran Kelleher 30.1 77 You should see the tool and the two templates in the //WO Package Explorer//.
78
Pascal Robert 32.1 79 {{panel}}
Kieran Kelleher 30.1 80
Pascal Robert 32.1 81 !Image 10.png|align=center!
82
83 {{/panel}}
84
Kieran Kelleher 30.1 85 Open //config.xml// and change the value of the //<applicationTemplatePath>// and //<frameworkTemplatePath>// nodes so that the path points to the templates you created below.
86
Pascal Robert 32.1 87 {{panel}}
Kieran Kelleher 30.1 88
Pascal Robert 32.1 89 !Image 22.png|align=center!
90
91 {{/panel}}
92
Kieran Kelleher 30.1 93 For each project that you want to import, you need the a //<project>// node.&nbsp; //<path>// is the file system path to the Xcode project, //<name>// is the project name, minus .xcodeproj
94
95 Right-click on the //XCodeMigration.java// class and select //Run As// > //Open Run dialog...//
96
Pascal Robert 32.1 97 {{panel}}
Kieran Kelleher 30.1 98
Pascal Robert 32.1 99 !Image 12.png|align=center!
100
101 {{/panel}}
102
Kieran Kelleher 30.1 103 Double-click on //Java Application//.
104
Pascal Robert 32.1 105 {{panel}}
Pascal Robert 17.1 106
Pascal Robert 32.1 107 !Image 13.png|align=center!
108
109 {{/panel}}
110
Kieran Kelleher 30.1 111 Click on the //Arguments// tab and enter this value as a //Program arguments//.
112
Pascal Robert 17.1 113 {{code}}
114
115 ${project_loc}/config.xml
116
117 {{/code}}
118
Pascal Robert 32.1 119 {{panel}}
Pascal Robert 28.1 120
Pascal Robert 32.1 121 !Image 21.png|align=center!
122
123 {{/panel}}
124
Kieran Kelleher 30.1 125 Click //Apply// and click //Run//.
126
127 When it's running, you should see a output like this:
128
Pascal Robert 32.1 129 {{panel}}
Kieran Kelleher 30.1 130
Pascal Robert 32.1 131 !Image 16.png|align=center!
132
133 {{/panel}}
134
Kieran Kelleher 30.1 135 To import the converted projects, open //File// > //Import// > //Existings projects into workspace//.&nbsp; Click //Next//. Select //Select Root Directory// and browse to ///tmp/migrations//.&nbsp; You should see the list of projects that you converted.
136
Pascal Robert 32.1 137 {{panel}}
Kieran Kelleher 30.1 138
Pascal Robert 32.1 139 !Image 17.png|align=center!
140
141 {{/panel}}
142
Kieran Kelleher 30.1 143 Your converted projects will appear in the //WO Package Explorer//.
144
Pascal Robert 32.1 145 {{panel}}
Pascal Robert 17.1 146
Pascal Robert 32.1 147 !Image 18.png|align=center!
148
149 {{/panel}}
150
Kieran Kelleher 30.1 151 Fix all frameworks dependencies and any other build errors.&nbsp; It's done.
152
Pascal Robert 17.1 153 = FAQ =
154
155 **Q.**&nbsp; I can't a //Could not find working dir for project// error when I launch my converted application.
156 **A.**&nbsp; Make sure that, in //config.xml//, //<applicationTemplatePath>// is set to a WO application instead of a WO framework.
157
158 **Q.**&nbsp; Some of my resources are missing or in the wrong folder.
Pascal Robert 28.1 159 **A.**&nbsp; The tool detect files that should be marked as //Resources// by file extension or name. If a file is not a Java class or one of the file type in the //Resources// list, the file will be move to the //WebServerResources// folder instead. You just have to move the files to the Resources folder when needed. If you have file types who should be detected as resources, you can add the needed code in the //copyFiles// method.
Pascal Robert 17.1 160
161 **Q.**&nbsp; My application is localized and the content in the components are displaying the wrong caracters.
Pascal Robert 28.1 162 **A.**&nbsp; If you set the //<convertToUTF8>// node to true, your Java classes will be converted from MacRoman to UTF-8, but the tool will NOT modify the .woo file so that they use UTF-8. Either you stay in MacRoman and change the value of //<convertToUTF8>// to //false//, or you will have to modify your components so that they use UTF-8.