Wiki source code of XcodeMigration

Last modified by William Sandner on 2011/10/19 21:07

Show last authors
1 {{toc/}}
2
3 = Introduction =
4
5 XcodeMigration is a tool written by {{mention reference="XWiki.probert" style="FULL_NAME" anchor="XWiki-probert-QkZxc"/}}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).
6
7 {{info title="Short video showing XCode project conversion"}}
8 * [[Converting XCode Projects to Eclipse Dev Tools>>url:http://www.wocommunity.org/podcasts/Converting_Xcode_projects.mov||shape="rect"]]
9 {{/info}}
10
11 {{note}}
12 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). \\
13
14 Alternatively, inside the Xcode tools 2.5 disk image, pbprojectdump can be found at Packages/Packages/DeveloperTools.pkg/Contents/Archive.pax.gz:/Tools/pbprojectdump
15 {{/note}}
16
17 = How to use it =
18
19 Get the project from the [[GitHub repository>>url:https://github.com/pascalrobert/XCodeMigration||shape="rect"]].
20
21 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).
22
23 {{panel}}
24 [[image:attach:Image 1.png]]
25 {{/panel}}
26
27 Make sure that you are in the WOLips perspective.
28
29 {{panel}}
30 [[image:attach:Image 6.png]]
31 [[image:attach:Image 7.png]]
32 {{/panel}}
33
34 Import the XcodeMigration tool into Eclipse, by selecting //File// -> //Import//.
35
36 {{panel}}
37 [[image:attach:Image 2.png]]
38 {{/panel}}
39
40 Select //Existings Projects into Workspace// and click //Next//.
41
42 {{panel}}
43 [[image:attach:Image 3.png]]
44 {{/panel}}
45
46 Select the location of the ZIP file with the tool and click //Finish//.
47
48 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//.
49
50 {{panel}}
51 [[image:attach:Image 8.png]]
52 {{/panel}}
53
54 {{panel}}
55 [[image:attach:Image 9.png]]
56 {{/panel}}
57
58 You should see the tool and the two templates in the //WO Package Explorer//.
59
60 {{panel}}
61 [[image:attach:Image 10.png]]
62 {{/panel}}
63
64 Open //config.xml// and change the value of the //<applicationTemplatePath>// and //<frameworkTemplatePath>// nodes so that the path points to the templates you created below.
65
66 For each project that you want to import, you need the a //<project>// node.  //<path>// is the file system path to the Xcode project, //<name>// is the project name, minus .xcodeproj
67
68 Right-click on the //XCodeMigration.java// class and select //Run As// -> //Open Run dialog...//
69
70 {{panel}}
71 [[image:attach:Image 12.png]]
72 {{/panel}}
73
74 Double-click on //Java Application//.
75
76 {{panel}}
77 [[image:attach:Image 13.png]]
78 {{/panel}}
79
80 Click on the //Arguments// tab and enter this value as a //Program arguments//.
81
82 {{code}}
83
84 ${project_loc}/config.xml
85
86 {{/code}}
87
88 {{panel}}
89 [[image:attach:Image 21.png]]
90 {{/panel}}
91
92 Click //Apply// and click //Run//.
93
94 When it's running, you should see a output like this:
95
96 {{panel}}
97 [[image:attach:Image 16.png]]
98 {{/panel}}
99
100 To import the converted projects, open //File// -> //Import// -> //Existings projects into workspace//.  Click //Next//. Select //Select Root Directory// and browse to ///tmp/migrations//.  You should see the list of projects that you converted.
101
102 {{panel}}
103 [[image:attach:Image 17.png]]
104 {{/panel}}
105
106 Your converted projects will appear in the //WO Package Explorer//.
107
108 {{panel}}
109 [[image:attach:Image 18.png]]
110 {{/panel}}
111
112 Fix all frameworks dependencies and any other build errors.  It's done.
113
114 = FAQ =
115
116 **Q.**  I can't a //Could not find working dir for project// error when I launch my converted application.
117 **A.**  Make sure that, in //config.xml//, //<applicationTemplatePath>// is set to a WO application instead of a WO framework.
118
119 **Q.**  Some of my resources are missing or in the wrong folder.
120 **A.**  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.
121
122 **Q.**  My application is localized and the content in the components are displaying the wrong caracters.
123 **A.**  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.