[ 
https://issues.apache.org/jira/browse/CB-5921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13885433#comment-13885433
 ] 

Shazron Abdullah commented on CB-5921:
--------------------------------------

We never went for the workspace route because of inertia -- the use of 
CordovaLib started in Xcode 3.x (this was almost 5 years ago, wow) which 
predates the workspace feature which was first introduced in Xcode 4.

One of the purported advantages of workspaces is implicit dependencies (without 
manual tinkering) -- and it appears to work using the GUI but absolutely fails 
using xcodebuild on the command-line. You have to tinker with the project's 
scheme and explicitly add CordovaLib first in the Build Phase. That's no biggie 
however since we can ship the template however we want.

The only major changes are in how xcodebuild is called in the "cordova" 
subfolder which contains all the command-line scripts, which are important for 
the Cordova CLI. These changes should not have any impact on the CLI since the 
interface is the same.

My suggestion is:
1.Create the [ProjectName].workspace file as a sibling to 
[ProjectName].xcodeproj -- include CordovaLib.xcodeproj and 
[ProjectName].xcodeproj as its projects 
2. CordovaLib.xcodeproj should be removed as the subproject of 
[ProjectName].xcodeproj
3. bin/update_cordova_subproject script needs to be changed
4. Update any other upgrade scripts
5. Update the upgrade docs

Future thinking - this could also provide an easier way to add plugin code - 
each iOS plugin's code could be added separate project (which is added to the 
workspace) -- it will be easier to generate a .pbxproj from scratch and it will 
be less error-prone than editing the main project's .pbxproj. This is a major 
change that might not be worth it (yet). Problems could be - addition of 
resource bundles (for example the Dialogs plugin) and possibly dependencies 
(since each plugin will be dependent on CordovaLib).

> Cordova on iOS should use an XCWorkspace, or at least support using one.
> ------------------------------------------------------------------------
>
>                 Key: CB-5921
>                 URL: https://issues.apache.org/jira/browse/CB-5921
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: iOS
>            Reporter: Graham Mueller
>            Priority: Minor
>              Labels: core
>
> Hi Guys,
> Not sure what to log this as. It's not so much a bug as an incompatibility 
> with other frameworks. Anyway, this is specifically an issue with the build 
> process on iOS. Do with it what you will.
> If you're familiar with the CocoaPods framework, you'll know that on initial 
> install, it creates an XCWorkspace file, and instructs you to exclusively use 
> that afterwards. This is because the CocoaPods library adds itself as a 
> linked project that must be built, similar to Cordova/Phonegap. The 
> difference is that Cordova adds itself as a sub project, instead of a sibling 
> project (which is effectively the workspace goal, from my understanding, 
> though I'm having a hard time finding a good link to explain it better).
> So, I would suggest that Cordova moves to this setup as well -- it should 
> create the workspace that has both the Cordova project and your app project.
> Alternatively, if you don't want to go through and change that creation code, 
> it would be great if the CLI offered someway to specify what you want it to 
> build. I found the actual build script that's calling xcodebuild with a 
> -project flag in it (this is where -workspace would go). There is currently 
> no way to override this, so there is currently no way at all to support 
> workspaces (and consequently no way to use CocoaPods).
> Any thoughts or reasons not to do so?
> Thanks,
> Graham



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to