创建一个Pod,Cocoapods lint source_files问题 [英] Creating a Pod, Cocoapods lint source_files issue
问题描述
我正在创建一个静态库,我想创建一个podspec,以便它也可以包含在其他项目中。为了生成适当的pod结构,我使用了一个命令:
I am creating a static library and I want to make a podspec so it can be included in other projects as well. To generate proper pod structure I used a command :
pod lib create <library_name>
它产生了以下结构
- .podspec
- CHANGELOG.md
- 课程
- 项目
- README.md
- Rakefile
- LICENSE
- .podspec
- CHANGELOG.md
- Classes
- Project
- README.md
- Rakefile
- LICENSE
我在projects目录中创建了一个新的Xcode项目。我还在项目中添加了两个名为Test1.h和Test2.h的文件,并将它们保存在classes目录中。另外,我添加了标题搜索路径变量到xCode项目设置,../ Class /所以类和&编译器可以看到其他目录中的标头。
(有没有办法在Xcode中有一个组,所有类都添加到它,转到Classes目录,编译器可以自动看到它们?)
I created a new Xcode project inside the "projects" directory. I also added two files to the project called Test1.h and Test2.h and saved them inside classes directory. Plus I added, header search path variable to xCode project settings, "../Classes/" so the classes & headers in other directories are are seen by compiler. (Is there a way to have a group in Xcode such that all classes added to it, go to Classes directory, and compiler can see them automatically ?)
所以现在它看起来像这样
So now it looks like this
- .podspec
- CHANGELOG .md
- 课程
- Test1.h
- Test2.m
- .podspec
- CHANGELOG.md
- Classes
- Test1.h
- Test2.m
- (文件夹)
- .xcodeproj
- 测试
- Podfile
- (folder)
- .xcodeproj
- Tests
- Podfile
在我的podspec中,我对源文件有以下设置
In my podspec I have the following setting for source files
s.source_files ='Classes / *。{h,m }'
s.source_files = 'Classes/*.{h,m}'
但是当我跑步时:
pod spec lint .podspec
pod spec lint .podspec
我收到以下错误:
- 错误|
source_files
模式与任何文件都不匹配。
- ERROR | The
source_files
pattern did not match any file.
分析1 podspec。
Analyzed 1 podspec.
[!]规范没有通过验证。
[!] The spec did not pass validation.
什么是问题在这里?我已经被困在这几个小时了。
What is the issue here? I have been stuck on this for hours.
推荐答案
这也让我疯狂了几个小时。然后我发现源git仓库中必须存在文件和标签。因此,请确保将代码和代码推送到远程仓库...
This was also driving me nuts for 'hours'. I then discovered that the files and tags must be present in the source git repo. So make sure you push your code and your tags to the remote repo...
更新:
你也可以做一个'pod lib lint'来lint本地文件而不是git repo。
You can also do a 'pod lib lint' to lint the local files not the git repo.
这篇关于创建一个Pod,Cocoapods lint source_files问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!