trinhngocthuyen / cocoapods-spm

A CocoaPods plugin to add SPM dependencies to CocoaPods-based projects
MIT License
36 stars 7 forks source link

Podspecs should not specify the source of SPM dependencies #8

Closed trinhngocthuyen closed 7 months ago

trinhngocthuyen commented 7 months ago

This is similar to how we declare pod dependencies. In podspecs, we declare the dependency like s.dependency "A" without its source (ex. :git => "...", :tag => "..."). The same should apply to how we declare SPM dependencies.

Proposed changes

In podspecs, declare just dependencies without their sources:

# In podspec

Pod::Spec.new do |s|
  ...
  s.spm_dependency "swift-syntax/SwiftSyntaxMacros"
end

In Podfile, declare the sources of those SPM packages

# In Podfile

spm_pkg "swift-syntax",
        :url => "https://github.com/apple/swift-syntax.git",
        :requirement => { :kind => "version", :from => "509.0.0" }