cordova-ios
cordova-ios copied to clipboard
[Feature Request] Set XCode project settings from buildConfig JSON
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.
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.
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 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!
@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
Whoops! Didn't mean to close.
@l3ender What do you think about my response? Does this make sense to you?
@janpio Yes, it makes sense. So it seems like this makes sense as a feature request?
Yes, let's track this as a possible enhancement
. Someone will have to think through all the implications this might have.