We have internal framework (let’s call it Testable) as a target of Application Project. Testable is used in several targets of Application project and we don’t want to extract it to separate repo for a series of reasons. So our setup is following:
Workspace(App)
- Application Project
- Testable Framework
- Tests for Testable (uses Testable)
- Other Internal framework (uses Testable)
- Tests for Other internal Framework (use Testable)
- Application 1 (use Testable)
- Tests for Application 1 (use Testable)
- Application 2 (use Testable)
- Tests for Application 2 (use Testable)
… Other targets
- Pods Project
… pods targets
Next we introduced new internal framework(let’s call it Science) as a separate project in it’s own repo. Science project is stored close to App and uses Testable by :path => ‘relative path to project’.
.
Setup is following:
Workspace(Science)
- Science Project
- Science Framework (uses Testable)
- Tests for Science Framework
- Pods Project
Testable as -> pod 'Testable', :path => ‘../App/Testable'
Folders structure:
Project Folder
- App Folder
- Testable Folder
- Science Folder
Science.podspec:
Pod::Spec.new do |s|
s.name = ‘Science'
s.version = '0.1'
s.summary = 'Some Summary’
s.description = <<-DESC
Some description
DESC
s.homepage = 'https://github.com/‘
s.license = { :type => 'MIT', :text => <<-LICENSE
TEXT OF LICENSE
LICENSE
}
s.author = { ‘Author’ => 'aa@bb.cc’ }
s.source = { :git => 'https://github.com/..’, :tag => "v#{s.version}" }
s.source_files = '**/*.swift'
s.frameworks = 'Testable'
s.platform = :osx
s.osx.deployment_target = '11.0'
end
Steps
- We connected Science Framework into App’s Workspace by:
pod ’Science’, :git => ‘url to git repo’, :tag => ‘some tag’
- We did
pod install
and it finished successfully - We run build Application 1 from Workspace(App)
Expected
We expect that Application 1 is built successfully. So Testable dependency is correctly resolved for Science Pod and all the other targets in Workspace(App)
Actual
Swift Compiler Error: No such module 'Testable' that is displayed for each import Testable
inside Science Pod *.swift files