3
votes

I have this very simple iOS project. It's using Cocoapods for dependency management, and includes AFNetworking as one of its dependency. Currently, my project code is just doing a simple http GET request and the test (written using Specta) checks if it succeeds.

Now, I'm trying to CI it with Travis-CI. I've already checked out xctool CI tutorial and objective-c CI manual from Travis-CI, my current .travis-ci.yml is:

language: objective-c
xcode_project: Foobar.xcodeproj
xcode_schema: Foobar

The last output lines from CI console are:

The command "echo " Check out our documentation for more information: http://about.travis-ci.org/docs/user/languages/objective-c/"" exited with 0.
Done. Your build exited with 0.

It seems to me that nothing has been tested. There's definitely something wrong with my .travis.yml. So my questions are:

  1. There's a .xworkspace file generated by Cocoapods, so which one do I use in .travis.yml, the .xcodeproj or .workspace?
  2. Which scheme to use, Foobar or FoobarTests?
  3. Do I still need to additionally specify script: xctool ... command?
  4. From xctool CI tutorial:

    Click the + button and add each dependency to the project. CocoaPods will appear as a static library named Pods.

I cannot add Pods project as a whole, but rather each independent projects. Is this right? And does it mean that I have to do each time I add a library to Podfile?

1
I can say xcworkspace and FoobarTests for 1 and 2, but thats about all I can help with.Schemetrical

1 Answers

0
votes

I figured it out with the help of @Schemetrical 's comment above and, a review of my .travis.yml. There turns out to be a typo: xcode_schema should be xcode_scheme...

So, as a result, here's my .travis.yml:

language: objective-c
xcode_workspace: Foobar.xcworkspace
xcode_scheme: Foobar

For vanilla Cocoapods generated project/workspace, there's no such scheme called FoobarTests, but rather only one named Foobar. So this should answer questions 1-3 above.

For question 4, I added only two additional targets: Pods-Foobar and Pods-FoobarTests, and they should contain all dependencies from your Podfile.