Contents

thelookoutway/configcop

A Swift command line application that verifies `.xcconfig` files against a template.

Installation

Make (Recommended)

This will build the command line application and install it to /usr/local/bin.

$ git clone https://github.com/fivegoodfriends/ConfigCop.git
$ cd ConfigCop
$ make

Swift Package Manager

$ git clone https://github.com/fivegoodfriends/ConfigCop.git
$ cd ConfigCop
$ swift build

After building with SPM you can manually copy the executable file to any location you like, such as /usr/local/bin or run $ make to do this for you.

Creating a Template File

In order to verify your xcconfig files, a template is needed to compare against. You can create this template file anywhere, in your project probably makes sense.

A section named required: is required so that there is something to compare against. The optional: section is for, well, optional keys. Put all keys that must appear in your xcconfig file(s) in the required list. Optional keys will not cause the application to fail, but wil generate a warning if they are missing from the config.

Here is an example file called AppConfigTemplate.yml:

required:
  - MARKETING_VERSION
  - SWIFT_VERSION
  - ENABLE_BITCODE
  - PRODUCT_BUNDLE_IDENTIFIER
  - BASE_URL
optional:
  - TEST_URL

Usage

Assuming /usr/local/bin is in your $PATH you can run as follows:

configcop -c ~/iOSApp/Configs/Debug.xcconfig -t ~/Code/iOSApp/Configs/ConfigTemplate.yml

Package Metadata

Repository: thelookoutway/configcop

Default branch: master

README: README.md