Wiki source code of XcodeMigration

Version 52.1 by William Sandner on 2011/10/19 21:07

Hide last authors
Kieran Kelleher 30.1 1 {{toc}}{{/toc}}
2
William Sandner 52.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}}
William Sandner 52.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 copy it from another machine too).  \\
Pascal Robert 32.1 15
William Sandner 52.1 16 Alternatively, inside the Xcode tools 2.5 disk image, pbprojectdump can be found at Packages/Packages/DeveloperTools.pkg/Contents/Archive.pax.gz:/Tools/pbprojectdump
17
Pascal Robert 32.1 18 {{/note}}
19
Pascal Robert 17.1 20 = How to use it =
21
William Sandner 52.1 22 Get the project from the [[GitHub repository>>https://github.com/pascalrobert/XCodeMigration]].
23
Kieran Kelleher 30.1 24 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).
25
William Sandner 52.1 26 {{panel}}
Kieran Kelleher 30.1 27
William Sandner 52.1 28 !Image 1.png|align=center!
29
30 {{/panel}}
31
Kieran Kelleher 30.1 32 Make sure that you are in the WOLips perspective.
33
William Sandner 52.1 34 {{panel}}
Pascal Robert 28.1 35
William Sandner 52.1 36 !Image 6.png|align=center!
37 !Image 7.png|align=center!
Pascal Robert 28.1 38
William Sandner 52.1 39 {{/panel}}
Kieran Kelleher 30.1 40
William Sandner 52.1 41 Import the XcodeMigration tool into Eclipse, by selecting //File// > //Import//.
Pascal Robert 34.1 42
William Sandner 52.1 43 {{panel}}
Kieran Kelleher 30.1 44
William Sandner 52.1 45 !Image 2.png|align=center!
46
47 {{/panel}}
48
Pascal Robert 44.1 49 Select //Existings Projects into Workspace// and click //Next//.
Kieran Kelleher 30.1 50
William Sandner 52.1 51 {{panel}}
Pascal Robert 28.1 52
William Sandner 52.1 53 !Image 3.png|align=center!
54
55 {{/panel}}
56
Pascal Robert 44.1 57 Select the location of the ZIP file with the tool and click //Finish//.
Kieran Kelleher 30.1 58
Pascal Robert 44.1 59 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 60
William Sandner 52.1 61 {{panel}}
Pascal Robert 28.1 62
William Sandner 52.1 63 !Image 8.png|align=center!
Pascal Robert 28.1 64
William Sandner 52.1 65 {{/panel}}
66
67 {{panel}}
68
69 !Image 9.png|align=center!
70
71 {{/panel}}
72
Pascal Robert 44.1 73 You should see the tool and the two templates in the //WO Package Explorer//.
Kieran Kelleher 30.1 74
William Sandner 52.1 75 {{panel}}
Kieran Kelleher 30.1 76
William Sandner 52.1 77 !Image 10.png|align=center!
78
79 {{/panel}}
80
Pascal Robert 44.1 81 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 82
Pascal Robert 44.1 83 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 84
Pascal Robert 44.1 85 Right-click on the //XCodeMigration.java// class and select //Run As// > //Open Run dialog...//
Kieran Kelleher 30.1 86
William Sandner 52.1 87 {{panel}}
Kieran Kelleher 30.1 88
William Sandner 52.1 89 !Image 12.png|align=center!
90
91 {{/panel}}
92
Pascal Robert 44.1 93 Double-click on //Java Application//.
Kieran Kelleher 30.1 94
William Sandner 52.1 95 {{panel}}
Pascal Robert 17.1 96
William Sandner 52.1 97 !Image 13.png|align=center!
98
99 {{/panel}}
100
Pascal Robert 44.1 101 Click on the //Arguments// tab and enter this value as a //Program arguments//.
102
103 {{code}}
104
Pascal Robert 17.1 105 ${project_loc}/config.xml
106
Pascal Robert 44.1 107 {{/code}}
Pascal Robert 17.1 108
William Sandner 52.1 109 {{panel}}
Pascal Robert 44.1 110
William Sandner 52.1 111 !Image 21.png|align=center!
112
113 {{/panel}}
114
Pascal Robert 44.1 115 Click //Apply// and click //Run//.
116
Kieran Kelleher 30.1 117 When it's running, you should see a output like this:
118
William Sandner 52.1 119 {{panel}}
Kieran Kelleher 30.1 120
William Sandner 52.1 121 !Image 16.png|align=center!
122
123 {{/panel}}
124
Pascal Robert 44.1 125 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 126
William Sandner 52.1 127 {{panel}}
Kieran Kelleher 30.1 128
William Sandner 52.1 129 !Image 17.png|align=center!
130
131 {{/panel}}
132
Pascal Robert 44.1 133 Your converted projects will appear in the //WO Package Explorer//.
Kieran Kelleher 30.1 134
William Sandner 52.1 135 {{panel}}
Pascal Robert 17.1 136
William Sandner 52.1 137 !Image 18.png|align=center!
138
139 {{/panel}}
140
Kieran Kelleher 30.1 141 Fix all frameworks dependencies and any other build errors.&nbsp; It's done.
142
Pascal Robert 44.1 143 = FAQ =
Pascal Robert 17.1 144
Pascal Robert 44.1 145 **Q.**&nbsp; I can't a //Could not find working dir for project// error when I launch my converted application.
146 **A.**&nbsp; Make sure that, in //config.xml//, //<applicationTemplatePath>// is set to a WO application instead of a WO framework.
Pascal Robert 17.1 147
Pascal Robert 44.1 148 **Q.**&nbsp; Some of my resources are missing or in the wrong folder.
149 **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 150
Pascal Robert 44.1 151 **Q.**&nbsp; My application is localized and the content in the components are displaying the wrong caracters.
152 **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.