dpogue commented on issue #506:
URL: https://github.com/apache/cordova-ios/issues/506#issuecomment-2316875609

   I looked into this, to see if we might be able to copy the buildFlag values 
to an xcconfig file for preserving between builds, but I don't think it's going 
to be possible. There are (at least) 2 issues that prevent this.
   
   1. Not all build flags are options that can be set via xcconfig.
   
     In the examples given, `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=YES` could 
be added to an xcconfig file and it would work as expected. However, something 
like `-UseModernBuildSystem=0` or `-quiet` is a command-line option to the 
xcodebuild tool and there's no way to set those (some of them may have their 
own variables that can be set in xcconfig, but it's not a 1-to-1 mapping that 
we could easily transform at prepare time).
   
   2. Distinguishing between build.json-injected flags and plugin-injected 
flags when flags are removed.
   
     Assuming that we write all the flags from build.json to the xcconfig file, 
we wouldn't have a way of distinguishing those build flags from ones that a 
plugin injects to the xcconfig file. Hence, if a flag is removed from 
build.json, and we want to remove it from the xcconfig, it's impossible to know 
which lines are safe to remove.
     
     This also opens the door for conflicting flags if something is specified 
in both build.json and a plugin. Right now, build.json wins because it provides 
the flags as part of the xcodebuild command line, but if the flags were 
combined into an xcconfig file there could be issues relating to order in which 
plugins are added and flags getting duplicated with different values.
   
   I think the (ugly) workaround would be to add a hook script to your Cordova 
project that injects the flags you want into an xcconfig file. Those would 
persist between builds and in Xcode, but the responsibility for getting the 
right flag names and handling flag conflicts/removals would fall on you as the 
app author.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to