tree: 029f18a61b2f7e3d9da9fc2c012542f395293228 [path history] [tgz]
  1. bin/
  2. lib/
  3. spec/
  4. support/
  5. earlgrey.gemspec
  6. Gemfile
  7. LICENSE
  8. Rakefile
  9. README.md
gem/README.md

EarlGrey

Gem Version

Automatically installs EarlGrey. Supports carthage, cocoapods, and Swift.

$ earlgrey help install
Usage:
  earlgrey install -t, --target=TARGET

Options:
  -p, [--project=PROJECT]            # Project
  -t, --target=TARGET                # EarlGrey
  -s, [--scheme=SCHEME]              # EarlGrey.xcscheme
      [--carthage], [--no-carthage]
                                     # Default: true
      [--swift], [--no-swift]
                                     # Default: true
      [--swift-version]
                                     # Default: 3.0
                                     # Supported Values: 2.3, 3.0.

Installs EarlGrey into an Xcode unit test target

Usage

Create new Target iOS Unit Testing Bundle then add a new scheme Product → Scheme → Manage Schemes and mark it as shared. See EarlGrey docs for screenshots

Now run the install command with the test target name:

  • earlgrey install -t AutoEarlGrey

See the example project which defines AutoEarlGrey.

Rake

The gem uses Rake to define common tasks. The tests are run with rake spec. By default rake will run spec, rubocop, and warn.

$ rake -T
rake build                 # Build the earlgrey gem into the pkg directory
rake clean                 # Remove any temporary products
rake clobber               # Remove any generated files
rake install               # Build and install earlgrey gem into system gems
rake install:local         # Build and install earlgrey gem into system gems without network access
rake release[remote]       # Create a version tag and build and push earlgrey gem to Rubygems
rake rubocop               # Run RuboCop
rake rubocop:auto_correct  # Auto-correct RuboCop offenses
rake spec                  # Run RSpec code examples
rake warn                  # Check for warnings

Notes

The install command does the following by default:

-- Adds EarlGrey.swift to test target

  • FRAMEWORK_SEARCH_PATHS = “$(SRCROOT)/Carthage/Build/iOS”;
  • HEADER_SEARCH_PATHS = “$(SRCROOT)/Carthage/Build/iOS/**”;
  • Add EarlGrey.swift to compile sources (PBXSourcesBuildPhase)
  • Link binary with libraries. EarlGrey.framework
  • Use carthage copy-files to ensure frameworks are signed, dSYMs/BCSymbolMaps copied. Carthage doesn't sign when building.
  • Updates scheme DYLD_INSERT_LIBRARIES so it can find EarlGrey.framework