Cod*_*der 1 xcode ios cocoapods
作为快速介绍,所有涉及的 cocoapods 都保存在私人存储库中。
一些一般信息:
我已经成功配置了一个私有规范存储库,两个 Cocoapod 已发布到该存储库。我的本地存储库已按照 Cocoapod 发布的步骤进行了更新,并且我验证了预期的podspec文件是否存在。
pod repo add my_repo https://gitsite.com/my-spec-repo.git
Run Code Online (Sandbox Code Playgroud)
然后在我的机器上验证:
cd ~/.cocoapods/repos/my_repo
pod repo lint .
Run Code Online (Sandbox Code Playgroud)
我还目视验证了是否存在正确的文件和版本。
然后我将源添加到消费应用程序中,Podfile如下所示:
source 'https://gitsite.com/my-spec-repo/'
source 'https://cdn.cocoapods.org/'
Run Code Online (Sandbox Code Playgroud)
完成所有这些步骤后,一切正常,我可以安装和使用 Pod。因此,到目前为止一切都很好。
我现在正在构建一个新的私人 Cocoapod,它必须消耗我的一个私人 Pod。
在我的podspec文件中,我标记了依赖关系:
s.dependency 'my_private_pod', '~> 1.2.3'
Run Code Online (Sandbox Code Playgroud)
我还在Podfile示例应用程序中包含了一个条目。
pod 'my_private_pod', '~> 1.2.3'
Run Code Online (Sandbox Code Playgroud)
当我更新新的私有 pod 上的存储库时pod repo update,一切正常,我看到 pod 成功安装并可以查看我的项目中的文件。
然而,问题在于试图对新 pod 进行 lint 并最终达到发布它的目的。
-> my_new_private_pod (0.0.1)
- ERROR | [iOS] unknown: Encountered an unknown error (Unable to find a specification for `my_private_pod (~> 1.2.3)` depended upon by `my_new_private_pod`
You have either:
* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
) during validation.
[!] my_new_private_pod did not pass validation, due to 1 error.
Run Code Online (Sandbox Code Playgroud)
正如刚才提到的:
Podfile中PodspecPodfile通过将 pod 成功安装到示例目标中来确认该存储库存在于& 中我也采取了一些额外的步骤。
pod deintegrate并重新安装我将lint命令修改为以下内容,现在它可以工作了:
pod lib lint --sources=my_repo,trunk
Run Code Online (Sandbox Code Playgroud)
显然,您必须lint使用该--sources标志向命令提供私有存储库。
就我而言,my_repo需要包含我的私人存储库,而trunk需要包含公共 Pod。两者的结合让可可足类感到高兴。
| 归档时间: |
|
| 查看次数: |
1862 次 |
| 最近记录: |