Wiki source code of XcodeMigration

Version 43.1 by Pascal Robert on 2010/01/04 06:20

Hide last authors
Kieran Kelleher 30.1 1 {{toc}}{{/toc}}
2
Pascal Robert 40.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}}
Pascal Robert 38.1 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 it over another machine too).
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
Pascal Robert 42.1 22 {{panel align=center}}
Kieran Kelleher 30.1 23
Pascal Robert 40.1 24 !Image 1.png!
Pascal Robert 42.1 25 {panel}
Pascal Robert 40.1 26
Kieran Kelleher 30.1 27 Make sure that you are in the WOLips perspective.
28
Pascal Robert 42.1 29 !Image 6.png!
Pascal Robert 28.1 30
Pascal Robert 42.1 31 !Image 7.png!
Pascal Robert 28.1 32
Pascal Robert 42.1 33 [Download the tool|^XcodeMigration.zip] (you don't need to expand the .zip file)
Kieran Kelleher 30.1 34
Pascal Robert 42.1 35 Import the XcodeMigration tool into Eclipse, by selecting _File_ \-> _Import_.    
Pascal Robert 34.1 36
Pascal Robert 42.1 37 !Image 2.png!
Kieran Kelleher 30.1 38
Pascal Robert 42.1 39 Select _Existings Projects into Workspace_ and click _Next_.
Kieran Kelleher 30.1 40
Pascal Robert 42.1 41 !Image 3.png!
Pascal Robert 28.1 42
Pascal Robert 42.1 43 Select the location of the ZIP file with the tool and click _Finish_.
Kieran Kelleher 30.1 44
Pascal Robert 42.1 45 !Image 4.png!
Kieran Kelleher 30.1 46
Pascal Robert 42.1 47 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 48
Pascal Robert 42.1 49 !Image 8.png!
Pascal Robert 28.1 50
Pascal Robert 42.1 51 !Image 9.png!
Pascal Robert 28.1 52
Pascal Robert 42.1 53 You should see the tool and the two templates in the _WO Package Explorer_.
Kieran Kelleher 30.1 54
Pascal Robert 42.1 55 !Image 10.png!
Kieran Kelleher 30.1 56
Pascal Robert 42.1 57 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 58
Pascal Robert 42.1 59 !Image 22.png!
Kieran Kelleher 30.1 60
Pascal Robert 42.1 61 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 62
Pascal Robert 42.1 63 Right-click on the _XCodeMigration.java_ class and select _Run As_ \-> _Open Run dialog..._
Kieran Kelleher 30.1 64
Pascal Robert 42.1 65 !Image 12.png!
Kieran Kelleher 30.1 66
Pascal Robert 42.1 67 Double-click on _Java Application_.
Kieran Kelleher 30.1 68
Pascal Robert 42.1 69 !Image 13.png!
Pascal Robert 17.1 70
Pascal Robert 42.1 71 Click on the _Arguments_ tab and enter this value as a _Program arguments_.
72 {code}
Pascal Robert 17.1 73 ${project_loc}/config.xml
Pascal Robert 42.1 74 {code}
75 !Image 21.png!
Pascal Robert 17.1 76
Pascal Robert 42.1 77 Click _Apply_ and click _Run_.
Pascal Robert 17.1 78
Kieran Kelleher 30.1 79 When it's running, you should see a output like this:
80
Pascal Robert 42.1 81 !Image 16.png!
Kieran Kelleher 30.1 82
Pascal Robert 42.1 83 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 84
Pascal Robert 42.1 85 !Image 17.png!
Kieran Kelleher 30.1 86
Pascal Robert 42.1 87 Your converted projects will appear in the _WO Package Explorer_.
Kieran Kelleher 30.1 88
Pascal Robert 42.1 89 !Image 18.png!
Pascal Robert 17.1 90
Kieran Kelleher 30.1 91 Fix all frameworks dependencies and any other build errors.&nbsp; It's done.
92
Pascal Robert 42.1 93 h1. FAQ
Pascal Robert 17.1 94
Pascal Robert 42.1 95 *Q.*&nbsp; I can't a _Could not find working dir for project_ error when I launch my converted application.
96 *A.*&nbsp; Make sure that, in _config.xml_, _<applicationTemplatePath>_ is set to a WO application instead of a WO framework.
Pascal Robert 17.1 97
Pascal Robert 42.1 98 *Q.*&nbsp; Some of my resources are missing or in the wrong folder.
99 *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 100
Pascal Robert 42.1 101 *Q.*&nbsp; My application is localized and the content in the components are displaying the wrong caracters.
102 *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
103 {{/panel align=center}}