Wiki source code of XcodeMigration

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

Hide last authors
William Sandner 53.1 1 {{toc/}}
Kieran Kelleher 30.1 2
William Sandner 52.1 3 = Introduction =
Pascal Robert 17.1 4
William Sandner 54.1 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).
Pascal Robert 17.1 6
Kieran Kelleher 30.1 7 {{info title="Short video showing XCode project conversion"}}
William Sandner 53.1 8 * [[Converting XCode Projects to Eclipse Dev Tools>>url:http://www.wocommunity.org/podcasts/Converting_Xcode_projects.mov||shape="rect"]]
Kieran Kelleher 30.1 9 {{/info}}
10
Pascal Robert 32.1 11 {{note}}
William Sandner 53.1 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). \\
Pascal Robert 32.1 13
William Sandner 52.1 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
Pascal Robert 32.1 15 {{/note}}
16
Pascal Robert 17.1 17 = How to use it =
18
William Sandner 53.1 19 Get the project from the [[GitHub repository>>url:https://github.com/pascalrobert/XCodeMigration||shape="rect"]].
William Sandner 52.1 20
Kieran Kelleher 30.1 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
William Sandner 52.1 23 {{panel}}
William Sandner 53.1 24 [[image:attach:Image 1.png]]
William Sandner 52.1 25 {{/panel}}
26
Kieran Kelleher 30.1 27 Make sure that you are in the WOLips perspective.
28
William Sandner 52.1 29 {{panel}}
William Sandner 53.1 30 [[image:attach:Image 6.png]]
31 [[image:attach:Image 7.png]]
William Sandner 52.1 32 {{/panel}}
Kieran Kelleher 30.1 33
William Sandner 53.1 34 Import the XcodeMigration tool into Eclipse, by selecting //File// -> //Import//.
Pascal Robert 34.1 35
William Sandner 52.1 36 {{panel}}
William Sandner 53.1 37 [[image:attach:Image 2.png]]
William Sandner 52.1 38 {{/panel}}
39
Pascal Robert 44.1 40 Select //Existings Projects into Workspace// and click //Next//.
Kieran Kelleher 30.1 41
William Sandner 52.1 42 {{panel}}
William Sandner 53.1 43 [[image:attach:Image 3.png]]
William Sandner 52.1 44 {{/panel}}
45
Pascal Robert 44.1 46 Select the location of the ZIP file with the tool and click //Finish//.
Kieran Kelleher 30.1 47
William Sandner 53.1 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//.
Kieran Kelleher 30.1 49
William Sandner 52.1 50 {{panel}}
William Sandner 53.1 51 [[image:attach:Image 8.png]]
William Sandner 52.1 52 {{/panel}}
53
54 {{panel}}
William Sandner 53.1 55 [[image:attach:Image 9.png]]
William Sandner 52.1 56 {{/panel}}
57
Pascal Robert 44.1 58 You should see the tool and the two templates in the //WO Package Explorer//.
Kieran Kelleher 30.1 59
William Sandner 52.1 60 {{panel}}
William Sandner 53.1 61 [[image:attach:Image 10.png]]
William Sandner 52.1 62 {{/panel}}
63
Pascal Robert 44.1 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.
Kieran Kelleher 30.1 65
William Sandner 53.1 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
Kieran Kelleher 30.1 67
William Sandner 53.1 68 Right-click on the //XCodeMigration.java// class and select //Run As// -> //Open Run dialog...//
Kieran Kelleher 30.1 69
William Sandner 52.1 70 {{panel}}
William Sandner 53.1 71 [[image:attach:Image 12.png]]
William Sandner 52.1 72 {{/panel}}
73
Pascal Robert 44.1 74 Double-click on //Java Application//.
Kieran Kelleher 30.1 75
William Sandner 52.1 76 {{panel}}
William Sandner 53.1 77 [[image:attach:Image 13.png]]
William Sandner 52.1 78 {{/panel}}
79
Pascal Robert 44.1 80 Click on the //Arguments// tab and enter this value as a //Program arguments//.
81
82 {{code}}
83
Pascal Robert 17.1 84 ${project_loc}/config.xml
85
Pascal Robert 44.1 86 {{/code}}
Pascal Robert 17.1 87
William Sandner 52.1 88 {{panel}}
William Sandner 53.1 89 [[image:attach:Image 21.png]]
William Sandner 52.1 90 {{/panel}}
91
Pascal Robert 44.1 92 Click //Apply// and click //Run//.
93
Kieran Kelleher 30.1 94 When it's running, you should see a output like this:
95
William Sandner 52.1 96 {{panel}}
William Sandner 53.1 97 [[image:attach:Image 16.png]]
William Sandner 52.1 98 {{/panel}}
99
William Sandner 53.1 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.
Kieran Kelleher 30.1 101
William Sandner 52.1 102 {{panel}}
William Sandner 53.1 103 [[image:attach:Image 17.png]]
William Sandner 52.1 104 {{/panel}}
105
Pascal Robert 44.1 106 Your converted projects will appear in the //WO Package Explorer//.
Kieran Kelleher 30.1 107
William Sandner 52.1 108 {{panel}}
William Sandner 53.1 109 [[image:attach:Image 18.png]]
William Sandner 52.1 110 {{/panel}}
111
William Sandner 53.1 112 Fix all frameworks dependencies and any other build errors.  It's done.
Kieran Kelleher 30.1 113
Pascal Robert 44.1 114 = FAQ =
Pascal Robert 17.1 115
William Sandner 53.1 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.
Pascal Robert 17.1 118
William Sandner 53.1 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.
Pascal Robert 17.1 121
William Sandner 53.1 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.