XcodeMigration

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

Introduction

XcodeMigration is a tool written by @Pascal Robertto 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). 

Short video showing XCode project conversion

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).  

Alternatively, inside the Xcode tools 2.5 disk image, pbprojectdump can be found at Packages/Packages/DeveloperTools.pkg/Contents/Archive.pax.gz:/Tools/pbprojectdump

How to use it

Get the project from the GitHub repository.

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).

Image 1.png

Make sure that you are in the WOLips perspective.

Image 6.png
Image 7.png

Import the XcodeMigration tool into Eclipse, by selecting File -> Import.

Image 2.png

Select Existings Projects into Workspace and click Next.

Image 3.png

Select the location of the ZIP file with the tool and click Finish.

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.

Image 8.png

Image 9.png

You should see the tool and the two templates in the WO Package Explorer.

Image 10.png

Open config.xml and change the value of the <applicationTemplatePath> and <frameworkTemplatePath> nodes so that the path points to the templates you created below.

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

Right-click on the XCodeMigration.java class and select Run As -> Open Run dialog...

Image 12.png

Double-click on Java Application.

Image 13.png

Click on the Arguments tab and enter this value as a Program arguments.


${project_loc}/config.xml

Image 21.png

Click Apply and click Run.

When it's running, you should see a output like this:

Image 16.png

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.

Image 17.png

Your converted projects will appear in the WO Package Explorer.

Image 18.png

Fix all frameworks dependencies and any other build errors.  It's done.

FAQ

Q.  I can't a Could not find working dir for project error when I launch my converted application.
A.  Make sure that, in config.xml, <applicationTemplatePath> is set to a WO application instead of a WO framework.

Q.  Some of my resources are missing or in the wrong folder.
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.

Q.  My application is localized and the content in the components are displaying the wrong caracters.
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.