XcodeMigration

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

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

Information
Short video showing XCode project conversion
Warning

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

How to use it

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!
{panel}

Make sure that you are in the WOLips perspective.

!Image 6.png!

!Image 7.png!

[Download the tool|^XcodeMigration.zip] (you don't need to expand the .zip file)

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

!Image 4.png!

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.

!Image 22.png!

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

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_.
{code}
${project_loc}/config.xml
{code}
!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_.&nbsp; Click _Next_. Select _Select Root Directory_ and browse to _/tmp/migrations_.&nbsp; 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.&nbsp; It's done.

h1. FAQ

*Q.*&nbsp; I can't a _Could not find working dir for project_ error when I launch my converted application.
*A.*&nbsp; Make sure that, in _config.xml_, _<applicationTemplatePath>_ is set to a WO application instead of a WO framework.

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

*Q.*&nbsp; My application is localized and the content in the components are displaying the wrong caracters.
*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
{{/panel align=center}}