Wiki source code of XcodeMigration

Version 50.1 by jacky_1970 on 2009/01/23 09:13

Hide last authors
Kieran Kelleher 30.1 1 {{toc}}{{/toc}}
2
jacky_1970 50.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}}
jacky_1970 50.1 14 XcodeMigration is using the tool _pbprojectdump_ which is no longer present in the Xcode 3 bundle.
Pascal Robert 32.1 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
jacky_1970 50.1 22 [[image:Image 1.png]]
Kieran Kelleher 30.1 23
24 Make sure that you are in the WOLips perspective.
25
Pascal Robert 44.1 26 [[image:Image 6.png]]
Pascal Robert 28.1 27
Pascal Robert 44.1 28 [[image:Image 7.png]]
Pascal Robert 28.1 29
jacky_1970 50.1 30 [[Download the tool>>^XcodeMigration.zip]] (you don't need to expand the .zip file)
Kieran Kelleher 30.1 31
jacky_1970 50.1 32 Import the XcodeMigration tool into Eclipse, by selecting //File// > //Import//.    
Pascal Robert 34.1 33
Pascal Robert 44.1 34 [[image:Image 2.png]]
Kieran Kelleher 30.1 35
Pascal Robert 44.1 36 Select //Existings Projects into Workspace// and click //Next//.
Kieran Kelleher 30.1 37
Pascal Robert 44.1 38 [[image:Image 3.png]]
Pascal Robert 28.1 39
Pascal Robert 44.1 40 Select the location of the ZIP file with the tool and click //Finish//.
Kieran Kelleher 30.1 41
Pascal Robert 44.1 42 [[image:Image 4.png]]
Kieran Kelleher 30.1 43
Pascal Robert 44.1 44 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//.
Kieran Kelleher 30.1 45
Pascal Robert 44.1 46 [[image:Image 8.png]]
Pascal Robert 28.1 47
Pascal Robert 44.1 48 [[image:Image 9.png]]
Pascal Robert 28.1 49
Pascal Robert 44.1 50 You should see the tool and the two templates in the //WO Package Explorer//.
Kieran Kelleher 30.1 51
Pascal Robert 44.1 52 [[image:Image 10.png]]
Kieran Kelleher 30.1 53
Pascal Robert 44.1 54 Open //config.xml// and change the value of the //<applicationTemplatePath>// and //<frameworkTemplatePath>// nodes so that the path points to the templates you created below.
Kieran Kelleher 30.1 55
Pascal Robert 44.1 56 [[image:Image 22.png]]
Kieran Kelleher 30.1 57
Pascal Robert 44.1 58 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
Kieran Kelleher 30.1 59
Pascal Robert 44.1 60 Right-click on the //XCodeMigration.java// class and select //Run As// > //Open Run dialog...//
Kieran Kelleher 30.1 61
Pascal Robert 44.1 62 [[image:Image 12.png]]
Kieran Kelleher 30.1 63
Pascal Robert 44.1 64 Double-click on //Java Application//.
Kieran Kelleher 30.1 65
Pascal Robert 44.1 66 [[image:Image 13.png]]
Pascal Robert 17.1 67
Pascal Robert 44.1 68 Click on the //Arguments// tab and enter this value as a //Program arguments//.
69
70 {{code}}
71
Pascal Robert 17.1 72 ${project_loc}/config.xml
73
Pascal Robert 44.1 74 {{/code}}
Pascal Robert 17.1 75
Pascal Robert 44.1 76 [[image:Image 21.png]]
77
78 Click //Apply// and click //Run//.
79
Kieran Kelleher 30.1 80 When it's running, you should see a output like this:
81
Pascal Robert 44.1 82 [[image:Image 16.png]]
Kieran Kelleher 30.1 83
Pascal Robert 44.1 84 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.
Kieran Kelleher 30.1 85
Pascal Robert 44.1 86 [[image:Image 17.png]]
Kieran Kelleher 30.1 87
Pascal Robert 44.1 88 Your converted projects will appear in the //WO Package Explorer//.
Kieran Kelleher 30.1 89
Pascal Robert 44.1 90 [[image:Image 18.png]]
Pascal Robert 17.1 91
Kieran Kelleher 30.1 92 Fix all frameworks dependencies and any other build errors.&nbsp; It's done.
93
Pascal Robert 44.1 94 = FAQ =
Pascal Robert 17.1 95
Pascal Robert 44.1 96 **Q.**&nbsp; I can't a //Could not find working dir for project// error when I launch my converted application.
97 **A.**&nbsp; Make sure that, in //config.xml//, //<applicationTemplatePath>// is set to a WO application instead of a WO framework.
Pascal Robert 17.1 98
Pascal Robert 44.1 99 **Q.**&nbsp; Some of my resources are missing or in the wrong folder.
100 **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 101
Pascal Robert 44.1 102 **Q.**&nbsp; My application is localized and the content in the components are displaying the wrong caracters.
103 **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.