Один файл корзины для указания и установки зависимостей для нескольких целей - PullRequest
2 голосов
/ 19 апреля 2019

Есть ли способ написать один файл Cartfile, который можно использовать для установки зависимостей, необходимых для нескольких целей.Это может быть достигнуто, когда мы используем Cocoapods, как показано ниже:

# 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

Пожалуйста, дайте мне знать, можем ли мы достичь подобного результата при использовании Карфагена?то есть, записав все зависимости, необходимые для всех целей в одном карт-файле, а затем установив их с помощью Carthage?

Почему я хочу сделать это, я чувствую, что, поскольку мы продолжаем добавлять зависимости к различным целям (каркасам), используемым в приложении, будет легко поддерживать, если у нас есть все зависимости, перечисленные водин файл корзины.Заранее спасибо.

1 Ответ

3 голосов
/ 19 апреля 2019

Это невозможно сделать в Карфагене, и , вероятно, никогда не будет поддерживаться .

Вы можете перечислить все зависимости в одном Cartfile, но вам все равно придется вручную выбрать и добавить их в linked frameworks and libraries.

вашей цели.
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...