2

I'm using Tavis CI to build a cocoapod project. I'm not sure if build is the right word, because I'm not exactly sure what it is doing. This is what I believe, and please correct me where I'm wrong and fill in any blanks.

I write a travis.yml file which is a script that sets up the virtual machine, and tests whether importing a pod (cocoapod files) works properly.

The travis script has a few components I'd need for a cocoapod are

  • language (self explanatory)
  • cache (named cache for build)
  • podfile (path to podfile)
  • before_install (commands to run to set up the test), and
  • script (the test)

travis.yml

language: objective-c
cache: cocoapods
podfile: Example/Podfile
sudo: required
before_install:
- gem install activesupport
- gem install cocoapods
- pod install --project-directory=Example
script:
- set -o pipefail && xcodebuild test -workspace Example/Workspace.xcworkspace -scheme YourApp-Example -sdk iphonesimulator -arch i386 ONLY_ACTIVE_ARCH=NO | xcpretty
- pod lib lint
... ... ... ... ... ...

The gem installs are because cocoapods. Then pod install loads the pod to the project directory.

The script then builds the test modules of the project with the set and xcodebuild commands. I'm not sure why the pods need to be linted, but then they are as per the official cocoapod guide

I'm getting the following error from travis ci:

Unable to find a specification for `MyLib` 

at the line

pod install --project-directory=Example

The podspec file is valid and it's even uploaded to the cocoapod master repo. I've created another project, used pod install to install MyLib, and even archived it and it all works fine. But Travis CI keeps getting the same error.

Community
  • 1
  • 1

0 Answers0