I have white label project (many app's on one source code). Usually I reuse one ViewController for many targets, but to test this ViewController in different targets I must add: @testable import TargetName
I have tried to create Swift Compiler - Custom Flag with:
- -D TARGET_TEST1
- -D TARGET_TEST2
and use:
//
#if TARGET_TEST1
@testable import TARGET_TEST1
#else
@testable import TARGET_TEST2
#endif
//
For testing in Xcode it's work, but if I start this on Xcode Server, I have error:
Use of undeclared type 'NameOfClass.swift'
Is it any other options how to provide @testable import for specific test target?