How to Configure Full Urls in Xcconfig Files

How do I configure full URLs in xcconfig files

Here's a simple workaround:

WEBSITE_URL = https:/$()/www.example.com

Configure associated domain from .xcconfig

Instead of using a variable for the ASSOCIATED_DOMAIN value, consider specifying a separate entitlements file for each of the schemes.
In the relevant xcconfig file, this can be done by setting:

CODE_SIGN_ENTITLEMENTS = [location of the file].entitlements

Debug configuration file (.xcconfig)

Just open the project navigator and select "Build Settings". If you have specified the config files correctly and added any setting to that file, a new column will appear, one for the xcconfig file for each target and on for the project as whole. The column to the far left is a "sum" of all you settings, and there you can verify that the settings you look for are set.

EDIT: Adding some pictures to show the columns with different config file settings.

Build settings without any property in the projects xcconfig file:
Without any setting in the project config file

And the same with some settings in the projects xcconfig file:
With setting in the project config file

The same applies for the Target as seen in the following two pictures:

No settings in the targets config file:
Without any settings in the targets config file

Some settings in the targets config file:
With settings in the targets config file

Check out this beginners tutorial for more visual examples and a step-by-step guide:
http://www.jontolof.com/cocoa/using-xcconfig-files-for-you-xcode-project/

Good luck!

XCConfig syntax

This is all about bash, not xcconfig files. The xcconfig file only establishes a build setting. By default, build settings are exported to run-script build phases as environment variables. That's the only relationship between the two. The format of xcconfig files was only relevant while reading the xcconfig file.

From the bash man page section on Parameter Expansion:

${parameter/pattern/string}

The pattern is expanded to produce a pattern just as in pathname expansion. Parameter is expanded and the longest match of pattern against its value is replaced with string. […] If string is null, matches of pattern are deleted and the / following pattern may be omitted. […]

So, "${PREPROCESSOR_DEFINTIONS/CRASHLYTICS=1}" expands PREPROCESSOR_DEFINTIONS but removes all instances of CRASHLYTICS=1 from the resulting string.

The single = is not assignment. It's the equals comparison. Bash also supports == but, as the man page says:

= may be used in place of == for strict POSIX compliance.

So, technically, = is the more standard.

Thus, the if is testing if PREPROCESSOR_DEFINTIONS doesn't contain CRASHLYTICS=1. If it did contain it, then the expansion with CRASHLYTICS=1 removed would not equal the unmodified expansion.

Of course, this makes sense given the echo statements in each branch of the if.



Related Topics



Leave a reply



Submit