Open ealeksandrov opened 7 years ago
@ealeksandrov have you verified whether this works when building from the command line?
@samdods yep, it generates different configs when using xcodebuild
with different -scheme
option.
Important part here is to mark scheme as shared
to save script in source control and reuse inside dev team and CI.
Thanks, I'll update the readme and the blogpost
On 20 Oct 2017, at 11:44, Evgeny Aleksandrov notifications@github.com wrote:
@samdods yep, it generates different configs when using xcodebuild with different -scheme option. Important part here is to mark scheme as shared to save script in source control.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Cool! You can also mention configen
availability on homebrew - #22.
@ealeksandrov, when using your configuration, I don't seem to get build errors when there's a problem.
@samdods output (stdout/stderr) from scheme scripts are not redirected into Xcode.
But function output can be checked and handled in same script like:
configen -p ${SRCROOT}/Configs/prod-config.plist -h ${SRCROOT}/Configs/AppEnvironment.map -n AppConfig -o ${SRCROOT}/Configs
if [ $? -ne 0 ]
then rm ${SRCROOT}/Configs/AppConfig.swift
fi
I can confirm it's working for me. If any error arises - AppConfig.swift
will be removed to trigger compile-time error.
Another good idea is to append/replace this file with error string, Xcode will stop on it and present to user. But it will require little more bash-magic. And maybe this should go into configen
itself since it already generates this file?
Not sure about your direction and vision here. Let me know how can I help!
Why is this so complex? I found adding
build pre-action
in scheme settings working just fine:Am I missing something?