cordova-ios icon indicating copy to clipboard operation
cordova-ios copied to clipboard

[Feature Request] Set XCode project settings from buildConfig JSON

Open l3ender opened this issue 6 years ago • 8 comments

The command cordova platform add ios generates an XCode workspace (if it doesn't exist), but the workspace won't have settings that are configured in a build.json.

For example, I run the following commands:

cordova platform add ios
cordova run ios --buildConfig build.json

Here is my build.json:

"ios": {
    "debug": {
      ...
      "buildFlag": [
        "-UseModernBuildSystem=0",
        "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=YES"
      ]
    }
}

This command allows you to run the iOS app on device/simulator, and it will correctly build/compile based on properties in the buildConfig file. If I now use XCode to open the workspace that was generated by cordova platform add ios, the workspace that does not have the same workspace settings configured (in my scenario, ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES is not configured). Any settings will need to be manually configured in XCode if I want to open the project in XCode and run the app from there.

I think expected behavior would be that if I run the app from the Cordova CLI OR have the CLI generate an XCode workspace and run the app from there, the app should react the same.

l3ender avatar Jan 26 '19 23:01 l3ender

build.json is a build configuration file, not a project configuration file. It is meant to influence the execution of a build by the Cordova CLI, not the project creation.

That being said, this might be an interesting idea that might be worth looking into.

janpio avatar Jan 26 '19 23:01 janpio

The real question is why is there debug and release sections in the json.build but only either one makes it to BOTH debug/release sections in the xcode project depending on the --debug/--release switch in cordova CLI. it does not make too much sense. A much better way would be to populate xcode project with both debug and release profiles and then just compile/build the correct version depending on the cli switch.

Is there anything i'm missing? maybe i did not understand how to use it correctly?

godexsoft avatar Jan 28 '19 12:01 godexsoft

@godexsoft You are definitely in the wrong issue - please create a new one for your problem - from a first reading it might be worth looking into what you describe, but not here in @l3ender 's unrelated issue. Thanks!

janpio avatar Jan 28 '19 12:01 janpio

@godexsoft You are definitely in the wrong issue - please create a new one for your problem - from a first reading it might be worth looking into what you describe, but not here in @l3ender 's unrelated issue. Thanks!

seemed like a related issue to me. created a new one just now: #507 Thanks

godexsoft avatar Jan 28 '19 12:01 godexsoft

Whoops! Didn't mean to close.

l3ender avatar Feb 07 '19 21:02 l3ender

@l3ender What do you think about my response? Does this make sense to you?

janpio avatar Mar 01 '19 13:03 janpio

@janpio Yes, it makes sense. So it seems like this makes sense as a feature request?

l3ender avatar Mar 01 '19 18:03 l3ender

Yes, let's track this as a possible enhancement. Someone will have to think through all the implications this might have.

janpio avatar Mar 01 '19 18:03 janpio