使用 Cocoapods 指向 github 存储库时,是否可以指定子文件夹?
When pointing to a github repo with Cocoapods, is there a way to specify a subfolder?
我正在使用一个 repo 的分支,其中包含一个更大的项目和一个子文件夹中的 SDK。 podspec 有一个 source_files
属性 配置子文件夹,但是顶级 repo 不知道 podspec,所以指向:
pod 'PodName', :git => 'https://github.com/owner/project.git'
... 失败,因为根目录中没有 podspec。有没有办法在将 Cocoapods 指向 git 存储库时指定使用子文件夹?
类似于:
pod 'PodName', :git => 'https://github.com/owner/project.git', :subfolder => '/subfolder/path/to/podspec'
我可以通过指向 github 上的原始文件并使用 podspec 选项来做到这一点。 Cocoapods 期望 pod 规范位于具有所有 :git =>
选项的根目录中,但您可以使用 :podspec =>
选项直接指向文件。
pod 'PodName', :podspec => 'https://raw.githubusercontent.com/owner/project/branch/subfolder/project.podspec'
我正在使用一个 repo 的分支,其中包含一个更大的项目和一个子文件夹中的 SDK。 podspec 有一个 source_files
属性 配置子文件夹,但是顶级 repo 不知道 podspec,所以指向:
pod 'PodName', :git => 'https://github.com/owner/project.git'
... 失败,因为根目录中没有 podspec。有没有办法在将 Cocoapods 指向 git 存储库时指定使用子文件夹?
类似于:
pod 'PodName', :git => 'https://github.com/owner/project.git', :subfolder => '/subfolder/path/to/podspec'
我可以通过指向 github 上的原始文件并使用 podspec 选项来做到这一点。 Cocoapods 期望 pod 规范位于具有所有 :git =>
选项的根目录中,但您可以使用 :podspec =>
选项直接指向文件。
pod 'PodName', :podspec => 'https://raw.githubusercontent.com/owner/project/branch/subfolder/project.podspec'