2

I have the following Podfile:

platform :ios, '7.0'
pod 'CocoaLumberjack'
target :MyProjectTests do
   pod 'OCHamcrest'
end

I want to include CocoaLumberjack in all targets and OCHamcrest only in the test target. This seems to work great when I was using GHUnit (as I had to create a specific GHUnit test target).

However, I thought I would try XCTest to see how I like it (given that GHUnit seems to be getting a few cobwebs and has changed ownership recently).

When I check my Pods.xconfig, it shows that it is including OCHamcrest

HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers" "${PODS_ROOT}/Headers/CocoaLumberjack" "${PODS_ROOT}/Headers/OCHamcrest"

So, it looks like XCTests are not a separate target.

What can I do to ensure that I'm not including testing frameworks in my release build? Is this something I have to manually manage or can Cocoapods do this for me?,

4

1 回答 1

2

这应该可以解决问题。

target :MyProjectTests, :exclusive => true do
   pod 'OCHamcrest'
end

来源: http: //guides.cocoapods.org/syntax/podfile.html#target

于 2014-01-12T20:31:49.080 回答