Ios 单个cartfile可指定和安装多个目标的依赖项
是否有一种方法可以编写单个cartfile,用于安装多个目标所需的依赖项。当我们使用CoCoapod时,可以实现这一点,如下所示:Ios 单个cartfile可指定和安装多个目标的依赖项,ios,swift,carthage,Ios,Swift,Carthage,是否有一种方法可以编写单个cartfile,用于安装多个目标所需的依赖项。当我们使用CoCoapod时,可以实现这一点,如下所示: # Uncomment the next line to define a global platform for your project platform :ios, '11.0' def rx_swift pod 'RxSwift', '~> 4.0' end def rx_cocoa pod 'RxCocoa', '~> 4.
# Uncomment the next line to define a global platform for your project
platform :ios, '11.0'
def rx_swift
pod 'RxSwift', '~> 4.0'
end
def rx_cocoa
pod 'RxCocoa', '~> 4.0'
end
def test_pods
pod 'RxTest'
pod 'RxBlocking'
pod 'Nimble'
end
target 'CleanArchitectureRxSwift' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
rx_cocoa
rx_swift
pod 'QueryKit'
target 'CleanArchitectureRxSwiftTests' do
inherit! :search_paths
test_pods
end
end
target 'CoreDataPlatform' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
rx_swift
pod 'QueryKit'
target 'CoreDataPlatformTests' do
inherit! :search_paths
test_pods
end
end
target 'Domain' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
rx_swift
target 'DomainTests' do
inherit! :search_paths
test_pods
end
end
target 'NetworkPlatform' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
rx_swift
pod 'Alamofire'
pod 'RxAlamofire'
target 'NetworkPlatformTests' do
inherit! :search_paths
test_pods
end
end
target 'RealmPlatform' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
rx_swift
pod 'RxRealm', '~> 0.7.1'
pod 'QueryKit'
pod 'RealmSwift', '~> 3.10'
pod 'Realm', '~> 3.10'
target 'RealmPlatformTests' do
inherit! :search_paths
test_pods
end
end
请让我知道,在使用迦太基时,我们是否可以实现类似的目标?i、 e.将所有目标所需的所有依赖项写入一个carthage文件,然后使用carthage安装它们
我之所以要这样做,是因为我觉得,随着我们继续向应用程序中使用的不同目标(框架)添加依赖项,如果我们在单个文件中列出了所有依赖项,那么维护起来就会很容易。
提前感谢。在迦太基不可能做到这一点,而且
您可以在一个Cartfile中列出所有依赖项,但是您仍然需要手动选择它们并将它们添加到目标的
链接框架和库中
我最近(从Carthage)搬到了CoCoCoaPod,我相信它更容易与不同的目标协同工作。此外,不需要手动框架/二进制/脚本!